我正在集成PayPal进行付款并使用其Go SDK。我已将一张卡保存到Vault中,并且我试图从该卡ID中退款。以下是通过信用卡付款的回复:
{
"intent": "sale",
"payer": {
"payment_method": "credit_card",
"funding_instruments": [
{
"credit_card_token": {
"credit_card_id": "CARD-ID",
"last4": "9669",
"expire_year": "2021",
"expire_month": "6"
}
}
]
},
"transactions": [
{
"amount": {
"currency": "USD",
"total": "10.00",
"details": {
"subtotal": "10.00"
}
},
"description": "test description",
"related_resources": [
{
"sale": {
"id": "SALE-ID",
"amount": {
"currency": "USD",
"total": "10.00",
"details": {}
},
"create_time": "2019-03-19T09:31:01Z",
"state": "pending",
"parent_payment": "PAY-ID",
"update_time": "2019-03-19T09:31:06Z",
"links": [
{
"href": "https://api.sandbox.paypal.com/v1/payments/sale/SALE-ID",
"rel": "self",
"method": "GET"
},
{
"href": "https://api.sandbox.paypal.com/v1/payments/sale/SALE-ID/refund",
"rel": "refund",
"method": "POST"
},
{
"href": "https://api.sandbox.paypal.com/v1/payments/payment/PAY-ID",
"rel": "parent_payment",
"method": "GET"
}
]
}
}
]
}
],
"id": "PAY-ID",
"create_time": "2019-03-19T09:31:01Z",
"state": "approved",
"update_time": "2019-03-19T09:31:06Z",
"links": [
{
"href": "https://api.sandbox.paypal.com/v1/payments/payment/PAY-ID",
"rel": "self",
"method": "GET"
}
]
}
现在下面的代码用于处理退款:
amount := paypalsdk.Amount{
Currency: "USD",
Total: "5.00",
}
refundResp, err = client.RefundSale(saleId, &amount)
这将返回以下响应:
{
"name": "TRANSACTION_REFUSED",
"debug_id": "ca89e0e86326",
"message": "Request was refused.You can not do a partial refund on this transaction",
"information_link": "https://developer.paypal.com/docs/api/payments/#errors",
"details": null
}
在我的帐户设置中,我的付款审核设置为“关闭”。 有人知道我可能做错了吗?