Li
Delete
Are you sure you want to delete this?
PaypalModel
-
Date
-
20211030
-
Target
-
C_015
-
Title
-
Webhook is the hint for CONTINUE LOOP PROBLEM
-
Contents
-
REST APIs
Webhooks are HTTP callbacks that receive notification messages for events. To create a webhook in PayPal, merchants configure a webhook listener and subscribe it to events. A webhook listener is a server that listens at a specific URL for incoming HTTP POST notification messages that are triggered when events occur. PayPal signs each notification message that it delivers to your webhook listener.
The PayPal REST APIs use webhooks for event notification
API
CURRENT
Webhooks are HTTP callbacks that receive notification messages for events. To create a webhook at PayPal, users configure a webhook listener and subscribe it to events. A webhook listener is a server that listens at a specific URL for incoming HTTP POST notification messages that are triggered when events occur. PayPal signs each notification message that it delivers to your webhook listener.
Webhook event names
API
CURRENT
Last updated: October 7th 2021, @ 11:10:14 am
PayPal supports these webhook events.
Authorized and captured payments
Batch payouts
Billing plans and agreements
Log in with PayPal
Disputes
Checkout buyer approval
Invoicing
Marketplaces and Platforms
Merchant onboarding
Orders
Payment orders
Referenced payouts
Sales
Subscriptions
Vault
Matching CHECKOUT.ORDER.APPROVED with PAYMENT.CAPTURE.COMPLETED
Options
djslim
djslim Contributor Contributor
Posted on Apr-04-2020 08:07 PM
Hi,
I'm completely new to the PayPal API.
I'm using the smart button with a web hook to capture the payment & shipping information.
I thought I'd get the shipping info with the event CHECKOUT.ORDER.APPROVED then when I get the PAYMENT.CAPTURE.COMPLETED event I'll be sure the payment is fully processed.
I noticed that the transaction ID for both are different. so I have no way of matching the two.
Is there a way to match the two that I'm missing?
Or can I just assume CHECKOUT.ORDER.APPROVED is enough to trust that everything is good and ignore PAYMENT.CAPTURE.COMPLETED?
We would always recommend waiting for the "Payment.Capture.Completed" webhook for each transaction. The webhook for "Checkout.Order.Approved" was actually intended to be used to notify your system to attempt Payment Capture. In other words, some capture immediately and really don't need the Approved webhook since just the Completed one would suffice. But some choose to authorize, then capture later, checking to make sure they got an Approved webhook before initiating the capture. That's just a glimpse into the original intent.
I believe you can add your own order id called an "invoice_id". You can pass this in the "purchase_units" object when creating the transaction. Then, when you receive the checkout.order.approved webhook, you can look at the details of the transaction to find the invoice_id. Then, when capturing the transaction, that same invoice ID will be attributed to the captured ID as well.
I hope that helps!
Options
IDislikThisGame
IDislikThisGame Member Member
Aug-01-2021 11:15 AM
This is the reality of PayPal in 2021. You cant pass data to PAYMENT.CAPTURE.COMPLETED for whatever reason and you can't match CHECKOUT.ORDER.APPROVED that contains the relevant data to the right COMPLETED.
Using PayPal feels like fighting against PayPal not like using it
Options
MarcoT999
MarcoT999 Contributor Contributor
Sep-23-2021 01:29 PM
This is a serious problem for us. There is no way to attribute `CHECKOUT.ORDER.APPROVED` with a `PAYMENT.CAPTURE.COMPLETED` since anything within the purchase_units don't show up in the latter webhook.
Aaron... help us out man.
-Aaron
I did find a way by analyzing the JSON payload in the webhook. I was able to match the checkout with the successful payment using:
req.body.resource.supplementary_data.related_ids.order_id