Search code examples
google-pay

Empty POST request's body from Google Pay in program Loyalty Card


We faced with testing problem on the side Google Pay.

  1. At the current stage, we get into the GPay only after Card registration on the side of our site, when after filling out the form user is redirected to the GPay page to create a new Card. A Card is being created : we see it with the data that is entered into the form, but the GPay doesn't send any requests to our site. A special test environment from GPay is needed?

  2. Google Pay's support service asks: "Are you receiving the POST from GPay when you attempt the enrollment flow from the app?"

    How we can apply from GPay if we can't create a Card from GP at this stage?

    The process of creating a Card is described in paragraph 1 (on the site side). How to get into the GPay for enrollment at the testing stage?

  3. Support service writes "When you submit your user details from GPay, it sends a POST request to your server so that when your page is displayed it contains the information from the user data form. "

    As we pointed, at the current stage we can't send data from the GPay. It was expected thatGoogle Pay's support service send a POST request to our site, but we don't see POST request's body. It is empty. Therefore, we asked earlier, What internet service we can see it with? They answered, as we understood, that we can see it by sending from GPay. How to send it from the GPay, if at the testing stage we can only see newly created cards and we don’t get any requests from GPay?

  4. Is testing take place from GPay app? If so, why don't we have an access?

  5. We get a request POST, but with an empty request body. The GPay has a lot of users with the Loyalty Card. Someone has already come across this. We didn't find such situations on the Internet. How anybody have handled situations like this before?

  6. How to create a new Card from GPay and see a POST request?


We do not have access to the class settings in the account. On Russian language, we do not see the callback feature, and on English technical support sends to us a screenshot - there are settings in the account. Could there be access rights issues? To accoding with your link from paragraph 5 https://developers.google.com/pay/passes/rest/v1/loyaltyclass#discoverableprogrammerchantsignupinfo - we did not find the insert barcode /manually settings. Can you tell us where to find them? At the moment, we can scan the barcode in GPay app(due to help of GPay support service ), but we do not receive a Post request after inserting bar code in GPay app. Our Russian account settings looks like: enter image description here

GPay support service see our account on English so: enter image description here We don't see these settings for barcode.

In accordance with the documentation https://developers.google.com/pay/passes/guides/overview/how-to/use-callbacks, we set up a callback feature, but we do not receive a post request in the format json (php):

$responseJson_str = file_get_contents('php://input'); 
$responseJson = '[' . $responseJson_str . ']';
$response = json_decode($responseJson, true); 
var_dump( $response);   
$file_server = "server_calback.log";
$fw = fopen($file_server, "a");
fwrite($fw, "POST " . var_export($response, true) . "\n");
fclose($fw);

What is wrong?

I show a screenshot with the request POST to our site https://itcrk.icu/testcallback.php from https://reqbin.com/ enter image description here


At the beginning of testing stage, we implemented signin / signup as you indicated in points 1-6. We did this functionality was not because we needed it, but thought that it was necessary for testing. Then we wrote in support team that we need a barcode/manually, as users of other cards are used to. We were answered that we need settings in the account, we did not find them. Support team helped us to configure the barcode in the account of the Merchant Center - Google.We insert barcode in the GPay , but we don’t get json on the site. We assume a problem with access rights in the Merchant Center - Google. How do other cardholders usually set up a barcode in their accounts? We do not have access to the settings n the Merchant Center - Google, unfortunately. Support team writes that there should be access, but it does not.


It turned out that there are two ways to work with cards in the GPay. The first method is described in the documentation here https://developers.google.com/pay/passes/guides/enrollment-signin, the second method is to scan the card(barcode/manually) and use it as a card storage, but card data is not sent to the user’s server. The Loyalty card is simply displayed in the GPay with its number(from barcode/manually) and that's all.


Solution

  • It turned out that there are two ways to work with cards in the GPay. The first method is described in the documentation here https://developers.google.com/pay/passes/guides/enrollment-signin, the second method is to scan the card(barcode/manually) and use it as a card storage, but card data is not sent to the user’s server. The Loyalty card is simply displayed in the GPay with its number(from barcode/manually) and that's all.