MJPMalc Posted June 14, 2021 Share Posted June 14, 2021 Hello, Where do i add this code to add an extra button to payment page for subscription. Thanks <div id="paypal-button-container-P-5WH16516Y1333711AL6IXKLY"></div> <script src="https://www.paypal.com/sdk/js?client-id=ARqekNCFqN5PrJW4WCEvIh7jqw2XRiLthPgZi0WePZG_dGXTcOHw-dvJgDVcirqhmprQZVQlXJNoBNyg&vault=true&intent=subscription" data-sdk-integration-source="button-factory"></script> <script> paypal.Buttons({ style: { shape: 'rect', color: 'white', layout: 'vertical', label: 'subscribe' }, createSubscription: function(data, actions) { return actions.subscription.create({ /* Creates the subscription */ plan_id: 'P-5WH16516Y1333711AL6IXKLY' }); }, onApprove: function(data, actions) { alert(data.subscriptionID); // You can add optional success message for the subscriber here } }).render('#paypal-button-container-P-5WH16516Y1333711AL6IXKLY'); // Renders the PayPal button </script> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.