d***@blueyonder.co.uk
2007-01-18 14:44:29 UTC
Hi all,
I'm currently writing a new Payment Plugin for WCS 6.0 EE. All has gone well so far, commerce checkout talks to the plugin which talks to the 3rd party PSP and I get my response, process the payment etc and front end display the payment / order confrimation.
The problem is when the PSP throws a decline etc. I've used the tutorial / example code as a reference and when this happens, I throw a FinancialException, expecting the front end to reflect this, but the checkout progresses to finish, with the order status set to M
As a test I tried throwing both a PluginException and a FunctionNotSupportedException, both of these result in a front end generic error and looking at the trace are caught by a throw in the DoPaymentActionsPolicyCmdImpl
Anyhow, my (longwinded) question is, what's the best practise in dealing with responses / errors etc passed back from the PaymentPlugin, where should I put code to trap all this? Should I extend the DoPaymentActionsPolicyCmdImpl or put the code elsewhere etc?
Any input, as ever, greatly appreciated!
Dave
I'm currently writing a new Payment Plugin for WCS 6.0 EE. All has gone well so far, commerce checkout talks to the plugin which talks to the 3rd party PSP and I get my response, process the payment etc and front end display the payment / order confrimation.
The problem is when the PSP throws a decline etc. I've used the tutorial / example code as a reference and when this happens, I throw a FinancialException, expecting the front end to reflect this, but the checkout progresses to finish, with the order status set to M
As a test I tried throwing both a PluginException and a FunctionNotSupportedException, both of these result in a front end generic error and looking at the trace are caught by a throw in the DoPaymentActionsPolicyCmdImpl
Anyhow, my (longwinded) question is, what's the best practise in dealing with responses / errors etc passed back from the PaymentPlugin, where should I put code to trap all this? Should I extend the DoPaymentActionsPolicyCmdImpl or put the code elsewhere etc?
Any input, as ever, greatly appreciated!
Dave