Skip to content

三步教你免费开启 PayPal 信用卡支付

1、复制 PayPal 代码,并修改 Value

<!-- 设置按钮显示位置 -->
<div id="paypal-button-container"></div>

<!-- 引入 PayPal JavaScript SDK -->
<script src="https://www.paypal.com/sdk/js?client-id=test&currency=USD"></script>

<script>
// Render the PayPal button into #paypal-button-container
paypal.Buttons({

// Set up the transaction
createOrder: function(data, actions) {
return actions.order.create({
purchase_units: [{
amount: {
value: {{ product.price | divided_by: 100}}
}
}]
});
},

// Finalize the transaction
onApprove: function(data, actions) {
return actions.order.capture().then(function(details) {
// Show a success message to the buyer
alert('Transaction completed by ' + details.payer.name.given_name + '!');
});
}


}).render('#paypal-button-container');
</script>


2、复制访问 PayPal 官方网址,创建 App

https://developer.paypal.com/home/


3、获取 Client ID,并替换测试 id
上一篇文稿 Shopify 快速批量导入上千评论
下一篇文稿 20210519 更新样式: Shopify Back to the top 点击返回到顶部按钮