当前位置: 首页>>代码示例>>Java>>正文


Java WalletConstants.RESULT_ERROR属性代码示例

本文整理汇总了Java中com.google.android.gms.wallet.WalletConstants.RESULT_ERROR属性的典型用法代码示例。如果您正苦于以下问题:Java WalletConstants.RESULT_ERROR属性的具体用法?Java WalletConstants.RESULT_ERROR怎么用?Java WalletConstants.RESULT_ERROR使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在com.google.android.gms.wallet.WalletConstants的用法示例。


在下文中一共展示了WalletConstants.RESULT_ERROR属性的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onActivityResult

@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
    switch (requestCode) {
        case REQUEST_CODE_CHANGE_MASKED_WALLET:
            if (resultCode == Activity.RESULT_OK &&
                    data.hasExtra(WalletConstants.EXTRA_MASKED_WALLET)) {
                mMaskedWallet = data.getParcelableExtra(WalletConstants.EXTRA_MASKED_WALLET);
                ((FullWalletConfirmationFragment) getResultTargetFragment())
                        .updateMaskedWallet(mMaskedWallet);
            }
            // you may also want to use the new masked wallet data here, say to recalculate
            // shipping or taxes if shipping address changed
            break;
        case WalletConstants.RESULT_ERROR:
            int errorCode = data.getIntExtra(WalletConstants.EXTRA_ERROR_CODE, 0);
            handleError(errorCode);
            break;
        default:
            super.onActivityResult(requestCode, resultCode, data);
            break;
    }
}
 
开发者ID:Adyen,项目名称:adyen-android-pay-sample-code,代码行数:22,代码来源:ConfirmationActivity.java

示例2: onActivityResult

@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
    switch (requestCode) {
        case REQUEST_CODE_CHANGE_MASKED_WALLET:
            if (resultCode == Activity.RESULT_OK &&
                    data.hasExtra(WalletConstants.EXTRA_MASKED_WALLET)) {
                mMaskedWallet = data.getParcelableExtra(WalletConstants.EXTRA_MASKED_WALLET);
                ((FullWalletConfirmationButtonFragment) getResultTargetFragment())
                        .updateMaskedWallet(mMaskedWallet);
                displayLoyaltyInformation();
            }
              // you may also want to use the new masked wallet data here, say to recalculate
              // shipping or taxes if shipping address changed
            break;
        case WalletConstants.RESULT_ERROR:
            int errorCode = data.getIntExtra(WalletConstants.EXTRA_ERROR_CODE, 0);
            handleError(errorCode);
            break;
        default:
            super.onActivityResult(requestCode, resultCode, data);
            break;
    }
}
 
开发者ID:benbek,项目名称:HereAStory-Android,代码行数:23,代码来源:ConfirmationActivity.java

示例3: onActivityResult

@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
    // 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_MASKED_WALLET:
            switch (resultCode) {
                case Activity.RESULT_OK:
                    if (data != null) {
                        mMaskedWallet = data.getParcelableExtra(WalletConstants.EXTRA_MASKED_WALLET);
                        confirmPurchase();
                    }
                    break;
                case Activity.RESULT_CANCELED:
                    break;
                default:
                    handleError(errorCode);
                    break;
            }
            break;
        case WalletConstants.RESULT_ERROR:
            handleError(errorCode);
            break;
        default:
            super.onActivityResult(requestCode, resultCode, data);
            break;
    }
}
 
开发者ID:Adyen,项目名称:adyen-android-pay-sample-code,代码行数:31,代码来源:OrderConfirmationActivity.java

示例4: onActivityResult

@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
    // 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_MASKED_WALLET:
            switch (resultCode) {
                case Activity.RESULT_OK:
                    MaskedWallet maskedWallet =
                            data.getParcelableExtra(WalletConstants.EXTRA_MASKED_WALLET);
                    launchConfirmationPage(maskedWallet);
                    break;
                case Activity.RESULT_CANCELED:
                    break;
                default:
                    handleError(errorCode);
                    break;
            }
            break;
        case WalletConstants.RESULT_ERROR:
            handleError(errorCode);
            break;
        default:
            super.onActivityResult(requestCode, resultCode, data);
            break;
    }
}
 
开发者ID:benbek,项目名称:HereAStory-Android,代码行数:30,代码来源:CheckoutActivity.java

示例5: onActivityResult

@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
  super.onActivityResult(requestCode,resultCode,data);

  switch (requestCode) {
    case MASKED_WALLET_REQUEST_CODE:
      switch (resultCode) {
        case Activity.RESULT_OK:
          mMaskedWallet =
              data.getParcelableExtra(WalletConstants.EXTRA_MASKED_WALLET);
          break;
        case Activity.RESULT_CANCELED:
          break;
        default:
          Toast.makeText(this, "An Error Occurred", Toast.LENGTH_LONG).show();
          break;
      }
      break;
    case FULL_WALLET_REQUEST_CODE:
      switch (resultCode) {
        case Activity.RESULT_OK:
          mFullWallet =
              data.getParcelableExtra(WalletConstants.EXTRA_FULL_WALLET);
          Toast.makeText(this, mFullWallet.getProxyCard().getPan().toString(), Toast.LENGTH_LONG).show();

          Wallet.Payments.notifyTransactionStatus(mGoogleApiClient,
              generateNotifyTransactionStatusRequest(mFullWallet.getGoogleTransactionId(),
                  NotifyTransactionStatusRequest.Status.SUCCESS));

          break;
        default:
          Toast.makeText(this, "An Error Occurred", Toast.LENGTH_LONG).show();
          break;
      }
      break;
    case WalletConstants.RESULT_ERROR:
      Toast.makeText(this, "An Error Occurred", Toast.LENGTH_LONG).show();
      break;
  }
}
 
开发者ID:googlesamples,项目名称:io2014-codelabs,代码行数:40,代码来源:MainActivity.java

示例6: onActivityResult

@Override
public void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
    Log.d(TAG, "Request code: " + requestCode + ", result code: " + resultCode);
    switch (requestCode) {
        case REQUEST_CODE_MASKED_WALLET:
            switch (resultCode) {
                case Activity.RESULT_OK:
                    if (data != null) {
                        maskedWallet = data.getParcelableExtra(WalletConstants.EXTRA_MASKED_WALLET);
                        if (maskedWallet != null) {
                            googleApiClient.connect();
                            FullWalletRequest fullWalletRequest
                                    = createFullWalletRequest(maskedWallet.getGoogleTransactionId());
                            // [START load_full_wallet]
                            Wallet.Payments.loadFullWallet(googleApiClient, fullWalletRequest,
                                    REQUEST_CODE_RESOLVE_LOAD_FULL_WALLET);
                            // [END load_full_wallet]
                        }
                    }
                    break;
                case Activity.RESULT_CANCELED:
                    break;
                default:
                    //paymentRequestListener.onPaymentResult(paymentRequest,
                    // new PaymentResult(new Throwable(errorCode + ": Android Pay error")));
                    break;
            }
            break;
        case WalletConstants.RESULT_ERROR:
            //paymentRequestListener.onPaymentResult(paymentRequest,
            // new PaymentResult(new Throwable(errorCode + ": Android Pay error")));
            break;
        case REQUEST_CODE_RESOLVE_LOAD_FULL_WALLET:
            final Intent intent = new Intent("com.adyen.androidpay.ui.AndroidTokenProvided");
            switch (resultCode) {
                case RESULT_OK:
                    if (data != null) {
                        fullWallet = data.getParcelableExtra(WalletConstants.EXTRA_FULL_WALLET);
                        intent.putExtra("androidpay.token", fullWallet.getPaymentMethodToken().getToken());
                        LocalBroadcastManager.getInstance(getApplicationContext()).sendBroadcast(intent);
                    }
                    break;
                case WalletConstants.RESULT_ERROR:
                    intent.putExtra("androidpay.error", "An error occurred with AndroidPay");
                    LocalBroadcastManager.getInstance(getApplicationContext()).sendBroadcast(intent);
                    break;
                default:
                    intent.putExtra("androidpay.error", "Unknown result code");
                    LocalBroadcastManager.getInstance(getApplicationContext()).sendBroadcast(intent);
                    break;
            }
            break;
        default:
            super.onActivityResult(requestCode, resultCode, data);
            break;
    }
}
 
开发者ID:Adyen,项目名称:adyen-android,代码行数:57,代码来源:AndroidPayActivity.java


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