小编Thu*_*Sea的帖子

PayPal Checkout:仅使用客户端代码接收付款是否安全?

我正在使用 PayPal API 将付款选项添加到我的网站。在他们的教程中,他们使用 JavaScript 在客户端完全渲染按钮并设置交易。这是示例代码:

<script>
  paypal.Buttons({
    createOrder: function(data, actions) {
      // This function sets up the details of the transaction, including the amount and line item details.
      return actions.order.create({
        purchase_units: [{
          amount: {
            value: '0.01'
          }
        }]
      });
    },
    onApprove: function(data, actions) {
      // This function captures the funds from the transaction.
      return actions.order.capture().then(function(details) {
        // This function shows a transaction success message to your buyer.
        alert('Transaction completed by ' + details.payer.name.given_name);
      });
    }
  }).render('#paypal-button-container');
  //This …
Run Code Online (Sandbox Code Playgroud)

javascript payment paypal paypal-rest-sdk

6
推荐指数
1
解决办法
3788
查看次数

标签 统计

javascript ×1

payment ×1

paypal ×1

paypal-rest-sdk ×1