4
votes

I am using Google Wallet Instant Buy as per the description given here and example provided by Google with Android SDK at this path or a similar path D:\android-sdk-windows\extras\google\google_play_services\samples\wallet as per the SDK present on your pc.

I successfully run the app and implemented the same in my app and it is working fine in Sandbox Mode

As now I have to move on final stage of app to publish it in play store i need to change the Sandbox Mode to Production Mode so we can do live transaction(Purchase).

As far as i understand the code and got what i need to change i have done the changes as shown below in particular class

Classes

  1. Constants.class

    // Environment to use when creating an instance of WalletClient

    public static final int WALLET_ENVIRONMENT = WalletConstants.ENVIRONMENT_SANDBOX;
    

    replaced by

    public static final int WALLET_ENVIRONMENT = WalletConstants.ENVIRONMENT_PRODUCTION;
    
  2. 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";
    

This all the classes are given in the example provide by GOOGLE and at location D:\android-sdk-windows\extras\google\google_play_services\samples\wallet as per the SDK present on your pc.

And which i have used directlly in my app with necessary package changes and other design related changes.

I have done all the required setup as per the instruction given here Android Google Wallet Integration

As I have to mode on Prduction mode i created Client id and Android Key using the Sign APK Keystore.

And I tried to run Sign APK in device but it returns an error ERROR_CODE_MERCHANT_ACCOUNT_ERROR (405)

Not getting how to solve this.

And one more query is how google wallet is detect it's Android key or Client key.. because as in simple Google map Example we are using Api key in the app but i didn't find a similar use of either Api key or client id in Google Wallet Example.

2
I am working on google wallet and currently i integrated into my app and testing on sandbox environment but it is not working .I created sandbox buyer account and added credit cards but it is showing no transactions yet. I added my app on google wallet account . I created sandbox merchant account with different id but i don,t know where it will be linked with the app.Because in documentation they mentioned copy seller secret and identifier key and paste into seller.py file downloaded from samples but i did not find any seller.py file in sample app. Can u help me please?DJtiwari

2 Answers

3
votes

Guess the error occuered due to invalid fingerprint ,The Instant Buy API for Android returns ERROR_CODE_MERCHANT_ACCOUNT_ERROR (405) when the signing key fingerprint used to sign the Android app does not match the fingerprint registered with Google Play

To resolve this ,make sure that the fingerprint provided to Google matches the fingerprint of the key used to sign the Android app. Once an Android app is signed,

to verify the fingerprint of the key used for signing it by using the following commands:

// First extract the META-INF/CERT.RSA from the APK jar -xvf META-INF/CERT.RSA inflated: META-INF/CERT.RSA

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

Certificate fingerprints: 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
Signature algorithm name: SHA1withRSA

Match the SHA1 with the fingerprint provided to Google Play.,Hope it helps

0
votes
  1. First the merchant account needs to be approved by Google for Instant Buy, you can apply for it here - http://getinstantbuy.withgoogle.com/

  2. After you get your approval, you will need to create a OAuth client ID in Google API console for installed app.

  3. Make sure that you supply the same SHA1 key fingerprint with your package name which you have with Google Play. In other words the signing certificate that you used with production app - use the fingerprint of that cert.

Thats it. You do not need any key of any kind in the app. Your steps of setting ENVIRONMENT and SCOPEs are OK.

Just to keep it clear change the name of the constant.

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";

Hope this helps.