When following the set-up process and attempting to complete payment using Worldpay Redirect, the following error is displayed when arriving at Worldpay:

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:

  The MD5 signature could not be verified.

The error log contains the following entry:

Notice: Trying to access array offset on value of type null in Drupal\commerce_worldpay\Plugin\Commerce\PaymentGateway\WorldPayHelper->createData() (line 107 of Plugin/Commerce/PaymentGateway/WorldPayHelper.php)

The affected line contains $this->order->getData('worldpay_form')['return_url'], and altering this to $this->getNotifyUrl(), solves the problem

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

intrafusion created an issue. See original summary.

intrafusion’s picture

Status: Active » Needs review
FileSize
1.3 KB

Patch attached

kevster’s picture

I think Im getting the same issue on a D8 site running 8.9.13, PHP 7.4, latest commerce.

I see the following reported:

https://xxx.co.uk/checkout/61/review
Message Notice: Trying to access array offset on value of type null in Drupal\commerce_worldpay\Plugin\Commerce\PaymentGateway\WorldPayHelper->createData() (line 107 of /home/xxx/public_html/modules/contrib/commerce_worldpay/src/Plugin/Commerce/PaymentGateway/WorldPayHelper.php)

https://xxx.co.uk/payment/notify/worldpay_secure_payment?installation=88...
Referrer
Message OK Payment callback received from WorldPay for order 61 with status code 15559417168
Severity Info

So when I click pay and complete purchase on the review page the next page loads very quickly then goes to worldpay and fails with the MD5 message "The MD5 signature could not be verified."

If I click back and return to the site then click pay and complete again it completes the transaction successfully with no MD5 error.

Same issue on a test accoutn and live account.

My checkout flow is with shipping:

Login
- Login or continue as guest

Order information
- Contact information

Review
- Review
- Shipping information (Hide shipping costs until an address is entered: Yes)
- Payment information

Payment
- Payment process Transaction mode: Authorize and capture

Complete
- Completion message
- Guest registration after checkout

Sidebar
- Order summary
- Coupon redemption

Will test this patch out

kevster’s picture

That seems to have fixed my issue now thx!

joekers’s picture

Thanks for raising the issue and providing a patch.

It was supposed to be fixed in #3069650: The MC_callback variable is never set in $data within buildFormData() but it looks like it was left out of the commit.

  • joekers committed 58a66d0 on 8.x-2.x
    Issue #3194735 by intrafusion: Worldpay Redirect Error: MD5 signature...
joekers’s picture

Status: Needs review » Fixed

Also thanks @kevster for testing.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.