応援ありがとうございます!
<div id="paypal-button-container-P-1AF01028KR786213GMMELSAQ"></div>
<script src="https://www.paypal.com/sdk/js?client-id=AemF4aVK9xPpvC2me_zkop6dcYMTCRDYh2HPm8cRj7HpIYsWVGOcgkY1CLlliO0Wn3XnzI581XlgO83s&vault=true&intent=subscription" data-sdk-integration-source="button-factory"></script>
<script>
paypal.Buttons({
style: {
shape: 'rect',
color: 'gold',
layout: 'vertical',
label: 'subscribe'
},
createSubscription: function(data, actions) {
return actions.subscription.create({
/* Creates the subscription */
plan_id: 'P-1AF01028KR786213GMMELSAQ'
});
},
onApprove: function(data, actions) {
alert(data.subscriptionID); // You can add optional success message for the subscriber here
}
}).render('#paypal-button-container-P-1AF01028KR786213GMMELSAQ'); // Renders the PayPal button
</script>
この記事が気に入ったらサポートをしてみませんか?