paypal / PayPal-NET-SDK

.NET SDK for PayPal's RESTful APIs
https://developer.paypal.com
Other
536 stars 462 forks source link

Validate Webhook Message #406

Closed devmartins closed 4 years ago

devmartins commented 5 years ago

How can I validate a message with the new SDK? I'm using C# with .Net Core 2.1.

devmartins commented 5 years ago

Is this repository abandoned ? @jaypatel512 Can you give a little help ?

jaypatel512 commented 5 years ago

Hey @devmartins !

Unfortunately I do not have access to these repositories anymore.

However, you should be able to validate webhook as shown here.

devmartins commented 5 years ago

This is for .Net Framework. I'm using .Net Core. Is there other employee who can help? Thanks.

alextretij commented 5 years ago

I have the same issue with validation webhook.

Iuli1478 commented 5 years ago

I have issue with validation webhook too. This is my code:

var apiContext = _payPalHelper.GetApiContext(); string requestBody; using (var reader = new StreamReader(Request.Body)) { requestBody = reader.ReadToEnd(); } var webhookEvent = JsonConvert.DeserializeObject<WebhookEvent>(requestBody); var nameValueCollection = new NameValueCollection(); foreach (var item in Request.Headers) { nameValueCollection.Add(item.Key, string.Join(",", item.Value)); } var isValid = WebhookEvent.ValidateReceivedEvent(apiContext, nameValueCollection, requestBody, _payPalSettings.WebhookId); I get this Exception:: PayPal.PayPalException: 'Unable to load trusted certificate.' Inner exception: NullReferenceException: Object reference not set to an instance of an object.

In Request.Headers (NameValueCollection) I have key "Paypal-Cert-Url": https://api.paypal.com/v1/notifications/certs/CERT-360caa42-fca2a594-5edc0ebc

I'm using .net core 2.1

dsedleckas commented 4 years ago

šŸ‘ Having this issue as well

sucithrashanu commented 4 years ago

@devmartins

Currently we do not have any stipulated timeline for the v2.0.0 release, but it may be available in near future.

Please Check PayPal Community andĀ  MTS

Thanks!