Pak Developer
Pak Developer

Reputation: 93

Get to know when paypal made payment in subscriptions plan

I'm using paypal subscription plan which is define here Subscription Integration I'm using reactjs here is package which I'm using for paypal react-paypal-button-v2 I'm successfully able to make payment but problem is I'm setting subscription plan which make payment every month. So how can I get to know when paypal made payment for next month. Is there some webhook or callback url which is called everytime when paypal made payment for this specific subscription plan. If there is how can I set any guide or something ?

Upvotes: 0

Views: 409

Answers (2)

harunonur
harunonur

Reputation: 11

Webhook PAYMENT.SALE.COMPLETED has subscription id named billing_agreement_id. (if this webhook was triggered as a result of a subscription payment)

Ex: webhook body like

{ ... ... resource: { "billing_agreement_id":"I-XXXXXXXXX" } }

Upvotes: 1

Preston PHX
Preston PHX

Reputation: 30377

Store a record of the subscriptionID when it is first created. Typically you'll want to associate this with a user.

For keeping track of future payments, set up a webhook listener for PAYMENT.SALE.COMPLETED events.

Upvotes: 1

Related Questions