constructing SHASign for a return page for a payment centre

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jonnyfortis
Forum Contributor
Posts: 462
Joined: Tue Jan 10, 2012 6:05 am

constructing SHASign for a return page for a payment centre

Post by jonnyfortis »

I have a gateway set up with Barclaycard EPDQ. when the payment I have set up the return to either ACCEPTURL , DECLINEURL , EXCEPTIONURL or CANCELURL. i have been told on these pages i need to

" ePDQ will send back the transaction result parameters and values along with the SHASign ePDQ has created using these parameters and values and the SHA-OUT passphrase set in the ePDQ back office.

You must then take these parameters and values and concatenate them alphabetically appending your SHA-OUT passphrase at the end of each parameter and value – once the you have created the SHASign you must then compare the SHASign you have created with the SHASign ePDQ has created and if they match you can then perform the end of order process such as updating your database etc. "

i have the pages setup and whatever page is called for either accept.php, decline.php, exception.php or cancel.php i can then make the correct ammendments to the DB.

i dont really know where to start, has anyone done this already?

thanks in advance
User avatar
mecha_godzilla
Forum Contributor
Posts: 375
Joined: Wed Apr 14, 2010 4:45 pm
Location: UK

Re: constructing SHASign for a return page for a payment cen

Post by mecha_godzilla »

Hi,

I haven't done this before, but the main issue seems to be the generation of the SHASign - the suggestion is that you need to generate this value from within your own scripts using the same function that Barclaycard uses on their system, so they should have supplied you with the code to do that. The requirement to order all the parameters alphabetically suggests that the SHASign value is just a one-way hash, but they could be using SHA-1, SHA-256, SHA-512 or doing something non-standard.

There is some information on the following site that might be of use:

http://www.whiteroomsolutions.com/2012/ ... php-class/

HTH,

Mecha Godzilla
jonnyfortis
Forum Contributor
Posts: 462
Joined: Tue Jan 10, 2012 6:05 am

Re: constructing SHASign for a return page for a payment cen

Post by jonnyfortis »

hello thanks for that. I already have the gateway set up. its the return i am having an issue with

the SHASign that i am trying to construct is different from the return URL
Post Reply