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