当前位置: 首页>>代码示例>>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;未经允许,请勿转载。