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

Java FullWallet类代码示例

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

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



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

示例1: authorizedPayloadFromFullWallet

import com.google.android.gms.wallet.FullWallet; //导入依赖的package包/类
/**
 * Constructs an authorized payload that can be sent back to our server from an Android Pay full wallet.
 */
public static @NonNull AndroidPayAuthorizedPayload authorizedPayloadFromFullWallet(final @NonNull FullWallet fullWallet, final @NonNull Gson gson) {

  final InstrumentInfo instrumentInfo = fullWallet.getInstrumentInfos()[0];

  return AndroidPayAuthorizedPayload
    .builder()
    .androidPayWallet(
      AndroidPayAuthorizedPayload.AndroidPayWallet
        .builder()
        .googleTransactionId(fullWallet.getGoogleTransactionId())
        .instrumentDetails(instrumentInfo.getInstrumentDetails())
        .instrumentType(instrumentInfo.getInstrumentType())
        .build()
    )
    .stripeToken(AndroidPayAuthorizedPayload.create(fullWallet.getPaymentMethodToken().getToken(), gson))
    .build();
}
 
开发者ID:kickstarter,项目名称:android-oss,代码行数:21,代码来源:AndroidPayUtils.java


示例2: androidPaymentToken

import com.google.android.gms.wallet.FullWallet; //导入依赖的package包/类
@Test
public void androidPaymentToken() throws Exception {
  final Constructor<PaymentMethodToken> paymentMethodTokenConstructor = PaymentMethodToken.class.getDeclaredConstructor(int.class,
    int.class, String.class);
  paymentMethodTokenConstructor.setAccessible(true);
  PaymentMethodToken paymentMethodToken = paymentMethodTokenConstructor.newInstance(1, 1, PAYMENT_TOKEN);

  final Constructor<FullWallet> fullWalletConstructor = FullWallet.class.getDeclaredConstructor(int.class, String.class, String.class,
    ProxyCard.class, String.class, com.google.android.gms.wallet.Address.class, com.google.android.gms.wallet.Address.class,
    String[].class, UserAddress.class, UserAddress.class, InstrumentInfo[].class, PaymentMethodToken.class);
  fullWalletConstructor.setAccessible(true);
  final FullWallet fullWallet = fullWalletConstructor.newInstance(1, null, null, null, null, null, null, null, null, null, null,
    paymentMethodToken);

  PaymentToken paymentToken = PayHelper.extractPaymentToken(fullWallet, PUBLIC_KEY);

  final MessageDigest messageDigest = MessageDigest.getInstance("SHA-256");
  final byte[] digest = messageDigest.digest(PUBLIC_KEY.getBytes("UTF-8"));
  final String androidPayPublicKeyHash = Base64.encodeToString(digest, Base64.DEFAULT);

  assertThat(paymentToken.token).isEqualTo(PAYMENT_TOKEN);
  assertThat(paymentToken.publicKeyHash).isEqualTo(androidPayPublicKeyHash);
}
 
开发者ID:Shopify,项目名称:mobile-buy-sdk-android,代码行数:24,代码来源:PayHelperTest.java


示例3: completeCheckout

import com.google.android.gms.wallet.FullWallet; //导入依赖的package包/类
private void completeCheckout(final FullWallet fullWallet) {
  newMaskedWalletRequired = true;

  String androidPayPublicKey = BuildConfig.ANDROID_PAY_PUBLIC_KEY;
  PaymentToken paymentToken = PayHelper.extractPaymentToken(fullWallet, androidPayPublicKey);
  PayAddress billingAddress = PayAddress.fromUserAddress(fullWallet.getBuyerBillingAddress());

  if (paymentToken == null) {
    notifyUserError(-1, new RuntimeException("Failed to extract Android payment token"));
    return;
  }

  showProgress(REQUEST_ID_COMPLETE_CHECKOUT);
  registerRequest(
    REQUEST_ID_COMPLETE_CHECKOUT,
    checkoutCompleteInteractor.execute(checkoutId, payCartLiveData().getValue(), paymentToken, fullWallet.getEmail(), billingAddress)
      .observeOn(AndroidSchedulers.mainThread())
      .subscribeWith(WeakSingleObserver.<RealCheckoutViewModel, Payment>forTarget(this)
        .delegateOnSuccess(RealCheckoutViewModel::onCompleteCheckout)
        .delegateOnError((viewModel, t) -> viewModel.onRequestError(REQUEST_ID_COMPLETE_CHECKOUT, t))
        .create()
      )
  );
}
 
开发者ID:Shopify,项目名称:mobile-buy-sdk-android,代码行数:25,代码来源:RealCheckoutViewModel.java


示例4: fetchTransactionStatus

import com.google.android.gms.wallet.FullWallet; //导入依赖的package包/类
/**
 * Here the client should connect to their server, process the credit card/instrument
 * and get back a status indicating whether charging the card was successful or not
 */
private void fetchTransactionStatus(FullWallet fullWallet) {
    if (mProgressDialog.isShowing()) {
        mProgressDialog.dismiss();
    }
    // Send back details such as fullWallet.getProxyCard() and fullWallet.getBillingAddress()
    // and get back success or failure
    // The following code assumes a successful response and calls notifyTransactionStatus
    Wallet.notifyTransactionStatus(mGoogleApiClient,
            WalletUtil.createNotifyTransactionStatusRequest(fullWallet.getGoogleTransactionId(),
                    NotifyTransactionStatusRequest.Status.SUCCESS));

    Intent intent = new Intent(getActivity(), OrderCompleteActivity.class);
    intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
    intent.putExtra(Constants.EXTRA_FULL_WALLET, mFullWallet);
    startActivity(intent);
}
 
开发者ID:TerribleDev,项目名称:XamarinAdmobTutorial,代码行数:21,代码来源:ConfirmationFragment.java


示例5: tokenize

import com.google.android.gms.wallet.FullWallet; //导入依赖的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


示例6: onActivityResult

import com.google.android.gms.wallet.FullWallet; //导入依赖的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


示例7: fromFullWallet_createsAndroidPayCardNonce

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

    AndroidPayCardNonce androidPayCardNonce = AndroidPayCardNonce.fromFullWallet(wallet);

    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());
}
 
开发者ID:braintree,项目名称:braintree_android,代码行数:20,代码来源:AndroidPayCardNonceUnitTest.java


示例8: fromFullWallet_withCart_createsAndroidPayCardNonce

import com.google.android.gms.wallet.FullWallet; //导入依赖的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


示例9: fetchTransactionStatus

import com.google.android.gms.wallet.FullWallet; //导入依赖的package包/类
/**
 * Here the client should connect to their server, process the credit card/instrument
 * and get back a status indicating whether charging the card was successful or not
 */
private void fetchTransactionStatus(FullWallet fullWallet) {
    if (mProgressDialog.isShowing()) {
        mProgressDialog.dismiss();
    }
    // Send back details such as fullWallet.getProxyCard() and fullWallet.getBillingAddress()
    // and get back success or failure
    // The following code assumes a successful response and calls notifyTransactionStatus
    Wallet.Payments.notifyTransactionStatus(mGoogleApiClient,
            WalletUtil.createNotifyTransactionStatusRequest(fullWallet.getGoogleTransactionId(),
                    NotifyTransactionStatusRequest.Status.SUCCESS));

    Intent intent = new Intent(getActivity(), OrderCompleteActivity.class);
    intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
    intent.putExtra(Constants.EXTRA_FULL_WALLET, fullWallet);
    startActivity(intent);
}
 
开发者ID:benbek,项目名称:HereAStory-Android,代码行数:21,代码来源:FullWalletConfirmationButtonFragment.java


示例10: androidPayComplete

import com.google.android.gms.wallet.FullWallet; //导入依赖的package包/类
@SuppressLint("NewApi")
private void androidPayComplete(final @NonNull FullWallet fullWallet) {
  final AndroidPayAuthorizedPayload authorizedPayload = AndroidPayUtils
    .authorizedPayloadFromFullWallet(fullWallet, this.gson);

  final String json = this.gson.toJson(authorizedPayload, AndroidPayAuthorizedPayload.class);

  // TODO: is this an injection problem?
  final String javascript = String.format("checkout_android_pay_next(%s);", json);
  this.webView.evaluateJavascript(javascript, null);
}
 
开发者ID:kickstarter,项目名称:android-oss,代码行数:12,代码来源:CheckoutActivity.java


示例11: handleWalletResponse

import com.google.android.gms.wallet.FullWallet; //导入依赖的package包/类
/**
 * Handles activity results for masked wallet and full wallet requests, and delegates a response to a specified call back handler.
 *
 * @param requestCode Android Pay Wallet activity request code
 * @param resultCode  Android Pay Wallet activity result code
 * @param data        Android Pay Wallet response data
 * @param handler     delegate call back handler
 * @return {@code true} if activity result can be handled, {@code false} otherwise
 * @see WalletResponseHandler
 */
public static boolean handleWalletResponse(final int requestCode, final int resultCode, final Intent data,
  final WalletResponseHandler handler) {
  if (requestCode != REQUEST_CODE_CHANGE_MASKED_WALLET
    && requestCode != REQUEST_CODE_MASKED_WALLET
    && requestCode != REQUEST_CODE_FULL_WALLET) {
    return false;
  }

  if (resultCode != Activity.RESULT_OK) {
    handler.onWalletRequestCancel(requestCode);
    return true;
  }

  if (data == null) {
    handler.onWalletError(requestCode, -1);
    return true;
  }

  int errorCode = data.getIntExtra(WalletConstants.EXTRA_ERROR_CODE, -1);
  if (errorCode != -1) {
    handler.onWalletError(requestCode, errorCode);
    return true;
  }

  MaskedWallet maskedWallet = data.getParcelableExtra(WalletConstants.EXTRA_MASKED_WALLET);
  FullWallet fullWallet = data.getParcelableExtra(WalletConstants.EXTRA_FULL_WALLET);
  if (maskedWallet != null) {
    handler.onMaskedWallet(maskedWallet);
    return true;
  } else if (fullWallet != null) {
    handler.onFullWallet(fullWallet);
    return true;
  }

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


示例12: extractPaymentToken

import com.google.android.gms.wallet.FullWallet; //导入依赖的package包/类
/**
 * Extracts payment token from {@link FullWallet} information that will be required to complete checkout.
 *
 * @param fullWallet          {@link FullWallet}
 * @param androidPayPublicKey Android Pay public key
 * @return payment token
 */
public static PaymentToken extractPaymentToken(@NonNull final FullWallet fullWallet, @NonNull final String androidPayPublicKey) {
  checkNotNull(fullWallet, "fullWallet can't be null");
  checkNotEmpty(androidPayPublicKey, "androidPayPublicKey can't be empty");
  try {
    final MessageDigest messageDigest = MessageDigest.getInstance("SHA-256");
    final byte[] digest = messageDigest.digest(androidPayPublicKey.getBytes("UTF-8"));
    return new PaymentToken(fullWallet.getPaymentMethodToken().getToken(), Base64.encodeToString(digest,
      Base64.DEFAULT));
  } catch (NoSuchAlgorithmException | UnsupportedEncodingException e) {
    return null;
  }
}
 
开发者ID:Shopify,项目名称:mobile-buy-sdk-android,代码行数:20,代码来源:PayHelper.java


示例13: a

import com.google.android.gms.wallet.FullWallet; //导入依赖的package包/类
public void a(int paramInt, FullWallet paramFullWallet, Bundle paramBundle)
{
  Parcel localParcel1 = Parcel.obtain();
  Parcel localParcel2 = Parcel.obtain();
  try
  {
    localParcel1.writeInterfaceToken("com.google.android.gms.wallet.internal.IWalletServiceCallbacks");
    localParcel1.writeInt(paramInt);
    if (paramFullWallet != null)
    {
      localParcel1.writeInt(1);
      paramFullWallet.writeToParcel(localParcel1, 0);
    }
    else
    {
      localParcel1.writeInt(0);
    }
    if (paramBundle != null)
    {
      localParcel1.writeInt(1);
      paramBundle.writeToParcel(localParcel1, 0);
    }
    else
    {
      localParcel1.writeInt(0);
    }
    this.dU.transact(2, localParcel1, localParcel2, 0);
    localParcel2.readException();
    return;
  }
  finally
  {
    localParcel2.recycle();
    localParcel1.recycle();
  }
}
 
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:37,代码来源:it.java


示例14: fromFullWallet

import com.google.android.gms.wallet.FullWallet; //导入依赖的package包/类
/**
 * @deprecated Android Pay is deprecated, use {@link GooglePaymentCardNonce} instead. For more information see the
 * <a href="https://developers.braintreepayments.com/guides/pay-with-google/overview">documentation</a>
 *
 * Convert a {@link FullWallet} to an {@link AndroidPayCardNonce}.
 *
 * @param wallet the {@link FullWallet} from an Android Pay response.
 * @param cart the {@link Cart} used to create the {@link FullWallet}.
 * @return {@link AndroidPayCardNonce}.
 * @throws JSONException when parsing the response fails.
 */
@Deprecated
public static AndroidPayCardNonce fromFullWallet(FullWallet wallet, Cart cart) throws JSONException {
    AndroidPayCardNonce androidPayCardNonce =
            AndroidPayCardNonce.fromJson(wallet.getPaymentMethodToken().getToken());
    androidPayCardNonce.mDescription = wallet.getPaymentDescriptions()[0];
    androidPayCardNonce.mEmail = wallet.getEmail();
    androidPayCardNonce.mBillingAddress = wallet.getBuyerBillingAddress();
    androidPayCardNonce.mShippingAddress = wallet.getBuyerShippingAddress();
    androidPayCardNonce.mGoogleTransactionId = wallet.getGoogleTransactionId();
    androidPayCardNonce.mCart = cart;

    return androidPayCardNonce;
}
 
开发者ID:braintree,项目名称:braintree_android,代码行数:25,代码来源:AndroidPayCardNonce.java


示例15: onActivityResult_sendsAnalyticsEventOnFullWalletResponse

import com.google.android.gms.wallet.FullWallet; //导入依赖的package包/类
@Test
public void onActivityResult_sendsAnalyticsEventOnFullWalletResponse() throws Exception {
    BraintreeFragment fragment = getSetupFragment();

    FullWallet wallet = createFullWallet();
    Intent intent = new Intent()
            .putExtra(WalletConstants.EXTRA_FULL_WALLET, wallet);

    AndroidPay.onActivityResult(fragment, Activity.RESULT_OK, intent);

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


示例16: createFullWallet

import com.google.android.gms.wallet.FullWallet; //导入依赖的package包/类
private FullWallet createFullWallet() throws Exception {
    Class paymentMethodTokenClass = PaymentMethodToken.class;
    Class[] tokenParams = new Class[] { int.class, String.class };
    Constructor<PaymentMethodToken> tokenConstructor = paymentMethodTokenClass.getDeclaredConstructor(tokenParams);
    tokenConstructor.setAccessible(true);
    PaymentMethodToken token = tokenConstructor.newInstance(0, stringFromFixture("payment_methods/android_pay_card.json"));

    Class fullWalletClass = FullWallet.class;
    Class[] walletParams = new Class[] { String.class, String.class, ProxyCard.class, String.class,
            com.google.android.gms.wallet.zza.class, com.google.android.gms.wallet.zza.class, String[].class, UserAddress.class, UserAddress.class,
            InstrumentInfo[].class, PaymentMethodToken.class };
    Constructor<FullWallet> walletConstructor = fullWalletClass.getDeclaredConstructor(walletParams);
    walletConstructor.setAccessible(true);
    return walletConstructor.newInstance(null, null, null, null, null, null, null, null, null, null, token);
}
 
开发者ID:braintree,项目名称:braintree_android,代码行数:16,代码来源:AndroidPayTest.java


示例17: parcelsCorrectly

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

    Parcel parcel = Parcel.obtain();
    androidPayCardNonce.writeToParcel(parcel, 0);
    parcel.setDataPosition(0);

    AndroidPayCardNonce parceled = AndroidPayCardNonce.CREATOR.createFromParcel(parcel);

    assertEquals("Android Pay", parceled.getTypeLabel());
    assertEquals("fake-android-pay-nonce", parceled.getNonce());
    assertEquals("MasterCard 0276", parceled.getDescription());
    assertEquals("Visa", parceled.getCardType());
    assertEquals("11", parceled.getLastTwo());
    assertEquals("[email protected]", parceled.getEmail());
    assertNotNull(parceled.getBillingAddress());
    assertNotNull(parceled.getShippingAddress());
    assertEquals("google-transaction-id", parceled.getGoogleTransactionId());
    assertNotNull(parceled.getCart());

    assertBinDataEqual(androidPayCardNonce.getBinData(), parceled.getBinData());
}
 
开发者ID:braintree,项目名称:braintree_android,代码行数:29,代码来源:AndroidPayCardNonceUnitTest.java


示例18: getFullWallet

import com.google.android.gms.wallet.FullWallet; //导入依赖的package包/类
private FullWallet getFullWallet(String response, UserAddress billingAddress, UserAddress shippingAddress) {
    PaymentMethodToken paymentMethodToken = mock(PaymentMethodToken.class);
    when(paymentMethodToken.getToken()).thenReturn(response);

    FullWallet wallet = mock(FullWallet.class);
    when(wallet.getPaymentMethodToken()).thenReturn(paymentMethodToken);
    when(wallet.getPaymentDescriptions()).thenReturn(new String[] { "MasterCard 0276" });
    when(wallet.getEmail()).thenReturn("[email protected]");
    when(wallet.getBuyerBillingAddress()).thenReturn(billingAddress);
    when(wallet.getBuyerShippingAddress()).thenReturn(shippingAddress);
    when(wallet.getGoogleTransactionId()).thenReturn("google-transaction-id");

    return wallet;
}
 
开发者ID:braintree,项目名称:braintree_android,代码行数:15,代码来源:AndroidPayCardNonceUnitTest.java


示例19: completeAndroidPay

import com.google.android.gms.wallet.FullWallet; //导入依赖的package包/类
@Override public @NonNull Observable<FullWallet> completeAndroidPay() {
  return this.completeAndroidPay;
}
 
开发者ID:kickstarter,项目名称:android-oss,代码行数:4,代码来源:CheckoutViewModel.java


示例20: onActivityResult

import com.google.android.gms.wallet.FullWallet; //导入依赖的package包/类
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
    mProgressDialog.hide();

    // retrieve the error code, if available
    int errorCode = -1;
    if (data != null) {
        errorCode = data.getIntExtra(WalletConstants.EXTRA_ERROR_CODE, -1);
    }

    switch (requestCode) {
        case REQUEST_CODE_RESOLVE_ERR:
            if (resultCode == Activity.RESULT_OK) {
                mGoogleApiClient.connect();
            } else {
                handleUnrecoverableGoogleWalletError(errorCode);
            }
            break;
        case REQUEST_CODE_RESOLVE_LOAD_FULL_WALLET:
            switch (resultCode) {
                case Activity.RESULT_OK:
                    if (data.hasExtra(WalletConstants.EXTRA_FULL_WALLET)) {
                        FullWallet fullWallet =
                                data.getParcelableExtra(WalletConstants.EXTRA_FULL_WALLET);
                        // the full wallet can now be used to process the customer's payment
                        // send the wallet info up to server to process, and to get the result
                        // for sending a transaction status
                        fetchTransactionStatus(fullWallet);
                    } else if (data.hasExtra(WalletConstants.EXTRA_MASKED_WALLET)) {
                        // re-launch the activity with new masked wallet information
                        mMaskedWallet =
                                data.getParcelableExtra(WalletConstants.EXTRA_MASKED_WALLET);
                        mActivityLaunchIntent.putExtra(Constants.EXTRA_MASKED_WALLET,
                                mMaskedWallet);
                        startActivity(mActivityLaunchIntent);
                    }
                    break;
                case Activity.RESULT_CANCELED:
                    // nothing to do here
                    break;
                default:
                    handleError(errorCode);
                    break;
            }
            break;
    }
}
 
开发者ID:benbek,项目名称:HereAStory-Android,代码行数:48,代码来源:FullWalletConfirmationButtonFragment.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java OpenSSLPBEParametersGenerator类代码示例发布时间:2022-05-22
下一篇:
Java ClasspathEntry类代码示例发布时间: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