Question

We are trying to integrate Google Wallet for digital goods with or php app and 2 days ago, on 15 November we've managed to get it working. However, when checking again the next day and even today, although the code remained the same, we didn't change a letter in it, it is still not working, giving us this error:

Uh oh. There was a problem.

We couldn't complete your purchase because of a technical issue.

Details of the problem below: Unfortunately, we could not confirm your purchase with the merchant's server. Your order has been canceled. Please contact the merchant if this problem continues.

The code we're using is this:

    $response = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : file_get_contents("php://input");

    $response = substr_replace($response, "", 0, 4);   //remove "

    $response = JWT::decode($response, $sellerSecretKey);

    header("HTTP/1.1 200 OK");

and like I said it worked fine two days ago and I have the feeling it's working now also, because in our log file we get printed this response

stdClass Object ( [iss] => Google [request] => stdClass Object ( [name] => Product 1. [description] => You are purchasing a total of 1 products from our Store. Thank you. [price] => 9.99 [currencyCode] => USD [sellerData] => client name,email address )

[response] => stdClass Object
    (
        [orderId] => GWDG_S.c7a66f5b-4674-43f0-be16-2b72f69a7445
    )

[typ] => google/payments/inapp/item/v1/postback/buy
[aud] => 03083876603093172875
[iat] => 1384689627
[exp] => 1384689647

)

The postback url is correctly specified and we are using sandbox to do the tests.

Is this a problem from Google? Are they working on the software or something and this is what's causing the problem? Or are we doing something wrong here?.

Any help would be much apreciated. Thank you.

Was it helpful?

Solution

Meant to comment but it won't fit...

That error points to something in your Postback handler. I just tried sandbox and things seem fine.

I'm not a php dev so this maybe inaccurate - are you responding to Postback with the orderId? Again, this is only based on my read of the code above (I think I only see http 200?)

The only other thing I can think of is that the lag for you to respond is more than 10 seconds(?) - which could explain why could be another reason you have logged data, but Google still cancelled it.

*Strike through text: you'd get data to log because Google will send you the data, it's whether or not you respond properly that matters

Once you decode the JWT with your Seller Secret, you can make sure that the cake purchase is OK and record it. Within 10 seconds of receiving the postback, your server must send a 200 OK response where the only content is the value of the "orderId" field. If it doesn't, Google cancels the transaction.

REF: https://developers.google.com/commerce/wallet/digital/docs/postback#responding

Hth.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top