• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java Cart类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.google.android.gms.wallet.Cart的典型用法代码示例。如果您正苦于以下问题:Java Cart类的具体用法?Java Cart怎么用?Java Cart使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Cart类属于com.google.android.gms.wallet包,在下文中一共展示了Cart类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: createFullWalletRequest

import com.google.android.gms.wallet.Cart; //导入依赖的package包/类
/**
 * @param googleTransactionId
 * @return {@link FullWalletRequest} instance
 */
public FullWalletRequest createFullWalletRequest(String googleTransactionId) {

    // [START full_wallet_request]
    return FullWalletRequest.newBuilder()
            .setGoogleTransactionId(googleTransactionId)
            .setCart(Cart.newBuilder()
                    .setCurrencyCode(currency)
                    .setTotalPrice(cartTotal)
                    /*
                .addLineItem(
                        LineItem.newBuilder()
                                .setCurrencyCode("GBP")
                                .setQuantity("2")
                                .setUnitPrice("0.50")
                                .setTotalPrice("1.00")
                                .setDescription("Description")
                            .build())
                    */
                    .build())
            .build();
    // [END full_wallet_request]
}
 
开发者ID:Adyen,项目名称:adyen-android,代码行数:27,代码来源:AndroidPayActivity.java


示例2: getFullWalletRequest

import com.google.android.gms.wallet.Cart; //导入依赖的package包/类
FullWalletRequest getFullWalletRequest() {

        return FullWalletRequest.newBuilder()
            .setGoogleTransactionId(mMaskedWallet.getGoogleTransactionId())
            .setCart(Cart.newBuilder()
                .setCurrencyCode(Constants.DEFAULT_CURRENCY.getCode())
                .setTotalPrice("2.00")
                .addLineItem(LineItem.newBuilder()
                    .setCurrencyCode(Constants.DEFAULT_CURRENCY.getCode())
                    .setDescription(mShopItem.getName())
                    .setQuantity(Integer.toString(mShopItem.getAmount()))
                    .setUnitPrice("2.00")
                    .setTotalPrice("2.00")
                    .build())
                .build())
            .build();
    }
 
开发者ID:ChristopherAbram,项目名称:Book-Shelf,代码行数:18,代码来源:AndroidPayActivity.java


示例3: createFullWalletRequest

import com.google.android.gms.wallet.Cart; //导入依赖的package包/类
/**
 *
 * @param products {@link Product} to use for creating
 *                 the {@link com.google.android.gms.wallet.FullWalletRequest}
 * @param googleTransactionId
 * @return {@link FullWalletRequest} instance
 */
public static FullWalletRequest createFullWalletRequest(List<Product> products,
                                                        String orderTotal,
                                                        String googleTransactionId,
                                                        Context context) {

    List<LineItem> lineItems = buildLineItems(products, false, context);

    // [START full_wallet_request]
    FullWalletRequest request = FullWalletRequest.newBuilder()
            .setGoogleTransactionId(googleTransactionId)
            .setCart(Cart.newBuilder()
                    .setCurrencyCode(PreferencesUtil.getDefaultSharedPreferences(context).getString(context.getString(R.string.active_currency), "USD"))
                    .setTotalPrice(orderTotal)
                    .setLineItems(lineItems)
                    .build())
            .build();
    // [END full_wallet_request]

    return request;
}
 
开发者ID:Adyen,项目名称:adyen-android-pay-sample-code,代码行数:28,代码来源:WalletUtil.java


示例4: writeToParcel

import com.google.android.gms.wallet.Cart; //导入依赖的package包/类
@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeString(mAuthorization);
    dest.writeString(mAmount);
    dest.writeByte(mCollectDeviceData ? (byte) 1 : (byte) 0);

    try {
        Cart.class.getClassLoader();
        dest.writeParcelable(mAndroidPayCart, 0);
        dest.writeByte(mAndroidPayShippingAddressRequired ? (byte) 1 : (byte) 0);
        dest.writeByte(mAndroidPayPhoneNumberRequired ? (byte) 1 : (byte) 0);
        dest.writeTypedList(mAndroidAllowedCountriesForShipping);
    } catch (NoClassDefFoundError ignored) {}

    dest.writeParcelable(mGooglePaymentRequest, 0);
    dest.writeByte(mGooglePaymentEnabled ? (byte) 1 : (byte) 0);
    dest.writeByte(mAndroidPayEnabled ? (byte) 1 : (byte) 0);
    dest.writeStringList(mPayPalAdditionalScopes);
    dest.writeByte(mPayPalEnabled ? (byte) 1 : (byte) 0);
    dest.writeByte(mVenmoEnabled ? (byte) 1 : (byte) 0);
    dest.writeByte(mRequestThreeDSecureVerification ? (byte) 1 : (byte) 0);
}
 
开发者ID:braintree,项目名称:braintree-android-drop-in,代码行数:23,代码来源:DropInRequest.java


示例5: DropInRequest

import com.google.android.gms.wallet.Cart; //导入依赖的package包/类
protected DropInRequest(Parcel in) {
    mAuthorization = in.readString();
    mAmount = in.readString();
    mCollectDeviceData = in.readByte() != 0;

    try {
        mAndroidPayCart = in.readParcelable(Cart.class.getClassLoader());
        mAndroidPayShippingAddressRequired = in.readByte() != 0;
        mAndroidPayPhoneNumberRequired = in.readByte() != 0;
        in.readTypedList(mAndroidAllowedCountriesForShipping, CountrySpecification.CREATOR);
    } catch (NoClassDefFoundError ignored) {}

    mGooglePaymentRequest = in.readParcelable(GooglePaymentRequest.class.getClassLoader());
    mGooglePaymentEnabled = in.readByte() != 0;
    mAndroidPayEnabled = in.readByte() != 0;
    mPayPalAdditionalScopes = in.createStringArrayList();
    mPayPalEnabled = in.readByte() != 0;
    mVenmoEnabled = in.readByte() != 0;
    mRequestThreeDSecureVerification = in.readByte() != 0;
}
 
开发者ID:braintree,项目名称:braintree-android-drop-in,代码行数:21,代码来源:DropInRequest.java


示例6: onPaymentMethodSelected_startsAndroidPay

import com.google.android.gms.wallet.Cart; //导入依赖的package包/类
@Test
public void onPaymentMethodSelected_startsAndroidPay() {
    Cart cart = Cart.newBuilder().build();
    DropInRequest dropInRequest = new DropInRequest()
            .androidPayCart(cart)
            .androidPayShippingAddressRequired(true)
            .androidPayPhoneNumberRequired(true)
            .androidPayAllowedCountriesForShipping("US");
    mActivity.setDropInRequest(dropInRequest);
    mockStatic(AndroidPay.class);
    doNothing().when(AndroidPay.class);
    AndroidPay.requestAndroidPay(any(BraintreeFragment.class), any(Cart.class), anyBoolean(),
            anyBoolean(), any(ArrayList.class));

    mActivity.onPaymentMethodSelected(PaymentMethodType.ANDROID_PAY);

    verifyStatic();
    AndroidPay.requestAndroidPay(mActivity.braintreeFragment, cart, true, true,
            dropInRequest.getAndroidPayAllowedCountriesForShipping());
}
 
开发者ID:braintree,项目名称:braintree-android-drop-in,代码行数:21,代码来源:DropInActivityPowerMockTest.java


示例7: cartBuilder

import com.google.android.gms.wallet.Cart; //导入依赖的package包/类
Cart.Builder cartBuilder() {
  Cart.Builder builder = Cart.newBuilder()
    .setCurrencyCode(currencyCode)
    .setTotalPrice(totalPrice.toString())
    .setLineItems(lineItems);

  if (taxPrice != null) {
    builder.addLineItem(LineItem.newBuilder()
      .setCurrencyCode(currencyCode)
      .setDescription("Tax")
      .setRole(LineItem.Role.TAX)
      .setTotalPrice(taxPrice.toString())
      .build());
  }

  if (shippingPrice != null) {
    builder.addLineItem(LineItem.newBuilder()
      .setCurrencyCode(currencyCode)
      .setDescription("Shipping")
      .setRole(LineItem.Role.SHIPPING)
      .setTotalPrice(shippingPrice.toString())
      .build());
  }

  return builder;
}
 
开发者ID:Shopify,项目名称:mobile-buy-sdk-android,代码行数:27,代码来源:PayCart.java


示例8: getFullWalletRequest

import com.google.android.gms.wallet.Cart; //导入依赖的package包/类
FullWalletRequest getFullWalletRequest() {

        return FullWalletRequest.newBuilder()
                .setGoogleTransactionId(mMaskedWallet.getGoogleTransactionId())
                .setCart(Cart.newBuilder()
                        .setCurrencyCode(Constants.CURRENCY_CODE)
                        .setTotalPrice(Constants.AMOUNT)
                        .addLineItem(LineItem.newBuilder()
                                .setCurrencyCode(Constants.CURRENCY_CODE)
                                .setDescription("Iced Coffee")
                                .setQuantity("1")
                                .setUnitPrice(Constants.AMOUNT)
                                .setTotalPrice(Constants.AMOUNT)
                                .build())
                        .build())
                .build();
    }
 
开发者ID:simplifycom,项目名称:simplify-android-sample,代码行数:18,代码来源:ConfirmationActivity.java


示例9: createMaskedWalletRequest

import com.google.android.gms.wallet.Cart; //导入依赖的package包/类
/**
 * Creates a MaskedWalletRequest
 *
 * @param itemInfo {@link com.google.android.gms.samples.wallet.ItemInfo} containing details
 *                 of an item.
 * @return {@link MaskedWalletRequest} instance
 */
public static MaskedWalletRequest createMaskedWalletRequest(ItemInfo itemInfo) {

    // Build a List of all line items
    List<LineItem> lineItems = buildLineItems(itemInfo, true);

    // Calculate the cart total by iterating over the line items.
    String cartTotal = calculateCartTotal(lineItems);

    return MaskedWalletRequest.newBuilder()
            .setMerchantName(Constants.MERCHANT_NAME)
            .setPhoneNumberRequired(true)
            .setShippingAddressRequired(true)
            .setCurrencyCode(Constants.CURRENCY_CODE_USD)
            .setEstimatedTotalPrice(cartTotal)
            // Create a Cart with the current line items. Provide all the information
            // available up to this point with estimates for shipping and tax included.
            .setCart(Cart.newBuilder()
                    .setCurrencyCode(Constants.CURRENCY_CODE_USD)
                    .setTotalPrice(cartTotal)
                    .setLineItems(lineItems)
                    .build())
            // Indicate whether we need the Wallet Objects associated with the user.
            .setShouldRetrieveWalletObjects(true)
            .build();
}
 
开发者ID:TerribleDev,项目名称:XamarinAdmobTutorial,代码行数:33,代码来源:WalletUtil.java


示例10: createFullWalletRequest

import com.google.android.gms.wallet.Cart; //导入依赖的package包/类
/**
 *
 * @param itemInfo {@link com.google.android.gms.samples.wallet.ItemInfo} to use for creating
 *                 the {@link com.google.android.gms.wallet.FullWalletRequest}
 * @param googleTransactionId
 * @return {@link FullWalletRequest} instance
 */
public static FullWalletRequest createFullWalletRequest(ItemInfo itemInfo,
        String googleTransactionId) {

    List<LineItem> lineItems = buildLineItems(itemInfo, false);

    String cartTotal = calculateCartTotal(lineItems);

    return FullWalletRequest.newBuilder()
            .setGoogleTransactionId(googleTransactionId)
            .setCart(Cart.newBuilder()
                    .setCurrencyCode(Constants.CURRENCY_CODE_USD)
                    .setTotalPrice(cartTotal)
                    .setLineItems(lineItems)
                    .build())
            .build();
}
 
开发者ID:TerribleDev,项目名称:XamarinAdmobTutorial,代码行数:24,代码来源:WalletUtil.java


示例11: tokenize

import com.google.android.gms.wallet.Cart; //导入依赖的package包/类
/**
 * @deprecated Android Pay is deprecated, use {@link GooglePayment} instead. For more information see the
 * <a href="https://developers.braintreepayments.com/guides/pay-with-google/overview">documentation</a>
 *
 * Call this method when you've received a successful FullWallet request in your activity's
 * {@link Activity#onActivityResult(int, int, Intent)} to get an {@link AndroidPayCardNonce} from a
 * {@link FullWallet}.
 *
 * @param fragment An instance of {@link BraintreeFragment}.
 * @param wallet a {@link FullWallet} from the Intent in {@link Activity#onActivityResult(int, int, Intent)}.
 * @param cart the {@link Cart} used when creating the {@link FullWallet}.
 */
@Deprecated
public static void tokenize(BraintreeFragment fragment, FullWallet wallet, Cart cart) {
    try {
        fragment.postCallback(AndroidPayCardNonce.fromFullWallet(wallet, cart));
        fragment.sendAnalyticsEvent("android-pay.nonce-received");
    } catch (JSONException e) {
        fragment.sendAnalyticsEvent("android-pay.failed");

        try {
            fragment.postCallback(ErrorWithResponse.fromJson(wallet.getPaymentMethodToken().getToken()));
        } catch (JSONException e1) {
            fragment.postCallback(e1);
        }
    }
}
 
开发者ID:braintree,项目名称:braintree_android,代码行数:28,代码来源:AndroidPay.java


示例12: onActivityResult

import com.google.android.gms.wallet.Cart; //导入依赖的package包/类
static void onActivityResult(BraintreeFragment fragment, int resultCode, Intent data) {
    if (resultCode == Activity.RESULT_OK) {
        if (data.hasExtra(WalletConstants.EXTRA_FULL_WALLET)) {
            fragment.sendAnalyticsEvent("android-pay.authorized");
            tokenize(fragment, (FullWallet) data.getParcelableExtra(WalletConstants.EXTRA_FULL_WALLET),
                    (Cart) data.getParcelableExtra(EXTRA_CART));
        }
    } else if (resultCode == Activity.RESULT_CANCELED) {
        fragment.sendAnalyticsEvent("android-pay.canceled");
    } else {
        if (data != null) {
            if (data.hasExtra(EXTRA_ERROR)) {
                fragment.postCallback(new AndroidPayException(data.getStringExtra(EXTRA_ERROR)));
            } else {
                fragment.postCallback(new AndroidPayException("Android Pay error code: " +
                        data.getIntExtra(WalletConstants.EXTRA_ERROR_CODE, -1) +
                        " see https://developers.google.com/android/reference/com/google/android/gms/wallet/WalletConstants " +
                        "for more details"));
            }
        }

        fragment.sendAnalyticsEvent("android-pay.failed");
    }
}
 
开发者ID:braintree,项目名称:braintree_android,代码行数:25,代码来源:AndroidPay.java


示例13: requestAndroidPay_startsActivity

import com.google.android.gms.wallet.Cart; //导入依赖的package包/类
@Test
public void requestAndroidPay_startsActivity() {
    BraintreeFragment fragment = getSetupFragment();
    doNothing().when(fragment).startActivityForResult(any(Intent.class), anyInt());
    Cart cart = Cart.newBuilder().build();
    ArrayList<CountrySpecification> allowedCountries = new ArrayList<>();

    AndroidPay.requestAndroidPay(fragment, cart, true, true, allowedCountries);

    ArgumentCaptor<Intent> captor = ArgumentCaptor.forClass(Intent.class);
    verify(fragment).startActivityForResult(captor.capture(), eq(BraintreeRequestCodes.ANDROID_PAY));
    Intent intent = captor.getValue();
    assertEquals(AndroidPayActivity.class.getName(), intent.getComponent().getClassName());
    assertEquals(AUTHORIZE, intent.getIntExtra(EXTRA_REQUEST_TYPE, -1));
    assertEquals(WalletConstants.ENVIRONMENT_TEST, intent.getIntExtra(EXTRA_ENVIRONMENT, -1));
    assertEquals("", intent.getStringExtra(EXTRA_MERCHANT_NAME));
    assertEquals(cart, intent.getParcelableExtra(EXTRA_CART));
    assertTrue(intent.getBooleanExtra(EXTRA_SHIPPING_ADDRESS_REQUIRED, false));
    assertTrue(intent.getBooleanExtra(EXTRA_PHONE_NUMBER_REQUIRED, false));
    assertEquals(allowedCountries, intent.getParcelableArrayListExtra(EXTRA_ALLOWED_COUNTRIES));
    assertNotNull(intent.getParcelableExtra(EXTRA_TOKENIZATION_PARAMETERS));
    assertNotNull(intent.getIntegerArrayListExtra(EXTRA_ALLOWED_CARD_NETWORKS));
}
 
开发者ID:braintree,项目名称:braintree_android,代码行数:24,代码来源:AndroidPayTest.java


示例14: changePaymentMethod_startsActivity

import com.google.android.gms.wallet.Cart; //导入依赖的package包/类
@Test
public void changePaymentMethod_startsActivity() {
    BraintreeFragment fragment = getSetupFragment();
    doNothing().when(fragment).startActivityForResult(any(Intent.class), anyInt());
    AndroidPayCardNonce androidPayCardNonce = mock(AndroidPayCardNonce.class);
    when(androidPayCardNonce.getGoogleTransactionId()).thenReturn("google-transaction-id");
    Cart cart = Cart.newBuilder().build();
    when(androidPayCardNonce.getCart()).thenReturn(cart);

    AndroidPay.changePaymentMethod(fragment, androidPayCardNonce);

    ArgumentCaptor<Intent> captor = ArgumentCaptor.forClass(Intent.class);
    verify(fragment).startActivityForResult(captor.capture(), eq(BraintreeRequestCodes.ANDROID_PAY));
    Intent intent = captor.getValue();
    assertEquals(AndroidPayActivity.class.getName(), intent.getComponent().getClassName());
    assertEquals(CHANGE_PAYMENT_METHOD, intent.getIntExtra(EXTRA_REQUEST_TYPE, -1));
    assertEquals(WalletConstants.ENVIRONMENT_TEST, intent.getIntExtra(EXTRA_ENVIRONMENT, -1));
    assertEquals("google-transaction-id", intent.getStringExtra(EXTRA_GOOGLE_TRANSACTION_ID));
    assertEquals(cart, intent.getParcelableExtra(EXTRA_CART));
}
 
开发者ID:braintree,项目名称:braintree_android,代码行数:21,代码来源:AndroidPayTest.java


示例15: fromFullWallet_withCart_createsAndroidPayCardNonce

import com.google.android.gms.wallet.Cart; //导入依赖的package包/类
@Test
public void fromFullWallet_withCart_createsAndroidPayCardNonce() throws JSONException {
    UserAddress billingAddress = mock(UserAddress.class);
    UserAddress shippingAddress = mock(UserAddress.class);
    Cart cart = Cart.newBuilder().build();
    FullWallet wallet = getFullWallet(stringFromFixture("payment_methods/android_pay_card_response.json"),
            billingAddress, shippingAddress);

    AndroidPayCardNonce androidPayCardNonce = AndroidPayCardNonce.fromFullWallet(wallet, cart);

    assertEquals("Android Pay", androidPayCardNonce.getTypeLabel());
    assertEquals("fake-android-pay-nonce", androidPayCardNonce.getNonce());
    assertEquals("MasterCard 0276", androidPayCardNonce.getDescription());
    assertEquals("Visa", androidPayCardNonce.getCardType());
    assertEquals("11", androidPayCardNonce.getLastTwo());
    assertEquals("[email protected]", androidPayCardNonce.getEmail());
    assertEquals(billingAddress, androidPayCardNonce.getBillingAddress());
    assertEquals(shippingAddress, androidPayCardNonce.getShippingAddress());
    assertEquals("google-transaction-id", androidPayCardNonce.getGoogleTransactionId());
    assertEquals(cart, androidPayCardNonce.getCart());
}
 
开发者ID:braintree,项目名称:braintree_android,代码行数:22,代码来源:AndroidPayCardNonceUnitTest.java


示例16: generateMaskedWalletRequest

import com.google.android.gms.wallet.Cart; //导入依赖的package包/类
private MaskedWalletRequest generateMaskedWalletRequest() {
  MaskedWalletRequest maskedWalletRequest =
      MaskedWalletRequest.newBuilder()
          .setMerchantName("Google I/O Codelab")
          .setPhoneNumberRequired(true)
          .setShippingAddressRequired(true)
          .setCurrencyCode("USD")
          .setShouldRetrieveWalletObjects(true)
          .setEstimatedTotalPrice("10.00")
          .setCart(Cart.newBuilder()
              .setCurrencyCode("USD")
              .setTotalPrice("10.00")
              .addLineItem(LineItem.newBuilder()
                  .setCurrencyCode("USD")
                  .setDescription("Google I/O Sticker")
                  .setQuantity("1")
                  .setUnitPrice("10.00")
                  .setTotalPrice("10.00")
                  .build())
              .build())
          .build();

  return maskedWalletRequest;
}
 
开发者ID:googlesamples,项目名称:io2014-codelabs,代码行数:25,代码来源:MainActivity.java


示例17: generateFullWalletRequest

import com.google.android.gms.wallet.Cart; //导入依赖的package包/类
private FullWalletRequest generateFullWalletRequest(String googleTransactionId) {
  FullWalletRequest fullWalletRequest = FullWalletRequest.newBuilder()
      .setGoogleTransactionId(googleTransactionId)
      .setCart(Cart.newBuilder()
          .setCurrencyCode("USD")
          .setTotalPrice("10.10")
          .addLineItem(LineItem.newBuilder()
              .setCurrencyCode("USD")
              .setDescription("Google I/O Sticker")
              .setQuantity("1")
              .setUnitPrice("10.00")
              .setTotalPrice("10.00")
              .build())
          .addLineItem(LineItem.newBuilder()
              .setCurrencyCode("USD")
              .setDescription("Tax")
              .setRole(LineItem.Role.TAX)
              .setTotalPrice(".10")
              .build())
          .build())
      .build();
  return fullWalletRequest;
}
 
开发者ID:googlesamples,项目名称:io2014-codelabs,代码行数:24,代码来源:MainActivity.java


示例18: getMaskedWalletRequest

import com.google.android.gms.wallet.Cart; //导入依赖的package包/类
private MaskedWalletRequest getMaskedWalletRequest() {

        PaymentMethodTokenizationParameters parameters =
            PaymentMethodTokenizationParameters.newBuilder()
                .setPaymentMethodTokenizationType(PaymentMethodTokenizationType.NETWORK_TOKEN)
                .addParameter("publicKey", simplify.getAndroidPayPublicKey())
                .build();

        Cart cart = Cart.newBuilder()
            .setCurrencyCode(Constants.DEFAULT_CURRENCY.getCode())
            .setTotalPrice(mShopItem.priceToString())
            .addLineItem(LineItem.newBuilder()
                .setCurrencyCode(Constants.DEFAULT_CURRENCY.getCode())
                .setDescription(mShopItem.getName())
                .setQuantity("1")
                .setUnitPrice("2.00")
                .setTotalPrice("2.00")
                .build())
            .build();

        return MaskedWalletRequest.newBuilder()
            .setMerchantName("BookShelf")
            .setPhoneNumberRequired(true)
            .setShippingAddressRequired(true)
            .setCurrencyCode(Constants.DEFAULT_CURRENCY.getCode())
            .setCart(cart)
            .setEstimatedTotalPrice(Item.priceToString(mShopItem.getTotalPrice()))
            .setPaymentMethodTokenizationParameters(parameters)
            .build();
    }
 
开发者ID:ChristopherAbram,项目名称:Book-Shelf,代码行数:31,代码来源:CardFormActivity.java


示例19: createMaskedWalletRequest

import com.google.android.gms.wallet.Cart; //导入依赖的package包/类
private static MaskedWalletRequest createMaskedWalletRequest(List<Product> product,
                                                             String orderTotal,
                                                             PaymentMethodTokenizationParameters parameters,
                                                             Context context) {
    // Build a List of all line items
    List<LineItem> lineItems = buildLineItems(product, true, context);

    // [START masked_wallet_request]
    MaskedWalletRequest request = MaskedWalletRequest.newBuilder()
            .setMerchantName(Constants.MERCHANT_NAME)
            .setPhoneNumberRequired(true)
            .setShippingAddressRequired(true)
            .setCurrencyCode(PreferencesUtil.getDefaultSharedPreferences(context).getString(context.getString(R.string.active_currency), "USD"))
            .setEstimatedTotalPrice(orderTotal)
            // Create a Cart with the current line items. Provide all the information
            // available up to this point with estimates for shipping and tax included.
            .setCart(Cart.newBuilder()
                    .setCurrencyCode(PreferencesUtil.getDefaultSharedPreferences(context).getString(context.getString(R.string.active_currency), "USD"))
                    .setTotalPrice(orderTotal)
                    .setLineItems(lineItems)
                    .build())
            .setPaymentMethodTokenizationParameters(parameters)
            .build();

    return request;
    // [END masked_wallet_request]
}
 
开发者ID:Adyen,项目名称:adyen-android-pay-sample-code,代码行数:28,代码来源:WalletUtil.java


示例20: getAndroidPayCart

import com.google.android.gms.wallet.Cart; //导入依赖的package包/类
private Cart getAndroidPayCart() {
    return Cart.newBuilder()
            .setCurrencyCode(Settings.getAndroidPayCurrency(this))
            .setTotalPrice("1.00")
            .addLineItem(LineItem.newBuilder()
                    .setCurrencyCode("USD")
                    .setDescription("Description")
                    .setQuantity("1")
                    .setUnitPrice("1.00")
                    .setTotalPrice("1.00")
                    .build())
            .build();
}
 
开发者ID:braintree,项目名称:braintree-android-drop-in,代码行数:14,代码来源:MainActivity.java



注:本文中的com.google.android.gms.wallet.Cart类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java SelectStatement类代码示例发布时间:2022-05-22
下一篇:
Java NetherWarts类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap