PayPal REST API可以显示包含税的订单商品吗?

时间:2014-06-18 12:19:06

标签: c# rest paypal paypal-rest-sdk

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

我正在努力的一点(除了令人难以置信的糟糕的文件...)是如何让我的订单摘要显示我的篮子行项目,包括税和如果paypal工作的基础运输将/赢不含税?

总计£150.99的样本订单包含:

单个产品的成本为145英镑,含税为24.17英镑 运费为£5.99含税£1.00

这就是我发送给paypal的内容:

{
  "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"
  }
}

这可以在paypal中工作,我可以处理付款,但项目在订单摘要中显示如下:

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

没关系,但我宁愿显示包括大桶在内的价格 - 这可能吗?我在设置订单项时尝试使用价格税,但收到以下错误:

Item amount must add up to specified amount subtotal (or total if amount details not specified
感觉就像我太近了......任何想法?

1 个答案:

答案 0 :(得分:0)

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