Jump to content
Latest News: (loading..)
Sign in to follow this  
cujimmy

Integration - MD5 signature problem - WorldPay Select Junior v1.0

Recommended Posts

Jings! this is a quiet corner of the osC forum.

 

I'm getting "the MD5 signature could not be verified" on running a test transaction - been over everything a dozen times and suspect the problem lies with WorldPay (can't even submit a support request at the moment - getting an internal server error on submitting) but I still have a horrible feeling I've missed something obvious.

 

(In the admin, we do have the same password under "MD5 Password" as under "MD5 secret for transactions" on Worldpay's Test Integration Setup page).

 

In worldpay_junior.php, everything is unchanged (I've only removed some fields for this post) :

 

$process_button_string = tep_draw_hidden_field('instId', MODULE_PAYMENT_WORLDPAY_JUNIOR_INSTALLATION_ID) .
tep_draw_hidden_field('amount', $this->format_raw($order->info['total'])) .
tep_draw_hidden_field('currency', $currency) .
tep_draw_hidden_field('hideCurrency', 'true') .
tep_draw_hidden_field('cartId', $order_id) .
tep_draw_hidden_field('signatureFields', 'amount:currency:cartId') .
tep_draw_hidden_field('signature', md5(MODULE_PAYMENT_WORLDPAY_JUNIOR_MD5_PASSWORD . ':' . $this->format_raw($order->info['total']) . ':' . $currency . ':' . $order_id)) .
tep_draw_hidden_field('MC_callback', substr(tep_href_link('ext/modules/payment/worldpay/junior_callback.php', '', 'NONSSL', false, false), strpos(tep_href_link('ext/modules/payment/worldpay/junior_callback.php', '', 'NONSSL', false, false), '://')+3));

 

At this point, I think the sensible thing is to take the dog for a walk.

Share this post


Link to post
Share on other sites
Jings! this is a quiet corner of the osC forum.

 

I'm getting "the MD5 signature could not be verified" on running a test transaction - been over everything a dozen times and suspect the problem lies with WorldPay (can't even submit a support request at the moment - getting an internal server error on submitting) but I still have a horrible feeling I've missed something obvious.

 

(In the admin, we do have the same password under "MD5 Password" as under "MD5 secret for transactions" on Worldpay's Test Integration Setup page).

 

In worldpay_junior.php, everything is unchanged (I've only removed some fields for this post) :

 

$process_button_string = tep_draw_hidden_field('instId', MODULE_PAYMENT_WORLDPAY_JUNIOR_INSTALLATION_ID) .
tep_draw_hidden_field('amount', $this->format_raw($order->info['total'])) .
tep_draw_hidden_field('currency', $currency) .
tep_draw_hidden_field('hideCurrency', 'true') .
tep_draw_hidden_field('cartId', $order_id) .
tep_draw_hidden_field('signatureFields', 'amount:currency:cartId') .
tep_draw_hidden_field('signature', md5(MODULE_PAYMENT_WORLDPAY_JUNIOR_MD5_PASSWORD . ':' . $this->format_raw($order->info['total']) . ':' . $currency . ':' . $order_id)) .
tep_draw_hidden_field('MC_callback', substr(tep_href_link('ext/modules/payment/worldpay/junior_callback.php', '', 'NONSSL', false, false), strpos(tep_href_link('ext/modules/payment/worldpay/junior_callback.php', '', 'NONSSL', false, false), '://')+3));

 

At this point, I think the sensible thing is to take the dog for a walk.

 

I've just integrated with WP Junior, and I didn't touch the worldpay_junior.php file.

 

In Worldpay admin, login to the production area and click on SYSTEM Settings, select the Integration Setup 'Test' and add the Payment Response URL eg http://www.your-url.co.uk/catalog/ext/modu...or_callback.php (don't forget the include the http://), check the Payment Response enabled? and check the Enable the Shopper Response. Enter a Payment Response password (This is the Callback Password you entered in the OSC Admin WP Junior setup) and enter the MD5 secret for transactions (This is the MD5 Password you entered in the OSC Admin WP Junior setup).

 

I also copied it to the Production setup.

 

PS You can only enter these changes when you login to the PRODUCTION live environment if you try it in the TEST environment you will get a database error. A good contact at WP is Gary Cook 08703661290.

 

Enjoy...

Edited by lomaxa

Share this post


Link to post
Share on other sites

Hi anyone,

 

Tried the above method and still can't get WorldPay to work. On checkout, I keep getting the following error message:

 

Secure Payment Page

Sorry, there was an error in processing this transaction:

The information sent from the merchant's site is invalid or incomplete. Please send the following information to the merchant:

The transaction cannot be processed due to one or more of the following:

 

the merchant account is suspended

the currency you selected is not supported

the authorisation mode is incorrect

test mode is unavailable

the installation is not live

 

2 callback urls are mentioned and I've tried both. One callback url is mentioned here and the other as you mentioned above. It seems that one works for worldpay.php and yours suppose to work for the junior_callback.php

 

Both do not work for me. Anyone out there has managed to solved this?

Share this post


Link to post
Share on other sites

Okay I found the problem and I hope this will help somebody else out.

 

As long as Worldpay has not approved your application you cannot go live. If you do, the error message above is what your are going to get.

 

The correct callback url or Payment Response Url for Worldpay Junior is to point the url to the junior_callback.php, that is in the Payment Response url row (in Admin>World Pay>installation) type or copy the path to your junior_callback.php. So it should look something like:

 

http://www.yourcompany.com/catalog/ext/modules/payment/worldpay/junior_callback.php

 

Please change the red colored lettering to reflect your company's url. For World Pay (not Worldpay Junior) use the Payment Response Url as specified here. If you use the above Payment Response url for Worldpay Junior, it does not work.

 

Only set to "live" mode (through oscommerce admin>modules>payment>worldpay junior) once your application is approved. Otherwise keep it on test.

 

When you go and do a test run at Worldpay installation, click Edit Payment Pages>select your installation id>preview>change authorisation to "E" (default is "A") prior to hitting "Submit" otherwise you are going to get the same error message as I've specified above.

 

Regards. :)

Share this post


Link to post
Share on other sites
Okay I found the problem and I hope this will help somebody else out.

 

As long as Worldpay has not approved your application you cannot go live. If you do, the error message above is what your are going to get.

 

The correct callback url or Payment Response Url for Worldpay Junior is to point the url to the junior_callback.php, that is in the Payment Response url row (in Admin>World Pay>installation) type or copy the path to your junior_callback.php. So it should look something like:

 

http://www.yourcompany.com/catalog/ext/modules/payment/worldpay/junior_callback.php

 

Please change the red colored lettering to reflect your company's url. For World Pay (not Worldpay Junior) use the Payment Response Url as specified here. If you use the above Payment Response url for Worldpay Junior, it does not work.

 

Only set to "live" mode (through oscommerce admin>modules>payment>worldpay junior) once your application is approved. Otherwise keep it on test.

 

When you go and do a test run at Worldpay installation, click Edit Payment Pages>select your installation id>preview>change authorisation to "E" (default is "A") prior to hitting "Submit" otherwise you are going to get the same error message as I've specified above.

 

Regards. :)

 

HI ivyfleur,

 

Are you using http://addons.oscommerce.com/info/5665 ? Did you did need to modify any of the 3 files?

 

I am using OSc RC2a.

 

I have enter the world pay production admin, enter the test setup. using the Payment Response URL eg http://www.your-url.co.uk/catalog/ext/modu...or_callback.php, checked the Payment Response enabled? Left all other unchange

 

In osc admin, entered my Installation ID, set Enable WorldPay Select Junior to true & set Test Mode to true.

 

When I run a test, entered the test card details. The payment page said payment sucessful. But do not have any button for the to press to go back to the site or automatically go back to the site. There for no email sent to customer & no comment log to the order history. Also tried just press the cancel button at the first payment page, it does not go back to the site & just struck there.

 

Do I need set in osc admin to live to test? Need help!!! Any one have the solution?

 

Regards,

 

Kevin

Share this post


Link to post
Share on other sites
HI ivyfleur,

 

Are you using http://addons.oscommerce.com/info/5665 ? Did you did need to modify any of the 3 files?

 

I am using OSc RC2a.

 

I have enter the world pay production admin, enter the test setup. using the Payment Response URL eg http://www.your-url.co.uk/catalog/ext/modu...or_callback.php, checked the Payment Response enabled? Left all other unchange

 

In osc admin, entered my Installation ID, set Enable WorldPay Select Junior to true & set Test Mode to true.

 

When I run a test, entered the test card details. The payment page said payment sucessful. But do not have any button for the to press to go back to the site or automatically go back to the site. There for no email sent to customer & no comment log to the order history. Also tried just press the cancel button at the first payment page, it does not go back to the site & just struck there.

 

Do I need set in osc admin to live to test? Need help!!! Any one have the solution?

 

Regards,

 

Kevin

 

 

Hi Kevin,

 

Didi you ever get to the bottom of this - I have the same problem and it's driving me insane!

 

 

Regards

Carl

Share this post


Link to post
Share on other sites

I can possibly help. Send me a pm. Thanks!


☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆

Share this post


Link to post
Share on other sites

Hi Kevin,

 

Didi you ever get to the bottom of this - I have the same problem and it's driving me insane!

 

 

Regards

Carl

 

 

Hi all,

 

I am having the same issue and am wondering if you have a resolution.

 

When I use the world pay callback - http://<WPDISPLAY ITEM=MC_callback> - I get the return button to our website but nothing happens when you click it.

 

 

and when I use the world pay junior callback - http://www.yourcompany.com/catalog/ext/modules/payment/worldpay/junior_callback.php - I get no return button and still nothing happens. no callback no result can anyone help this is driving me crazy now.

 

cheers, flykt

Share this post


Link to post
Share on other sites

If you want to use multiple currencies try:

 

replacing:

 

 

 

$process_button_string .= tep_draw_hidden_field('M_sid', tep_session_id()) .
							tep_draw_hidden_field('M_cid', $customer_id) .
							tep_draw_hidden_field('M_lang', $language) .
							tep_draw_hidden_field('M_hash', md5(tep_session_id() . $customer_id . $order_id . $language . number_format($order->info['total'], 2) . MODULE_PAYMENT_WORLDPAY_JUNIOR_MD5_PASSWORD));

 

 

 

with:

 

 

 $process_button_string .= tep_draw_hidden_field('M_sid', tep_session_id()) .
							tep_draw_hidden_field('M_cid', $customer_id) .
							tep_draw_hidden_field('M_lang', $language) .
							tep_draw_hidden_field('M_hash', md5(tep_session_id() . $customer_id . $order_id . $language . number_format($this->format_raw($order->info['total']), 2) . MODULE_PAYMENT_WORLDPAY_JUNIOR_MD5_PASSWORD));

 

otherwise the callback will fail

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×