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
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.
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.
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:
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 usingVendr.Checkout v2.0.1
,Flurl v282
,Flurl 2.8.2
Any ideas why this is happening?
//Johannes
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
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 inrequest.Headers
. https://github.com/vendrhub/vendr-payment-provider-paypal/blob/v2/dev/src/Vendr.PaymentProviders.PayPal/Api/PayPalClient.cs#L90If 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
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 👍
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.
Ok, I've pushed out PayPal provider 2.0.1 with the headers fix in it.
Apologies for not getting it out sooner. 🙏
Works like a charm now! Thank you Matt! :D
is working on a reply...