简体   繁体   English

Omnipay:PayPal 和 Stripe sale_id 退款?

[英]Omnipay: PayPal and Stripe sale_id for refund?

I'm trying to refund transactions via Omnipay and it looks like Omnipay supports refunds .我正在尝试通过 Omnipay 退款交易,看起来 Omnipay 支持退款 However the documentation isn't clear and I've some confusion about how to go about this.但是文档不清楚,我对如何 go 对此感到有些困惑。

Omnipay Example code for refund: 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";
    }

What's the $sale_id here?这里的 $sale_id 是什么? My Payments table has transaction id saved as:我的付款表的交易 ID 保存为:

'PAYMENTINFO_0_TRANSACTIONID' => $data['PAYMENTINFO_0_TRANSACTIONID'],

Which looks like: 01H36802XU637613S (PayPal) & ch_1IYpA7BJRxbFR9rFrGmPKs85 (Stripe).看起来像: 01H36802XU637613S (PayPal)和ch_1IYpA7BJRxbFR9rFrGmPKs85 (条纹)。 Are these the $sale_id ?这些是$sale_id吗?

This is really something Omnipay will likely have to answer on the whole, but maybe this helps:这确实是 Omnipay 可能不得不整体回答的问题,但也许这会有所帮助:

ch_1IYpA7BJRxbFR9rFrGmPKs85 would be what you'd use to create a refund in Stripe:https://stripe.com/docs/api/refunds/create#create_refund-charge ch_1IYpA7BJRxbFR9rFrGmPKs85将用于在 Stripe 中创建退款:https://stripe.com/docs/api/refunds/create#create_refund-charge

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM