From 7e1140a6d610e52e1cfee14a58732d03cbec1659 Mon Sep 17 00:00:00 2001 From: Lei OT Date: Fri, 13 Sep 2024 17:00:29 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20PayPal=E9=80=80=E6=AC=BE=E5=87=8F?= =?UTF-8?q?=E5=8E=BB=E6=89=8B=E7=BB=AD=E8=B4=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webht/third_party/paypal/controllers/index.php | 3 ++- webht/third_party/paypal/models/note_model.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/webht/third_party/paypal/controllers/index.php b/webht/third_party/paypal/controllers/index.php index 98aee24d..9145ea2c 100644 --- a/webht/third_party/paypal/controllers/index.php +++ b/webht/third_party/paypal/controllers/index.php @@ -1308,9 +1308,10 @@ class Index extends CI_Controller { $refund_amount = 0; if (isset($payment_memo->id) && substr($payment_memo->id, 0, 2)==="WH") { $is_webhook = true; - $refund_amount = isset($payment_memo->refund_from_received_amount) ? $payment_memo->refund_from_received_amount : '-'.$payment_memo->resource->amount->value; + $refund_amount = isset($payment_memo->refund_from_received_amount) ? $payment_memo->refund_from_received_amount : '-'.$payment_memo->resource->seller_payable_breakdown->net_amount->value; // $payment_fee = $payment_memo->resource->refund_from_transaction_fee->value; $payment_fee = property_exists($payment_memo, 'mc_fee') ? $payment_memo->mc_fee : $payment_memo->resource->refund_from_transaction_fee->value; + $refund_amount = bcsub($refund_amount, $payment_fee); } else { $refund_amount = bcsub($payment_memo->mc_gross, $payment_memo->mc_fee); $payment_fee = $payment_memo->mc_fee; diff --git a/webht/third_party/paypal/models/note_model.php b/webht/third_party/paypal/models/note_model.php index 35655fba..55e02f49 100644 --- a/webht/third_party/paypal/models/note_model.php +++ b/webht/third_party/paypal/models/note_model.php @@ -169,7 +169,7 @@ class Note_model extends CI_Model { ,pn.pn_txn_id ,replace(replace(pn.pn_invoice,char(13),' '),char(10),' ') pn_invoice ,pn.pn_custom - ,pn.pn_mc_gross + ,pn.pn_mc_gross,pn.pn_mc_fee ,pn.pn_item_name ,pn.pn_item_number ,pn.pn_mc_currency