preface

To make a long story short, once Google Pay is connected, the payment is successful and the order has to be verified. Verify the order step, best placed on the server, some of the hacking technology can be directly on the phone virtual Google Pay, if the server does not verify, it is likely to be overcharged.

I have borrowed many articles from the Internet, but few of them seem to be really useful. The official document is very unfriendly, may be foreign people thinking logic is different, resulting in the document is very difficult to understand, even the document for a long time can not find, not my dish, back-end big guy is looking for a long time, all quickly give up O (╥﹏╥) O. The current documentation is not enough to allow developers to access Google Pay.

steps

1. Access the Google Play Console and create an Auth client. Don’t go to the Google Developers Console to create, just click “Create AUTH Client”.

2. Click “View in Google Developers Console” to download the corresponding CONFIGURATION file in JSON format.

Iii. Semi-automated operation using the Java project I provided.

Github.com/gg051202/Go…

1. In this project must be created in the configuration file: SRC/main/local. The properties, the file content is as follows (package_name and json_file_value should be completed at the moment, code and refreshToken get in subsequent steps)

Json_file_value = # Fill in the authorization code you got after accessing authUrl. RefreshToken Obtained refreshToken=Copy the code

2. Follow the steps in the following figure.

The final

How to test? After actually paying an order, purchaseToken was locally tested and confirmed. The only values that will be provided to your backend developers are client_id, client_secret, and refresh_token. What they need to do is:

Essays, pit

  • If Error checking for Billing V3 support is detected, do not panic, it is not the SDK version you are using. Please check: switch IP attempt of each country, login Google Store account is correct (the region in the account information may be selected as the United States), the store may save multiple accounts at the same time, delete others, login store account region, only keep one account, in short, most of the probability is the account problem.
  • Possible, pull up Google Pay to hang up, see if it is xiaomi phone, application details interface, see if there is a “rights management -> background popup interface” option, tick it.
  • How do I test payments? According to Purchased, product IDS are transferred to Android.test. purchased, which is testing, and it may not be paid for, so if you are part of the Google Play App Signature plan, then you have to be part of it after it’s released into beta. Before you can pay, make sure you join the plan.
  • How to release the beta version? After submitting the package in the market, any internal test channel to send the package, all need to review, after the review will have a test address, no address display, and so on.
  • Download packages in Google Marketplace and keep going in circles? Try this: Switch to a US IP address and wipe out all data in the Google Store APP.
  • The audit was rejected. Under “Store Releases -> App Content” there is an option to change the target demographic to 18 + and check the app content to “inadvertently appeal to children”.
  • What if I can’t pay? Google will Pay to validate the address of the account, but also have to have a credit card, march this year seems to be the credit card has been closed, poor Australian friends then I turn to, later found out that can go to a treasure to buy prepaid phone CARDS, alacrity, want to measure test (that’s right, countless times payment failed, you will find that can test is really a let a person touched of things).