【发布时间】:2015-11-24 16:11:30
【问题描述】:
我正在使用最新版本的 PayPal rest-api-sdk-php。在创建付款和执行付款以及取回所有相关数据方面一切正常,但我决定我想要通过贝宝支付的总金额。它返回一个 JSON 对象,示例如下
"transactions": [
{
"amount": {
"total": "20.00",
"currency": "GBP",
"details": {
"subtotal": "17.50",
"tax": "1.30",
"shipping": "1.20"
}
},
"description": "Payment description",
"invoice_number": "55e30dbd55cea",
"item_list": {
"items": [
{
"name": "Ground Coffee 40 oz",
"price": "7.50",
"currency": "GBP",
"quantity": "1",
"description": "Ground Coffee 40 oz",
"tax": "0.30"
},
{
"name": "Granola bars",
"price": "2.00",
"currency": "USD",
"quantity": "5",
"description": "Granola Bars with Peanuts",
"tax": "0.20"
}
]
},
}
],
我曾尝试调用 $payment->transactions->amount->total 但出现错误。只是想知道是否有人可以提供一些启示。谢谢
【问题讨论】: