You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After successful testing we're now using SagePay plugin v4 which uses protocol 4 on SagePay via Direct integration. Alas over 50% of the payment transactions are failing because the IP is missing: 3333 : The ClientIPAddress is missing.
The problem is the SagePay gateway doesn't support IPv6 (like it's a new thing!), and Craft (Craft::$app->getRequest()->userIP) will return whatever has been passed to it by the browser, device or users connection. So for all the failures, Craft is logging an IPv6 address.
I had assumed this library was based on (or similar to) thephpleague/omnipay-sagepay, which allows for clientIpto be posted with the payment form, but it doesn't: vendor/craftcms/commerce-omnipay/src/base/Gateway.php line 507: 'clientIp' => Craft::$app->getRequest()->userIP ?? '',
So it will always fail for users who have an IPv6 address.
Can this be changed to check and allow for clientIp to be posted with the request as a default, then fallback to pulling from Craft, then fallback to an empty string?
Additional info
Craft version: 3.7.36
Craft Commerce version: 3.4.11
SagePay for Craft Commerce version: 4.0.0
PHP version: 7.4
The text was updated successfully, but these errors were encountered:
Description
After successful testing we're now using SagePay plugin v4 which uses protocol 4 on SagePay via Direct integration. Alas over 50% of the payment transactions are failing because the IP is missing:
3333 : The ClientIPAddress is missing.
The problem is the SagePay gateway doesn't support IPv6 (like it's a new thing!), and Craft (
Craft::$app->getRequest()->userIP
) will return whatever has been passed to it by the browser, device or users connection. So for all the failures, Craft is logging an IPv6 address.I had assumed this library was based on (or similar to) thephpleague/omnipay-sagepay, which allows for clientIpto be posted with the payment form, but it doesn't: vendor/craftcms/commerce-omnipay/src/base/Gateway.php line 507:
'clientIp' => Craft::$app->getRequest()->userIP ?? '',
So it will always fail for users who have an IPv6 address.
Can this be changed to check and allow for clientIp to be posted with the request as a default, then fallback to pulling from Craft, then fallback to an empty string?
Additional info
The text was updated successfully, but these errors were encountered: