Skip to content
赞助

PayPal 退款

TIP

PayPal 的实现由 GitHub Copilot 生成

方法名参数返回值
refundarray $orderCollection

退款操作

TIP

PayPal 退款基于已捕获的支付(Capture)发起,退款时需要提供 capture_id

php
Pay::config($config);

$order = [
    'capture_id' => 'CAPTURE_ID', // 必填:捕获支付时返回的 capture id
    // 「选填」部分退款时传入,不传则全额退款
    'amount' => [
        'value' => '5.00',
        'currency_code' => 'USD',
    ],
    // 「选填」退款备注
    'note_to_payer' => 'Defective product',
    // 「选填」商户退款单号
    'invoice_id' => 'REFUND-20240101001',
];

$result = Pay::paypal()->refund($order);

订单配置参数

所有订单配置参数和官方无任何差别,兼容所有功能,所有参数请参考以下 API 查看「请求参数」一栏。

Released under the MIT License.