if (typeof paypal !== 'undefined') { paypal.Buttons({ style: { shape: 'rect', color: 'gold', layout: 'vertical', label: 'subscribe' }, createSubscription: function(data, actions) { return actions.subscription.create({ plan_id: 'xxxxxxxxxxxxxx`enter code here`' }); }, onApprove: function(data, actions) { alert('Subscription completed! ID: '+ data.subscriptionID); }, onError: function(err) { console.error('PayPal Button Error:', err); } }).render('#paypal-button-container'); } else { console.error("PayPal SDK not loaded yet."); }
I am trying to make subscription payments with a credit card on PayPal without a PayPal account. My credentials and plan ID are fine. But still facing issues, Things don’t appear to be working at the moment