Forum Feedback PHP example for payment callback validation

Problem with the website? Confused about something? Or maybe you just have something you'd like to suggest. This is the place to do it.

PHP example for payment callback validation

Postby spectaclegames » January 21st, 2015, 4:27 pm

Hi,

I've tried to implement your pseudo code on https://gamesnet.yahoo.net/documentatio ... /callbacks (Validating the auth) in PHP, but I do not get the same result hash.

Can you give an example in PHP?

Best,
Bjoern
spectaclegames
 
Posts: 1
Joined: January 21st, 2015, 4:09 pm

Re: PHP example for payment callback validation

Postby Fortegames » November 6th, 2015, 3:53 pm

Hi,
Sorry to hijack the topic , but are someone find worknig solution with php ? I tried , but can't validate the auth token
Fortegames
 
Posts: 3
Joined: November 5th, 2015, 3:38 pm

Re: PHP example for payment callback validation

Postby Henrik » November 11th, 2015, 7:28 pm

I know Spectaclegames eventually succeeded, so it can be done.

They had issues with the base64-encoding, they accidentally base64-encoded the hex string of the byte output of the hash_hmac function, instead of base64-encoding the bytes themselves.
Henrik
.IO
 
Posts: 1880
Joined: January 4th, 2010, 1:53 pm

Re: PHP example for payment callback validation

Postby Henrik » November 11th, 2015, 7:35 pm

It also helps to decode the auth you get in the callback into bytes so you see what byte sequence you should be getting from your hash function, to try to figure out where it goes wrong.

This tool is pretty good for visualising it: https://conv.darkbyte.ru/

Another thing is that you have to get the message right, you have to sort the keys, and you have to concatenate the keys and values together into a long string that looks something like "amount500currencyUSDdescriptionA black cowgameuseridYHesHShSnzzskNTND......"
Henrik
.IO
 
Posts: 1880
Joined: January 4th, 2010, 1:53 pm


Return to Feedback