I've PayPal subscription javascript smart button it is working fine for paypal account login but when use guest payment using credit card, payment successfully done but light box not closing and due to that I am not getting subscription id onApprove event.
paypal.Buttons({
style: {
shape: 'rect',
color: 'gold',
layout: 'vertical',
label: 'subscribe'
},
createSubscription: function(data, actions) {
return actions.subscription.create({
'plan_id': 'my_plan_id'
});
},
onApprove: function(data, actions) {
console.log(data.subscriptionID);
},
onError: function(error) {
console.log(error);
},
onCancel: (data, actions) => {
console.log(data, actions);
},
}).render('#paypal-button-container');