Copied to clipboard

Flag this post as spam?

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


  • Johannes Lantz 115 posts 592 karma points c-trib
    Jan 27, 2022 @ 10:16
    Johannes Lantz
    0

    PayPal - GetOrderReference

    Hi!

    I am using the PayPal payment provider 2.0.0 on Umbraco v8.17.1. Which I have configured according to the documentation.

    I am encountering this issue which I am really unsure on how to resolve:

    PayPal - GetOrderReference
    
    System.InvalidOperationException: The given header was not found.
       at System.Net.Http.Headers.HttpHeaders.GetValues(String name)
       at Vendr.PaymentProviders.PayPal.Api.PayPalClient.<ParseWebhookEventAsync>d__12.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at Vendr.PaymentProviders.PayPal.PayPalPaymentProviderBase`1.<GetPayPalWebhookEventAsync>d__4.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at Vendr.PaymentProviders.PayPal.PayPalCheckoutOneTimePaymentProvider.<GetOrderReferenceAsync>d__14.MoveNext()
    

    Instead of getting redirected to error url, I am redirected to the success url which I find a bit odd.

    I am running the site via https. And I am using Vendr.Checkout v2.0.1, Flurl v282, Flurl 2.8.2

    Any ideas why this is happening?

    //Johannes

  • Matt Brailsford 3585 posts 18933 karma points MVP 8x c-trib
    Jan 27, 2022 @ 10:23
    Matt Brailsford
    1

    Hi Johannes,

    Do you have anything that might be causing a redirect in-between (using cloudflare or something)? It appears like one of the expected paypal headers for the webhook isn't there which can sometimes get lost in a redirect.

    I'd double check the webhook configuration is pointing to the https version of the URL and that there isn't anything happening on the server (ie, rewrite rules etc) that could be causing the URL to redirect.

    RE being redirected to the success URL, this is probably expected here as this error looks to be to do with the webhook handler which happens on a different thread, usually after the customers checkout is complete. Technically speaking the checkout has succeeded, it's just the webhook is failing to notify you currently so the payment is still valid.

    Matt

  • Johannes Lantz 115 posts 592 karma points c-trib
    Jan 27, 2022 @ 12:52
    Johannes Lantz
    0

    Hi Matt!

    I check and there are no redirects present.

    But after a bit of research. It looks like all the headers actually exists. But not in request.Content.Headers. But in request.Headers. https://github.com/vendrhub/vendr-payment-provider-paypal/blob/v2/dev/src/Vendr.PaymentProviders.PayPal/Api/PayPalClient.cs#L90

    If i change it to request.Headers it works. But I don't know if that's "correct" thing to do? What do you think?

    //Johannes

  • Matt Brailsford 3585 posts 18933 karma points MVP 8x c-trib
    Jan 27, 2022 @ 13:37
    Matt Brailsford
    1

    Ahhh, I think that might be right. I seem to recall we had to make that change in another provider. Obviously I should have checked the other providers too.

    I'll go do some checks and make some updates 👍

  • Matt Brailsford 3585 posts 18933 karma points MVP 8x c-trib
    Jan 27, 2022 @ 13:38
    Matt Brailsford
    1

    Doh! It was in fact the PayPal provider I made those changes in, but I never did an official 2.0.1 release.

    I'll get that pushed out now.

  • Matt Brailsford 3585 posts 18933 karma points MVP 8x c-trib
    Jan 27, 2022 @ 13:56
    Matt Brailsford
    100

    Ok, I've pushed out PayPal provider 2.0.1 with the headers fix in it.

    Apologies for not getting it out sooner. 🙏

  • Johannes Lantz 115 posts 592 karma points c-trib
    Jan 27, 2022 @ 14:52
    Johannes Lantz
    0

    Works like a charm now! Thank you Matt! :D

Please Sign in or register to post replies

Write your reply to:

Draft