Discussion:
Question about custom Payment Plugin
(too old to reply)
d***@blueyonder.co.uk
2007-01-18 14:44:29 UTC
Permalink
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
d***@blueyonder.co.uk
2007-01-19 13:16:31 UTC
Permalink
Hi all,

Just to clarify the last post after some more investigation, i'm now using the tutorial payment plugin MyWCPayments

1) If a FinancialException occurs, OrderProcess continues with error, even though in the WC_EDP trace you can clealy see the FinancialTransaction has a failure state. What's going on? How do I trap that this has occurred

2) Other exceptions such as a communication exception are caught and thrown, but I never get back a message from the plugin, I only ever get CMN3101E The system is unavailable due to "CMN0420E".

Is there any more info in using plugins - if not I shall revert to the 'usual' way of doing things, ie DoPaymentCmd etc

Thanks,

Dave
geo
2007-01-23 22:37:17 UTC
Permalink
Did you try wrapping your exception as an ECSystemException, that will halt
the order flow?
Post by d***@blueyonder.co.uk
Hi all,
Just to clarify the last post after some more investigation, i'm now using
the tutorial payment plugin MyWCPayments
1) If a FinancialException occurs, OrderProcess continues with error, even
though in the WC_EDP trace you can clealy see the FinancialTransaction has
a failure state. What's going on? How do I trap that this has occurred
2) Other exceptions such as a communication exception are caught and
thrown, but I never get back a message from the plugin, I only ever get
CMN3101E The system is unavailable due to "CMN0420E".
Is there any more info in using plugins - if not I shall revert to the
'usual' way of doing things, ie DoPaymentCmd etc
Thanks,
Dave
d***@blueyonder.co.uk
2007-01-24 11:33:15 UTC
Permalink
yeah, should have updated the post, have added that in my super call and the errors are trapped fine now, however, still struggling with issue 1, I had a typo in the last post, what I meant was continues without error, ie...
1) If a FinancialException occurs, OrderProcess continues without error, even
though in the WC_EDP trace you can clealy see the FinancialTransaction has
a failure state. What's going on? How do I trap that this has occurred
..hence I can trap the communication errors etc, but if a financialexception is thrown the orderprocess carries on regardless...
Mark Sheffield
2007-04-27 21:37:32 UTC
Permalink
Did you ever find a solution to this?

Thanks,
Mark
Post by d***@blueyonder.co.uk
yeah, should have updated the post, have added that in my super call and the errors are trapped fine now, however, still struggling with issue 1, I had a typo in the last post, what I meant was continues without error, ie...
1) If a FinancialException occurs, OrderProcess continues without error, even
though in the WC_EDP trace you can clealy see the FinancialTransaction has
a failure state. What's going on? How do I trap that this has occurred
..hence I can trap the communication errors etc, but if a financialexception is thrown the orderprocess carries on regardless...
Continue reading on narkive:
Loading...