2

我已经设法设置了我正在处理的网站,以使用 paypal c# rest api sdk ( https://github.com/paypal/rest-api-sdk-dotnet ) 处理付款。

我正在苦苦挣扎的一点(除了令人难以置信的糟糕的文档......)是如何让我的订单摘要显示我的购物篮项目,包括税款,以及贝宝是否基于运费将/不会包括在内税?

总额为 150.99 英镑的样品订单包含:

单件产品售价 145 英镑,含税 24.17 英镑,运费 5.99 英镑,含税 1.00 英镑

这是我发送到贝宝的:

{
  "intent": "sale",
  "payer": {
        "payment_method": "paypal"
  },
  "transactions": [
        {
              "amount": {
                    "currency": "GBP",
                    "total": "150.99",
                    "details": {
                          "shipping": "5.99",
                          "subtotal": "120.83",
                          "tax": "24.17"
                    }
              },
              "description": "My Site",
              "item_list": {
                    "items": [
                          {
                                "quantity": "1",
                                "name": "My Item",
                                "price": "120.83",
                                "currency": "GBP",
                                "sku": "123"
                          }
                    ],
                    "shipping_address": {
                          "recipient_name": "My Name",
                          "line1": "My address",
                          "line2": "",
                          "city": "London",
                          "country_code": "GB",
                          "postal_code": "XX XXX",
                          "phone": "00 0000 0000"
                    }
              }
        }
  ],
  "redirect_urls": {
        "return_url": "http://return",
        "cancel_url": "http://cancel"
  }
}

这适用于贝宝,我可以处理付款,但项目在订单摘要中显示如下:

My Item £120.83
Item number: 123
Item price: £120.83
Quantity: 1

Item total £120.83
VAT: £24.17
Postage and packaging: £5.99

Total £150.99 GBP

没关系,但我宁愿显示包括增值税在内的价格 - 这可能吗?我在设置订单项时尝试使用 price inc tax,但出现以下错误:

Item amount must add up to specified amount subtotal (or total if amount details not specified

感觉就像我很接近......有什么想法吗?

4

1 回答 1

0

如果您将小计设置为等于总和“税”:“0”,您可以定义包含增值税的项目价格。这是我看到的大多数平台使用的,因为无论如何,Paypal 都会从你的最终总额中扣除费用。此外,它还可以防止可能的舍入错误。

于 2021-02-05T10:22:28.870 回答