From f53329f9eeed22ccabdb17b66311a73e199e6280 Mon Sep 17 00:00:00 2001 From: kcppdevelopers Date: Tue, 2 Jul 2019 09:58:47 +0530 Subject: [PATCH] EC: Cart Amount Mismatch, PFW-447 --- .../angelleye-admin-order-payment-process.php | 5 +++++ ...ass-wc-gateway-paypal-express-request-angelleye.php | 10 ++++++++++ 2 files changed, 15 insertions(+) diff --git a/angelleye-includes/angelleye-admin-order-payment-process.php b/angelleye-includes/angelleye-admin-order-payment-process.php index c4fc1a2ce..cbef542af 100644 --- a/angelleye-includes/angelleye-admin-order-payment-process.php +++ b/angelleye-includes/angelleye-admin-order-payment-process.php @@ -631,6 +631,11 @@ public function angelleye_reference_transaction_request_ec_pp_pf($order, $refere } else { $Payment['order_items'] = array(); } + if( $order->get_total() != $PaymentDetails['shippingamt'] ) { + $PaymentDetails['shippingamt'] = $PaymentDetails['shippingamt']; + } else { + $PaymentDetails['shippingamt'] = 0.00; + } $PayPalRequestData['PaymentDetails'] = $PaymentDetails; return $PayPalRequestData; } diff --git a/angelleye-includes/express-checkout/class-wc-gateway-paypal-express-request-angelleye.php b/angelleye-includes/express-checkout/class-wc-gateway-paypal-express-request-angelleye.php index 9ddef3bcc..b34d3fbd4 100644 --- a/angelleye-includes/express-checkout/class-wc-gateway-paypal-express-request-angelleye.php +++ b/angelleye-includes/express-checkout/class-wc-gateway-paypal-express-request-angelleye.php @@ -519,6 +519,11 @@ public function angelleye_do_express_checkout_payment_request() { } else { $Payment['order_items'] = array(); } + if( $order->get_total() != $Payment['shippingamt'] ) { + $Payment['shippingamt'] = $Payment['shippingamt']; + } else { + $Payment['shippingamt'] = 0.00; + } $REVIEW_RESULT = !empty($paypal_express_checkout['ExpresscheckoutDetails']) ? $paypal_express_checkout['ExpresscheckoutDetails'] : array(); $PaymentRedeemedOffers = array(); if ((isset($REVIEW_RESULT) && !empty($REVIEW_RESULT)) && isset($REVIEW_RESULT['WALLETTYPE0'])) { @@ -1359,6 +1364,11 @@ public function DoReferenceTransaction($order_id) { } else { $Payment['order_items'] = array(); } + if( $order->get_total() != $PaymentDetails['shippingamt'] ) { + $PaymentDetails['shippingamt'] = $PaymentDetails['shippingamt']; + } else { + $PaymentDetails['shippingamt'] = 0.00; + } $PayPalRequestData['PaymentDetails'] = $PaymentDetails; $this->paypal_response = $this->paypal->DoReferenceTransaction($PayPalRequestData); AngellEYE_Gateway_Paypal::angelleye_paypal_for_woocommerce_curl_error_handler($this->paypal_response, $methos_name = 'DoExpressCheckoutPayment', $gateway = 'PayPal Express Checkout', $this->gateway->error_email_notify);