我正在將PayPal集成到我的網站,但是我已經到了要求我將ID傳回給客戶端的地步。我不知道如何做到這一點。任何幫助都會很棒。PayPal如何將ID傳遞給客戶端
這是我從PayPal服務器獲取的最後一個JSON代碼。正如我從服務器端代碼那樣做的。
{
"id":"PAY-5VL741754E714161BLHUWCKY",
"intent":"sale",
"state":"created",
"payer":
{
"payment_method":"paypal"
},
"transactions":
[{
"amount":
{
"total":"4.00",
"currency":"USD",
"details":
{
"subtotal":"2.00",
"tax":"2.00",
"shipping":"1.00",
"shipping_discount":"-1.00"
}
},
"description":"The payment transaction description.",
"custom":"PlayerID",
"invoice_number":"merchant invoice",
"item_list":
{
"items":
[{
"name":"item 1",
"description":"item 1 description",
"price":"1.00",
"currency":"USD",
"tax":"1.00",
"quantity":1
},
{
"name":"item 2",
"description":"item 2 description",
"price":"1.00",
"currency":"USD",
"tax":"1.00",
"quantity":1
}]
},
"related_resources":
[]
}],
"create_time":"2017-10-20T02:36:27Z",
"links":
[{
"href":"h.t.t.p.s.:././.a.p.i...s.andbox.paypal.com/v1/payments/payment/PAY-5VL741754E714161BLHUWCKY",
"rel":"self",
"method":"GET"
},
{
"href":"h.t.t.p.s.:././.w.w.w...s.andbox.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=EC-3U757031AX945661J",
"rel":"approval_url",
"method":"REDIRECT"
},
{
"href":"h.t.t.p.s:././.a.p.i...s.a.ndbox.paypal.com/v1/payments/payment/PAY-5VL741754E714161BLHUWCKY/execute",
"rel":"execute",
"method":"POST"
}
]}
是的,我得到那個,但我怎麼傳遞迴客戶端,以便它可以用嗎? – Hodds