![](/img/trans.png)
[英]PayPal API: How to get Sale ID and refund payment made via PayPal?
[英]Omnipay: PayPal and Stripe sale_id for refund?
我正在嘗試通過 Omnipay 退款交易,看起來 Omnipay 支持退款。 但是文檔不清楚,我對如何 go 對此感到有些困惑。
Omnipay 退款示例代碼:
$transaction = $gateway->refund(array(
'amount' => '10.00',
'currency' => 'AUD',
));
$transaction->setTransactionReference($sale_id);
$response = $transaction->send();
if ($response->isSuccessful()) {
echo "Refund transaction was successful!\n";
$data = $response->getData();
echo "Gateway refund response data == " . print_r($data, true) . "\n";
}
這里的 $sale_id 是什么? 我的付款表的交易 ID 保存為:
'PAYMENTINFO_0_TRANSACTIONID' => $data['PAYMENTINFO_0_TRANSACTIONID'],
看起來像: 01H36802XU637613S
(PayPal)和ch_1IYpA7BJRxbFR9rFrGmPKs85
(條紋)。 這些是$sale_id
嗎?
這確實是 Omnipay 可能不得不整體回答的問題,但也許這會有所幫助:
ch_1IYpA7BJRxbFR9rFrGmPKs85
將用於在 Stripe 中創建退款:https://stripe.com/docs/api/refunds/create#create_refund-charge
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.