Is there any chance of Sagepay_server payment working?
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
-
- Posts: 20
- Joined: 22 Oct 2020, 15:39
Is there any chance of Sagepay_server payment working?
I can't get this to work... I've been trying to debug it but I'm really struggling.
I'm not expecting anybody (unless I'm lucky) to be familiar with Sagepay. But the critical bit is that the redirect to the payment screens works and contains a parameter called 'NotificationURL'. Aimeos sends something like this...
http://my.shop.com/update?code=SagePay&orderid=16
The idea is that Sagepay sends a POST to the above callback which is supposed to confirm the transaction (this is done in the background, no redirects). I can't see how this can result in a call back to the omnipay/Sagepay code. The router appears to call
Aimeos\Shop\Controller\CheckoutController@updateAction
...I have no idea what that does. It just seems to result in a view with this in it...
<?php echo $aibody['checkout/update']; ?>
I'll keep at it but I'm a bit lost. Is this sort of payment plugin ever going to work? Does aimeos have a provision to handle this callback or am I just wasting my time?
EDIT:
I stuck a (sophisticated) error_log(print_r($_POST, true)) at the start of the updateAction function and it's definitely getting called...
...but it doesn't seem to be doing anything useful
EDIT EDIT:
I dug more and ended up in the depths of some terrifying factory classes in ext/ai-client-html/client/html/src/Client/Html/Checkout/Update which I *think* is what gets called to process the update request. However, I've really hit a brick wall now as I can't figure out what these are doing (or, how I might replace them as I suspect that's what's coming next)
EDIT EDIT EDIT:
It's this I take it... https://aimeos.org/docs/Configuration/C ... out_update
The problem is that I really don't understand that code enough (at all!) to come up with a version that will work
I'm not expecting anybody (unless I'm lucky) to be familiar with Sagepay. But the critical bit is that the redirect to the payment screens works and contains a parameter called 'NotificationURL'. Aimeos sends something like this...
http://my.shop.com/update?code=SagePay&orderid=16
The idea is that Sagepay sends a POST to the above callback which is supposed to confirm the transaction (this is done in the background, no redirects). I can't see how this can result in a call back to the omnipay/Sagepay code. The router appears to call
Aimeos\Shop\Controller\CheckoutController@updateAction
...I have no idea what that does. It just seems to result in a view with this in it...
<?php echo $aibody['checkout/update']; ?>
I'll keep at it but I'm a bit lost. Is this sort of payment plugin ever going to work? Does aimeos have a provision to handle this callback or am I just wasting my time?
EDIT:
I stuck a (sophisticated) error_log(print_r($_POST, true)) at the start of the updateAction function and it's definitely getting called...
Code: Select all
Array\n(\n [VPSProtocol] => 3.00\n [TxType] => PAYMENT\n [VendorTxCode] => 23\n [VPSTxId] => {967123D4-C0AF-F4BF-2976-EA58EA6CEEDD}\n [Status] => OK\n [StatusDetail] => 0000 : The Authorisation was Successful.\n [TxAuthNo] => 7778781....
EDIT EDIT:
I dug more and ended up in the depths of some terrifying factory classes in ext/ai-client-html/client/html/src/Client/Html/Checkout/Update which I *think* is what gets called to process the update request. However, I've really hit a brick wall now as I can't figure out what these are doing (or, how I might replace them as I suspect that's what's coming next)
EDIT EDIT EDIT:
It's this I take it... https://aimeos.org/docs/Configuration/C ... out_update
The problem is that I really don't understand that code enough (at all!) to come up with a version that will work
Re: Is there any chance of Sagepay_server payment working?
The Checkout Update component you have already found uses the updatePush() method of the Omnipay integration:
https://github.com/aimeoscom/ai-payment ... #L487-L520
The Omnipay integration calles the acceptNotification() method where the SagePay driver should evaluate the parameters sent by SagePay within the request:
https://github.com/aimeoscom/ai-payment ... #L504-L505
The acceptNotification() method seems to be implemented by both, ServerGateway and DirectGateway:
https://github.com/thephpleague/omnipay ... hp#L44-L47
Hope that helps you to dig deeper ...
https://github.com/aimeoscom/ai-payment ... #L487-L520
The Omnipay integration calles the acceptNotification() method where the SagePay driver should evaluate the parameters sent by SagePay within the request:
https://github.com/aimeoscom/ai-payment ... #L504-L505
The acceptNotification() method seems to be implemented by both, ServerGateway and DirectGateway:
https://github.com/thephpleague/omnipay ... hp#L44-L47
Hope that helps you to dig deeper ...
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
-
- Posts: 20
- Joined: 22 Oct 2020, 15:39
Re: Is there any chance of Sagepay_server payment working?
Thanks for the help but it's way too complicated - it was going to take too long to figure it all out.
I managed to get SagePay working in a different payment mode which isn't ideal but will do for now. I appreciate you taking the trouble to look at this. I may well come back to it once I have more time (I'm under pressure to get something working)
I managed to get SagePay working in a different payment mode which isn't ideal but will do for now. I appreciate you taking the trouble to look at this. I may well come back to it once I have more time (I'm under pressure to get something working)