How to set up Google Wallet mode in Sandbox mode in Android?

I use Google Wallet Instant Buy in accordance with the description and example provided by Google with the Android SDK along this path or a similar path D: \ android-sdk-windows \ extras \ google \ google_play_services \ samples \ wallet according to the SDK present on your computer.

I successfully run the application and implement it in my application, and it works fine in Sandbox mode

As now I have to go to the final stage of the application in order to publish it in the playback store, I need to change the Sandbox mode to Production mode so that we can make a direct transaction (Purchase).

As far as I understand the code and got what I need to change, I made the changes as shown below in a specific class

Classes

  • Constants.class

    // Environment used to instantiate WalletClient

    public static final int WALLET_ENVIRONMENT = WalletConstants.ENVIRONMENT_SANDBOX;
    

    replaced by

    public static final int WALLET_ENVIRONMENT = WalletConstants.ENVIRONMENT_PRODUCTION;
    
  • LoginFragment.class

    private static final String WALLET_SANDBOX_SCOPE ="https://www.googleapis.com/auth/paymentssandbox.make_payments";
    

    replaced by

    private static final String WALLET_SANDBOX_SCOPE ="https://www.googleapis.com/auth/payments.make_payments";
    

All classes are shown in the example provided by GOOGLE and at location D: \ android-sdk-windows \ extras \ google \ google_play_services \ samples \ wallet in accordance with the SDK present on your pc.

directlly , .

, Google Google

Prduction, Android- APK Keystore.

Sign APK , ERROR_CODE_MERCHANT_ACCOUNT_ERROR (405)

, .

, Google Android .., , Google , Api key , Api key, Google .

+4
2

, , API Instant Buy Android ERROR_CODE_MERCHANT_ACCOUNT_ERROR (405), , Android, , Google Play

, , , Google, , Android. Android-,

, , :

// META-INF/CERT.RSA APK jar -xvf  META-INF/CERT.RSA : META-INF/CERT.RSA

keytool -printcert -file META-INF/CERT.RSA

: MD5: 77: 41: C5: C1: DD: 3F: 6C: 09: 88: FA: 33: 3D: 83: 5F: D3: 9E SHA1: EC: 4A: EE: DC: F4: 02: EA: 87: 0A: C5: 09: C0: 58: 06: 91: E7: EA: 41: 09: 9D
: SHA1withRSA

SHA1 , Google Play. ,

+3

. - . .

, , .

private static final String WALLET_SANDBOX_SCOPE ="https://www.googleapis.com/auth/payments.make_payments";

to

private static final String WALLET_PRODUCTION_SCOPE ="https://www.googleapis.com/auth/payments.make_payments";

, .

0

Source: https://habr.com/ru/post/1533736/


All Articles