My postback (PHP) script doesn't do the job

119 views
Skip to first unread message

Tim

unread,
Feb 20, 2012, 3:33:16 PM2/20/12
to In-App Payments
Hi,

Maybe its a stupid question but I'm not an advanced programmer. I've
have successfully setup In-App payments for my app but it only works
without using a postback url.

I've Google'd around many hours trying to tackle this myself without
success. Hopefully anybody could help me out. I've included the script
handling the post data which does obviously something wrong but I
don't know what..

require_once 'include/jwt.php'; // including luciferous jwt library

$encoded_jwt = $_POST['jwt'];
$decoded_jwt = JWT::decode($encoded_jwt, "fdNAbAdfkCDakJQBdViErg");
$decoded_jwt_array = (array) $decoded_jwt;
$orderId = $decoded_jwt_array['response']['orderId'];

header("HTTP/1.0 200 OK");
echo $orderId;

Any help would be much appreciated. Thanks Tim

Smart

unread,
Feb 21, 2012, 7:49:04 AM2/21/12
to In-App Payments
Hi Tim I've been asking for a full php tutorial for a long while now,
join me https://groups.google.com/group/in-app-payments/browse_thread/thread/d053af1e27bf86ab/81da1e5e620b1abe#81da1e5e620b1abe
I think we as php developers deserve that much!

Matthew Endsley

unread,
Feb 22, 2012, 4:30:33 PM2/22/12
to in-app-...@googlegroups.com
Does your postback handler get called at all?  Writing some debug print messages on the server can confirm whether it's a problem with your php code or an issue with google connecting.

Also, does your postback URL use http or https scheme?  We had to setup a non https connection point to get postback working.  I'm not sure if postback supports https or if our SSL CA just isn't in google's trusted list.  If you're using https, try switching to http and see if that allows Google to connect properly.

Matt
Reply all
Reply to author
Forward
0 new messages