Webhook event PAYMENT.SALE.COMPLETED has no reference to Subscription or Subscription Plan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Does anyone know how can i get subscription plan id when PayPal successfully capture the payment?
I'm struggling to get it via Sale object or billing agreement.
Thanks,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
hi,
The 'Billing Agreement Id' is the Subscription Id in the PAYMENT.SALE.COMPLETED event. See a sample below.
{
"id": "WH-72J78916XW253041B-5HG111500B361204H",
"event_version": "1.0",
"create_time": "2019-11-08T19:18:05.489Z",
"resource_type": "sale",
"event_type": "PAYMENT.SALE.COMPLETED",
"summary": "Payment completed for $ 11.0 USD",
"resource": {
"id": "8VD9479630095983G",
"state": "completed",
"amount": {
"total": "11.00",
"currency": "USD",
"details": {
"subtotal": "11.00"
}
},
"payment_mode": "INSTANT_TRANSFER",
"protection_eligibility": "ELIGIBLE",
"protection_eligibility_type": "ITEM_NOT_RECEIVED_ELIGIBLE,UNAUTHORIZED_PAYMENT_ELIGIBLE",
"transaction_fee": {
"value": "0.62",
"currency": "USD"
},
"invoice_number": "",
"billing_agreement_id": "I-GPVDFDPJEXGP",
"create_time": "2019-11-08T19:17:53Z",
"update_time": "2019-11-08T19:17:53Z",
"links": [
{
"href": "https://api.sandbox.paypal.com/v1/payments/sale/8VD9479630095983G",
"rel": "self",
"method": "GET"
},
{
"href": "https://api.sandbox.paypal.com/v1/payments/sale/8VD9479630095983G/refund",
"rel": "refund",
"method": "POST"
}
]
},
"links": [
{
"href": "https://api.sandbox.paypal.com/v1/notifications/webhooks-events/WH-72J78916XW253041B-5HG111500B36120...",
"rel": "self",
"method": "GET"
},
{
"href": "https://api.sandbox.paypal.com/v1/notifications/webhooks-events/WH-72J78916XW253041B-5HG111500B36120...",
"rel": "resend",
"method": "POST"
}
]
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is it possible that the webhooks simulator is not populating that field?
I am probably going to go the way you suggest, but is there any official documentation on the matter?
Thanks,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, the webhook simulator is not populating it. I had reported/queried the same in email to technical support and they confirmed it is the same webhook event which will have the billing agreement details.
What I would suggest is that you have a quick notification listener URL up and configure that in your Paypal developer ssandbox account. That way you will get better idea. the listener can be on localhost during development and you can use ngrok to configure that in Paypal env.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Haven't Found your Answer?
It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.
- I was denied resolution twice in Disputes and Limitations Archives
- How can I require a phone number in an existing recurring payment application form? in Payments Archives
- How Can I Make Multiple Payment Buttons (Subscription and Checkout) Work on One Page, Please? in Payments Archives
- Is a subscription activated only after the setup fee payment is completed? in Payments Archives
- Will my subscriptions cancel or continue? in Payments Archives