I've integreted with PayEx in the uCommerce payement provider API. However when payex declines the payment or it in some way fails the transaction status returns 5 which causes processcallback in the API throwing an exception because the status isn't 3 (authorized). How can i catch this so the screen doesn't turn up yellow, and displaying a decent message to the client ? It doesn't seem to even get to my orderconfirmation page.
throw new ArgumentException(string.Format("Payment {1} was declined by PayEx. Transaction status: {0}.", (object) payExXmlMessage.TransactionStatus, (object) payment.PaymentId));
I requested our test account being ported to a live account in which they wanted to test out our integration with their (PayEx) service.
They repported back that the application threw an error when the status comming back was not 3 (authorized). In this case it was 5 = failiure.
I cannot tell why it would ever return 5. I guess maybe they would experince some sort of problem with the credit card or such.
Long story short, PayEx will in some cases return status 5.
I don't think throwing an exception is the right way to handle that case. Maybe just save the order and let the implementer of the shop display some sort of message corresponding to the status.
I guess i could override the method myself and get rid of the exception and just return to orderconfirmation with the order being requires attention or what ever. Would that have any impact on the system?
However The solution i came up with (for now) was to modify web.config and implement a status 500 error page
catch exception in ProcessCallback
Hi.
I've integreted with PayEx in the uCommerce payement provider API. However when payex declines the payment or it in some way fails the transaction status returns 5 which causes processcallback in the API throwing an exception because the status isn't 3 (authorized). How can i catch this so the screen doesn't turn up yellow, and displaying a decent message to the client ? It doesn't seem to even get to my orderconfirmation page.
if (payExXmlMessage.TransactionStatus != 3)
{
payment.PaymentStatus = PaymentStatus.Get((object) 10000008);
payment.Save();
throw new ArgumentException(string.Format("Payment {1} was declined by PayEx. Transaction status: {0}.", (object) payExXmlMessage.TransactionStatus, (object) payment.PaymentId));
}
Thanks in advance
Morten
Hi Morten,
What's the reason for the payment being declined?
I requested our test account being ported to a live account in which they wanted to test out our integration with their (PayEx) service.
They repported back that the application threw an error when the status comming back was not 3 (authorized). In this case it was 5 = failiure.
I cannot tell why it would ever return 5. I guess maybe they would experince some sort of problem with the credit card or such.
Long story short, PayEx will in some cases return status 5.
I don't think throwing an exception is the right way to handle that case. Maybe just save the order and let the implementer of the shop display some sort of message corresponding to the status.
I guess i could override the method myself and get rid of the exception and just return to orderconfirmation with the order being requires attention or what ever. Would that have any impact on the system?
However The solution i came up with (for now) was to modify web.config and implement a status 500 error page
<customErrors mode="On">
<error redirect="http://someshop.orgt/error.aspx" statusCode="500" />
</customErrors>
Cheers
Thanks for following up. I'll schedule a work item to fix it.
And fixed. Will be in next build of uCommerce 3 (build number 12291+).
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.