Javascript createOrder后的Paypal签出重定向URL

Javascript createOrder后的Paypal签出重定向URL,javascript,Javascript,我尝试在Javascript中使用新的paypal方法作为结帐按钮,但一旦付款完成,我就无法重定向用户 这是我的密码: paypal.Buttons({ // Set up the transaction createOrder: function(data, actions) { return actions.order.create({ application_context: {

我尝试在Javascript中使用新的paypal方法作为结帐按钮,但一旦付款完成,我就无法重定向用户

这是我的密码:

    paypal.Buttons({
        // Set up the transaction
        createOrder: function(data, actions) {
            return actions.order.create({
                application_context: {
                    return_url: 'https://url.com/ok.php',
                    cancel_url: 'https://url.com/nok.php',
                    brand_name: "AKAZ",
                    locale: "fr-FR",
                    user_action: "CONTINUE"
                },
                purchase_units: [{
                    amount: {
                        value: '175.20'
                    }
                }]
            });
        },
        onApprove: function(data, actions) {
            return actions.payment.execute().then(function() {
                    actions.redirect();
                }
            );
        },
        onCancel: function (data, action) {
            return actions.payment.execute().then(function() {
                    actions.redirect();
                }
            );
        }
    }).render('#paypal-button-container');

并读取paypal文档

未捕获错误:预期返回url为空或。智能支付按钮集成禁止返回url。在
<script
    src="https://www.paypal.com/sdk/js?client-id=SB_CLIENT_ID">
  </script>

<script>paypal.Buttons().render('body');</script>
{
  "intent": "CAPTURE",
  "application_context": {
    "return_url": "https://example.com",
    "cancel_url": "https://example.com",
    "brand_name": "EXAMPLE INC",
    "locale": "en-US",
    "landing_page": "BILLING",
    "shipping_preference": "SET_PROVIDED_ADDRESS",
    "user_action": "CONTINUE"
  },
  "purchase_units": [
    {
      "reference_id": "PUHF",
      "description": "Sporting Goods",

      "custom_id": "CUST-HighFashions",
      "soft_descriptor": "HighFashions",
      "amount": {
        "currency_code": "USD",
        "value": "230.00",
        "breakdown": {
          "item_total": {
            "currency_code": "USD",
            "value": "180.00"
          },
          "shipping": {
            "currency_code": "USD",
            "value": "30.00"
          },
          "handling": {
            "currency_code": "USD",
            "value": "10.00"
          },
          "tax_total": {
            "currency_code": "USD",
            "value": "20.00"
          },
          "shipping_discount": {
            "currency_code": "USD",
            "value": "10"
          }
        }
      },
      "items": [
        {
          "name": "T-Shirt",
          "description": "Green XL",
          "sku": "sku01",
          "unit_amount": {
            "currency_code": "USD",
            "value": "90.00"
          },
          "tax": {
            "currency_code": "USD",
            "value": "10.00"
          },
          "quantity": "1",
          "category": "PHYSICAL_GOODS"
        },
        {
          "name": "Shoes",
          "description": "Running, Size 10.5",
          "sku": "sku02",
          "unit_amount": {
            "currency_code": "USD",
            "value": "45.00"
          },
          "tax": {
            "currency_code": "USD",
            "value": "5.00"
          },
          "quantity": "2",
          "category": "PHYSICAL_GOODS"
        }
      ],
      "shipping": {
        "method": "United States Postal Service",
        "address": {
          "name": {
            "give_name":"John",
            "surname":"Doe"
          },
          "address_line_1": "123 Townsend St",
          "address_line_2": "Floor 6",
          "admin_area_2": "San Francisco",
          "admin_area_1": "CA",
          "postal_code": "94107",
          "country_code": "US"
        }
      }
    }
  ]
}