Copied to clipboard

Flag this post as spam?

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


  • Bjarne Fyrstenborg 1285 posts 4039 karma points MVP 8x c-trib
    Mar 31, 2015 @ 23:23
    Bjarne Fyrstenborg
    0

    Handle error when payment service not available

    Today my client had a customer that didn't manage to complete a order. The order didn't seem to be finalized and still of stage "CART". In the checkout the customer had chosen PayPal as payment method and for the payment amount it was still 0.00 DKK.

    However later my client did successfully complete an order with PayPal as payment method.

    In the log this error has been written.

    2015-03-31 17:53:14,887 [14] ERROR TeaCommerce.Umbraco.Configuration.Infrastructure.Logging.LoggingProvider - [Thread 375] PayPal(CART-3070) - Process callback - Exception: System.Net.WebException: The remote server returned an error: (503) Server Unavailable.
       at System.Net.HttpWebRequest.GetResponse()
       at TeaCommerce.Api.Web.PaymentProviders.APaymentProvider.MakePostRequest(String url, String request, NetworkCredential credentials)
       at TeaCommerce.PaymentProviders.Classic.PayPal.ProcessCallback(Order order, HttpRequest request, IDictionary`2 settings)
    System.Net.WebException: The remote server returned an error: (503) Server Unavailable.
       at System.Net.HttpWebRequest.GetResponse()
       at TeaCommerce.Api.Web.PaymentProviders.APaymentProvider.MakePostRequest(String url, String request, NetworkCredential credentials)
       at TeaCommerce.PaymentProviders.Classic.PayPal.ProcessCallback(Order order, HttpRequest request, IDictionary`2 settings)

     

    So it seems that at that moment PayPal's service wasn't available? .. and I think the customer was returned teh the "cancel" page. But it there a way to handle different errors, because if the customer choose the cancel the payment from PayPal or a error occurs (like in this case) the customer will be send to the same cancel page, right?

    Can we somehow display a more specific "cancel" page, e.g. whether the customer had cancelled the payment or some other error occurs during the payment?

    /Bjarne

  • Anders Burla 2560 posts 8256 karma points
    Apr 01, 2015 @ 16:27
    Anders Burla
    0

    Hi Bjarne

    You can extend the provider and see if there is any extra info available that you can get and save for the order.

  • Bjarne Fyrstenborg 1285 posts 4039 karma points MVP 8x c-trib
    Apr 01, 2015 @ 18:39
    Bjarne Fyrstenborg
    0

    Hi Anders

    Okay, I guess it reached this line:
    https://github.com/TeaCommerce/Payment-providers/blob/master/Source/TeaCommerce.PaymentProviders/Classic/PayPal.cs#L241

    So I could add another property if I want, where the cancel_return in #L31 and #L68 specify where to redirect both when an error occurs or the customer cancel the payment.

  • Anders Burla 2560 posts 8256 karma points
    Apr 07, 2015 @ 08:11
    Anders Burla
    0

    Nope - that is when you hit cancel and approved payment, NOT when the payment is canceled in the authorize process. That is the GetCancelUrl method.

    Kind regards
    Anders

  • Bjarne Fyrstenborg 1285 posts 4039 karma points MVP 8x c-trib
    Apr 07, 2015 @ 09:02
    Bjarne Fyrstenborg
    0

    Okay, so GetCancelUrl is if the customer hit cancel in payment process that returns the cancel_return? https://github.com/TeaCommerce/Payment-providers/blob/master/Source/TeaCommerce.PaymentProviders/Classic/PayPal.cs#L91

    In this case we had 503 - Service Unavailable: https://developer.paypal.com/docs/classic/ipn/integration-guide/HTMLStatusCodes/ , so if e.g. one 500-error occours maybe it could have another return url? In e.g. this line does it know if it is in "payment" or "cancel" (by customer) state? https://github.com/TeaCommerce/Payment-providers/blob/master/Source/TeaCommerce.PaymentProviders/Classic/PayPal.cs#L241

    /Bjarne

  • Anders Burla 2560 posts 8256 karma points
    Apr 07, 2015 @ 09:07
    Anders Burla
    0

    I cant remember what status codes paypal sends or if there is any extra info. You need to test that your self :)

Please Sign in or register to post replies

Write your reply to:

Draft