2017-06-01 7 views
1

Android Payでテスト支払いをしようとしています。これまでのところ、私はこのanswerに基づいてテストのための私のデバイスを構成して、私は自分のデバイスでAndroidアプリでカードを設定し、このコードに基づいています:「loadMaskedWallet」のAndroid Pay Error

Wallet.Payments.isReadyToPay(mGoogleApiClient, IsReadyToPayRequest.newBuilder() 
        .addAllowedCardNetwork(WalletConstants.CardNetwork.VISA) 
        .addAllowedCardNetwork(WalletConstants.CardNetwork.MASTERCARD) 
        .build()) 
       .setResultCallback(
         booleanResult -> { 
          if (booleanResult.getStatus().isSuccess()) { // says true 
... 

私はgoogle code lab

から、これらのガイドラインに基づいて私の例を構築してい
private void initGoogleApi() { 
    mGoogleApiClient = new GoogleApiClient.Builder(getActivity()) 
      .addOnConnectionFailedListener(this) 
      .enableAutoManage(getActivity(),0, this) 
      .addApi(Wallet.API, new Wallet.WalletOptions.Builder() 
        .setEnvironment(WalletConstants.ENVIRONMENT_TEST) 
        .setTheme(WalletConstants.THEME_LIGHT) 
        .build()) 
      .build(); 
} 

、その後:

private void initAndroidPayView() { 
    mWalletFragment = (SupportWalletFragment) getActivity().getSupportFragmentManager() 
      .findFragmentByTag(WALLET_FRAGMENT_ID); 

    if (mWalletFragment == null) { 
     // Wallet fragment style 
     WalletFragmentStyle walletFragmentStyle = new WalletFragmentStyle() 
       .setBuyButtonText(WalletFragmentStyle.BuyButtonText.BUY_WITH) 
       .setBuyButtonWidth(WalletFragmentStyle.Dimension.MATCH_PARENT); 

     // Wallet fragment options 
     WalletFragmentOptions walletFragmentOptions = WalletFragmentOptions.newBuilder() 
       .setEnvironment(WalletConstants.ENVIRONMENT_TEST) 
       .setFragmentStyle(walletFragmentStyle) 
       .setTheme(WalletConstants.THEME_DARK) 
       .setMode(WalletFragmentMode.BUY_BUTTON) 
       .build(); 

     // Initialize the WalletFragment 
     WalletFragmentInitParams.Builder startParamsBuilder = 
       WalletFragmentInitParams.newBuilder() 
         .setMaskedWalletRequest(generateMaskedWalletRequest()) 
         .setMaskedWalletRequestCode(MASKED_WALLET_REQUEST_CODE); 
     //.setAccountName("Google I/O Codelab");//https://developers.google.com/android/reference/com/google/android/gms/wallet/fragment/WalletFragmentInitParams.Builder 
     mWalletFragment = SupportWalletFragment.newInstance(walletFragmentOptions); 
     mWalletFragment.initialize(startParamsBuilder.build()); 

     // Add the WalletFragment to the UI 
     getActivity().getSupportFragmentManager().beginTransaction() 
       .replace(R.id.androidPayContainer, mWalletFragment, WALLET_FRAGMENT_ID) 
       .commit(); 
    } 
} 

私は

を使用しています

PaymentMethodTokenizationType.NETWORK_TOKEN

と私は今、私は支払いを行うとき、私はonActivityResultでこのエラーコードを取得githubのレポ

で書かれたようPUBLICKEYを生成:

:デバイスで 10

を私は、このエラーメッセージが表示されます

Request Failed An unexpected error has occurred. Please try again later.

そして、私はエラーダイアログで[OK]を押したとき、私はこのログを取得:

06-01 12:18:05.739 11386 11386 W WalletMerchantError: Error in loadMaskedWallet: Did you forget the set Android Pay testing environment to PROD?

また、変数をProductionに変更しようとしましたが、それでも同じエラーが発生しました。 誰にでも解決策がありますか、それとも後でそれを試してみる必要がありますか?

答えて

0

はGithubの

https://github.com/android-pay/androidpay-quickstart/issues/31

や他の連絡先に掲載し、この問題によると、サンドボックスモードとテストカードとの異常が、少なくともヨーロッパでは動作しませんがあります。

問題の回答には、別の解決方法も含まれています。

Issue: test cards (even the one provided by Google) don't work anymore (at least not outside of US);

Solution: you need real card to make it work. You won't be charged with ENVIRONMENT_TEST.

0

ENVIRONMENT_TESTを使用する場合は、Setup Android Payに記載されている手順に従っていることを確認してください。具体的には、あなたのAndroidManifest.xmlには、次のビットが含まれていることを確認します

<application 
    ... 
    <!-- Enables the Android Pay API --> 
    <meta-data 
    android:name="com.google.android.gms.wallet.api.enabled" 
    android:value="true" /> 
</application> 

アプリの準備ができている感じとENVIRONMENT_PRODUCTIONを使用しようとしている場合は、より多くのそこのいくつかの手順outlined hereを。

+0

はい私もちょうど私がGoogleの例を試してみましたが、私はこの問題を開いたことを確認する、ことを行っている:https://github.com/android-pay/androidpay-quickstart/issues/31 –