From d1782865c9166140360a12200703bde5a9538d9f Mon Sep 17 00:00:00 2001 From: Lei OT Date: Thu, 3 Apr 2025 11:19:34 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20PayPal=20v1=E7=9A=84=E9=80=80=E6=AC=BE?= =?UTF-8?q?=20PAYMENT.SALE.REFUNDED?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webht/third_party/paypal/controllers/index.php | 4 +++- webht/third_party/paypal/models/paypal_model.php | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/webht/third_party/paypal/controllers/index.php b/webht/third_party/paypal/controllers/index.php index cc893275..74d4f20d 100644 --- a/webht/third_party/paypal/controllers/index.php +++ b/webht/third_party/paypal/controllers/index.php @@ -724,7 +724,9 @@ class Index extends CI_Controller { $net_amount = isset($post_data->resource->seller_receivable_breakdown) ? '-'.$post_data->resource->seller_receivable_breakdown->refund_from_received_amount->value : $pn_mc_gross; // 'PAYMENT.SALE.REVERSED': - $net_amount = isset($post_data->resource->refund_from_received_amount) ? $post_data->resource->refund_from_received_amount : $net_amount; + if ($post_data->event_type === 'PAYMENT.SALE.REVERSED') { + $net_amount = isset($post_data->resource->refund_from_received_amount) ? $post_data->resource->refund_from_received_amount : $net_amount; + } $GAI_API->payee = new stdClass(); $GAI_API->res_links = $post_data->resource->links; diff --git a/webht/third_party/paypal/models/paypal_model.php b/webht/third_party/paypal/models/paypal_model.php index f3b376e3..4386e290 100644 --- a/webht/third_party/paypal/models/paypal_model.php +++ b/webht/third_party/paypal/models/paypal_model.php @@ -679,7 +679,7 @@ class Paypal_model extends CI_Model { public function exec_BIZ_TrainCostAdd($COLI_SN, $ssje) { // return false; // todo: 暂时关闭 - log_message('error','test: ' . __METHOD__ . ': ' . __LINE__ . ' exec_BIZ_TrainCostAdd' . PHP_EOL . var_export(1, 1)); + // log_message('error','test: ' . __METHOD__ . ': ' . __LINE__ . ' exec_BIZ_TrainCostAdd' . PHP_EOL . var_export(1, 1)); $sql = " exec SP_BIZ_TrainCostAdd $COLI_SN,$ssje ; select 0;"; log_message('error','test: ' . __METHOD__ . ': ' . __LINE__ . ' ' . PHP_EOL . var_export($sql, 1)); $this->HT->query($sql);