From 5c50297c7236f3ecacb720d33f744e5016cc2d4d Mon Sep 17 00:00:00 2001 From: Lei OT Date: Mon, 20 May 2024 15:47:00 +0800 Subject: [PATCH] perf: PayPal webhooks: custom_id --- webht/third_party/paypal/controllers/index.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/webht/third_party/paypal/controllers/index.php b/webht/third_party/paypal/controllers/index.php index d2d89fd8..2a5afe98 100644 --- a/webht/third_party/paypal/controllers/index.php +++ b/webht/third_party/paypal/controllers/index.php @@ -646,6 +646,7 @@ class Index extends CI_Controller { $pn_txn_id = $post_data->resource->id; $pn_invoice = ''; + $pn_custom = ''; $pn_mc_gross = ''; $pn_mc_currency = ''; $pn_mc_fee = ''; @@ -669,6 +670,7 @@ class Index extends CI_Controller { case 'PAYMENT.CAPTURE.COMPLETED': $pn_invoice = $post_data->resource->invoice_id; + $pn_custom = $post_data->resource->custom_id; $pn_mc_gross = $post_data->resource->amount->value; $pn_mc_currency = $post_data->resource->amount->currency_code; $pn_payment_status = $post_data->resource->status; @@ -691,6 +693,7 @@ class Index extends CI_Controller { default: // capture COMPLETED $pn_invoice = $post_data->resource->invoice_id; + $pn_custom = $post_data->resource->custom_id; $pn_mc_gross = $post_data->resource->amount->value; $pn_mc_currency = $post_data->resource->amount->currency_code; $pn_payment_status = $post_data->resource->status; @@ -712,7 +715,7 @@ class Index extends CI_Controller { $this->Note_model->save_paypal_note( $pn_txn_id, $pn_invoice, - "", + $pn_custom, $pn_mc_gross, "", "",