I have two Smart button on my website for a monthly subscription (working well). I successfully receive the IPN response with the payment information ready to be added to the Database. But I need to get the UserID of my application with the IPN response.
How can I pass custom variable with my Smart payment button so it can be passed to the IPN (for buying transaction and refund/cancellation ones if possible?)
Here is my Smart button code :
<div id="paypal_button"></div>
<script src="https://www.paypal.com/sdk/js?client-id=[ID]...></script>
<script>
paypal.Buttons({
style:{
color:"blue",
shape:"rect",
label:"paypal",
tagline:false
},
createSubscription: function(data, actions) {
return actions.subscription.create({'plan_id': 'P-02S33....'});
},
onApprove: function(data, actions) {
alert('You have successfully created subscription ENTERPRISE' + data.subscriptionID);
}
}).render('#paypal_button');
</script>