cancel
Showing results for 
Search instead for 
Did you mean: 

Smart Payment Buttons - Subscriptions

Options
jimmyjam2
Contributor
Posted on

I am attempting to set up a website to accept subscriptions using PayPal Smart Payment Buttons.

 

I have via Postman created a product and subscription plan.

 

I have added the script tag to the website

 

<script src="https://www.paypal.com/sdk/js?client-id=REDACTED&disable-card=jcb&debug=true&vault=true"></script>

 

 

 

I have rendered the buttons

 

 

<script>
	paypal.Buttons({
		createSubscription: function(data, actions) {
			return actions.subscription.create({
				'plan_id': 'P-REDACTED'
			});
		},
		onApprove: function(data, actions) {
				alert('Thank you for your payment ' + data.subscriptionID);
		}
	}).render('#paypal-button-container');
</script>

 

 

 

1. When I display the page I am getting a js error in the console, is this a problem?

[Error] Failed to load resource: the server responded with a status of 404 (Not Found) (smart-payment-buttons.min.js.map, line 0)

 

2. HOW can I implement a webhook to be fired when a subscription purchase is approved?  That webhook should also contain additional information in the form of js variables captured from a form on the page.  

 

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.