Regarding uable to trigger Paypal REST API webhook events from developer sandbox - paypal-webhooks

What is wrong with my Paypal sandbox account process
to receive webhook notifications? We are unable to receive webhook event on
my URL.
URL working with "Webhooks simulator". Please let me know what
should I do for receive webhook event on above URL.

Webhooks simulator sends sample payloads for the events you configured. It does not send a notification on triggering of an actual event.
If you are getting notification via Webhooks Simulator, it means the URL configured by you is able to intercept POST requests.
Now for the "Paypal sandbox account unable to process to receive Webhook notifications" part, please check if the transaction is actually created at https://developer.paypal.com/developer/dashboard/sandbox/ . If the transaction you are looking for is not present there, there won't be any notification generated. In case transaction is present there and still you are not getting any notifications, please share debug id.

Here is a silly thing that I overlooked in the documentation and only found out after contacting support.
After you've followed the approval url and gave your approval, dit you execute the payment with the REST API?
https://developer.paypal.com/docs/api/payments/#payment_execute
Webhooks are only called after you've executed the payment.
The confusing part is; there is no webhook being called, when a user approves or cancels a payment. There is only a redirect back to a return url or cancel url. So you either need to monitor the redirect back to your site and trigger the execute call then, or find another way (like polling the payment) to see the status change before calling the execute call.

Related

zapier is unable to send challenge value to enable slack event api

I'm using zapier with slack and want to catch an event when message_replied event was created as referred here.
To use event API, it needs URL verification, which is unable on zapier webhook catching. The following error occurs repeatedly; Request URL Your URL didn't respond with the value of the challenge parameter.
Are there any workarounds?
I'd really appreciate any help you can provide.
some related informations:
app used in zapier : Webhooks by Zapier
Event in zapier : Catch Hook
feature used in slack bot : Event Subscriptions
This is not currently possible. "Webhooks by Zapier" will only respond with the default "success" response because it's intended to be used with any incoming webhook. For that product, there's not special cases for any particular service.
If you're trying to integration with the Slack Events API (something I implemented at Zapier), then I recommend writing your own web service to catch Slack hooks, do business logic, and then send relevant webhooks onto Zapier as needed. This will afford you much more control over the process.

Where can I find Connect Notification details such as event types, what they mean and when my webhook will be called

I have a functioning webhook application which recently went into production. Unfortunately, I assumed that when DocuSign notified me of an envelope with "Completed" status, then there would be no further notifications for this envelope. I am sometimes receiving multiple notifications with the same status of Completed.
I'd like to review the documentation (if it exists) surrounding the details of when each type of notification goes out from DocuSign Connect.

Validate whether payment was a success or failure

I am looking to use PayPal to accept a payment through my website. I am looking at the Smart Payment button option. If the payment is successful I need to update something in my website DB. How can I determine whether the payment was successful or not? I cant see anything the API docs.
I also need to retain user context with a PHP session ID. How can I pass that to the paypal site and ensure it is returned with the success / fail indicator?
Use Paypal IPN to receive payment notifications. Setup a server endpoint to respond to IPN requests and update your DB etc...
To maintain state, you will need to include a hidden input filed in your Smart Payment Button with a name of custom and a value of your choice (session id).
Setup a IPN endpoint ie: /checkout/ipn, to receive Paypal notifications. Capture the session ID with $_POST['custom'];
I ended up using the Braintree API for this use case. Ther Brantree API returns a unique payment identifier (payment Nonce) which you can then validate by submitting a call back to the Braintree API to ensure the payment was actually received properly.

Sagepay: Payment Authorised and Then Failed

I'm using Server/InFrame integration, and according to Sagepay support, there are (rare) occasions when we get a notification about a successful payment (via an OK status), but this is then later failed. This can happen, according to Sagepay support, when they haven't been able to contact the bank properly.
I'm unable to find details about this in the documentation at http://www.sagepay.co.uk/file/1161/download-document/SERVERProtocolandIntegrationGuidelinesV3%200.pdf?token=0eZCcKj0tm33YeZ4gfrk4pHPaLClQnRcq3_vXsISjHI . The closest thing I see is in Step 12,
when SagePay sends batch files to the bank
If transactions are rejected, we correct any errors and resubmit them for you.
What happens, in terms of status codes sent to the notification url, in a case when this batch fails, or there is some other error after the "OK" is sent to the notification url? Is there any official documentation to handle this case, or similar cases when a payment is "OK", but then later fails?
Edit: I'm seeing that the simulator doesn't seem to handle this case either. Is there a way to properly test/simulate this case, when OK is sent, but then later failed?
The only reason you would receive a mixed message, such as Error/Failed on My Sage Pay but OK via Notification URL, is if an error occured during the notiication which returned an error/invalid response.
If the notification response via the Notification URL is interrupted i.e. browser refresh/closed etc Sage Pay may pick this up as error after the authorisation from the bank has been received as OK. We will then send Error via Notification URL to confirm the transaction has failed.
We'll send the notification several times until we receive a successful response/handshake from you in which you confirm the Status, StatusDetail and RedirectURL.
This scenario does not occur often however if you are able to provide a TXID example, our contact details can be found via http://www.sagepay.co.uk/contact, within 72 hours of the transaction being posted, we can investigate the reason for failure against the transaction logs.
Sage Pay Support

How to cancel an order when a payment gateway page timesout in magento

i have integrated a 3rd party payment gateway into magento. It handels a successful transaction or a failed transaction perfectly.
But what if when the user is at the payment gateway page and it times out or when at the payment gateway page the user closes the page and returns back to the site later or user simply hits the back button,
how do i cancel the order then?
Should i use some observer to do this?
If so could you suggest to which events do i need to fire the observer?
the issue i am facing is that when a user is redirected to a payment gateway and he/she hits the back button and comes back to the site, the order is still created, which ideally should have been canceled.
Thanks.
Your validation methods should not be session aware and should process any feedback (and validate before you process) in any case. You also need a monitoring service that times out orders without a response after some time if you need them to be disabled in timely fashion.
However if user hits back button there is really nothing you can do as the feedback from payment gateway never gets sent on user action. I know some payment gateways issue automatic post from the server no matter what you have to investigate if this can be also possible with your payment gateway.

Resources