简体   繁体   中英

PayPal guest subscription using Javascript Smart Button light box is not closing

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');

This is the exact scenario I am facing as well which has only recently started occurring. Both PayPal account and guest users were able to successfully subscribe and I was able to pull post data from the onApprove event for both. Now any time a guest subscribes ie uses their credit card without creating a PayPal account, the lightbox is not closing and PayPal's standard confirmation page is displayed which is no good for me as I need the confirmation of the subscription to be passed to the onApprove event. Its best to ask PayPal for assistance in this matter as its quite a serious error.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM