<div id="paypal-button-container-P-0M87725xxxxxxxxxx"></div>
<script src="https://sandbox.paypal.com/sdk/js?client-id=xxxxxx-xxxxxx&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-0M877251FU3716542M6MRSAA'
});
},
onApprove: function(data, actions) {
console.log("data:", data);
console.log("actions:", actions);
console.log("data.subscriptionID:" + data.subscriptionID);
//alert(data.subscriptionID); // You can add optional success message for the subscriber here
}
}).render('#paypal-button-container-P-0M87725xxxxxxxxxx'); // Renders the PayPal button
</script>
商戶登入 www.sandbox.paypal.com 查看訂閱清單
在右側...展開可以看到選項, 有停止跟取消訂閱
留言
張貼留言