Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

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


cujimmy

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.

Link to comment
Share on other sites

  • 2 weeks later...
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
Link to comment
Share on other sites

  • 10 months later...

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?

Link to comment
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. :)

Link to comment
Share on other sites

  • 1 month later...
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

Link to comment
Share on other sites

  • 4 months later...
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

Link to comment
Share on other sites

  • 2 weeks later...
  • 1 month later...

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

Link to comment
Share on other sites

  • 2 years later...

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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...