Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


These support forums are now closed for new topics and comments.
Please head on over to http://eureka.ucommerce.net/ for support.

  • Morten Skjoldager 440 posts 1499 karma points
    Oct 12, 2012 @ 09:36
    Morten Skjoldager
    0

    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

  • Søren Spelling Lund 1797 posts 2786 karma points
    Oct 17, 2012 @ 10:58
    Søren Spelling Lund
    0

    Hi Morten,

    What's the reason for the payment being declined?

  • Morten Skjoldager 440 posts 1499 karma points
    Oct 17, 2012 @ 12:38
    Morten Skjoldager
    0

    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

  • Søren Spelling Lund 1797 posts 2786 karma points
    Oct 24, 2012 @ 11:10
    Søren Spelling Lund
    0

    Thanks for following up. I'll schedule a work item to fix it.

  • Søren Spelling Lund 1797 posts 2786 karma points
    Oct 24, 2012 @ 11:13
    Søren Spelling Lund
    0

    And fixed. Will be in next build of uCommerce 3 (build number 12291+).

Please Sign in or register to post replies

Write your reply to:

Draft