![](/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.