當前位置: 首頁>>代碼示例>>Java>>正文


Java ShippingAddress類代碼示例

本文整理匯總了Java中com.paypal.android.sdk.payments.ShippingAddress的典型用法代碼示例。如果您正苦於以下問題:Java ShippingAddress類的具體用法?Java ShippingAddress怎麽用?Java ShippingAddress使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ShippingAddress類屬於com.paypal.android.sdk.payments包,在下文中一共展示了ShippingAddress類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getShippingAddress

import com.paypal.android.sdk.payments.ShippingAddress; //導入依賴的package包/類
/*****************************************************
 *
 * Returns a PayPal shipping address.
 *
 *****************************************************/
protected ShippingAddress getShippingAddress()
  {
  Address shippingAddress = mOrder.getShippingAddress();

  if ( shippingAddress != null )
    {
    return (
            new ShippingAddress()
                    .recipientName( shippingAddress.getRecipientName() )
                    .line1( shippingAddress.getLine1() )
                    .line2( shippingAddress.getLine2() )
                    .city( shippingAddress.getCity() )
                    .state( shippingAddress.getStateOrCounty() )
                    .postalCode( shippingAddress.getZipOrPostalCode() )
                    .countryCode( shippingAddress.getCountry().iso2Code().toUpperCase() ) );
    }


  return ( null );
  }
 
開發者ID:OceanLabs,項目名稱:Android-Print-SDK,代碼行數:26,代碼來源:DefaultPaymentFragment.java

示例2: addAppProvidedShippingAddress

import com.paypal.android.sdk.payments.ShippingAddress; //導入依賴的package包/類
private void addAppProvidedShippingAddress(PayPalPayment paypalPayment) {
    ShippingAddress shippingAddress =
            new ShippingAddress().recipientName("Mom Parker").line1("52 North Main St.")
                    .city("Austin").state("TX").postalCode("78729").countryCode("US");
    paypalPayment.providedShippingAddress(shippingAddress);
}
 
開發者ID:Gchorba,項目名稱:NickleAndDimed,代碼行數:7,代碼來源:SampleActivity.java

示例3: onPayPalClicked

import com.paypal.android.sdk.payments.ShippingAddress; //導入依賴的package包/類
/*****************************************************
 *
 * Called when pay by PayPal is clicked.
 *
 *****************************************************/
public void onPayPalClicked( View view )
  {
  SingleCurrencyAmounts totalCost = getTotalCost();

  if ( totalCost != null )
    {
    // Authorise the payment. Payment is actually taken on the server

    // TODO: Remove the credit card payment option
    PayPalPayment payment = new PayPalPayment(
            totalCost.getAmount(),
            totalCost.getCurrencyCode(),
            "Product",
            PayPalPayment.PAYMENT_INTENT_AUTHORIZE );


    // Add any shipping address

    ShippingAddress shippingAddress = getShippingAddress();

    if ( shippingAddress != null ) payment.providedShippingAddress( getShippingAddress() );


    Intent intent = new Intent( getActivity(), com.paypal.android.sdk.payments.PaymentActivity.class );

    intent.putExtra( com.paypal.android.sdk.payments.PaymentActivity.EXTRA_PAYMENT, payment );

    startActivityForResult( intent, ACTIVITY_REQUEST_CODE_PAYPAL );
    }
  }
 
開發者ID:OceanLabs,項目名稱:Android-Print-SDK,代碼行數:36,代碼來源:DefaultPaymentFragment.java


注:本文中的com.paypal.android.sdk.payments.ShippingAddress類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。