Previously, I used Paypal Subscription links on my website, clicking which, users can go to Paypal payment page, pay the amount there and become subscriber.
Now, I want to receive webhooks, whenever my subscriber updates or cancels his subscription. Therefore, am using following code to render Paypal buttons via which users can now buy subscriptions. I have setup corresponding webhooks against the below mentioned client-id in My Apps section in Paypal. This is all working for new subscriptions.
<div id="paypal-button-container-P-XXX"></div>
<script src="https://www.paypal.com/sdk/js?client-id=XXXXXX&vault=true&intent=subscription" data-sdk-integration-source="button-factory"></script>
<script>
paypal.Buttons({
style: {
shape: 'rect',
color: 'gold',
layout: 'vertical',
label: 'subscribe'
},
createSubscription: function(data, actions) {
return actions.subscription.create({
/* Creates the subscription */
plan_id: 'P-XXX'
});
},
onApprove: function(data, actions) {
alert(data.subscriptionID);
}
}).render('#paypal-button-container-P-XXX'); // Renders the PayPal button
</script>
I want to know, whether there is a way so that I can setup or receive webhooks for my old subscribers as well, which subscribed through the Subscriber Plan link?