dax,
while i would love to blame OPC, it is not one for that forum. and sorry i missed that part!
i have a new and simpler solution that will not break other things in the way that my previous modification of core code might.
you said square webPay 2.0.2? assuming that is correct, here are my proposed changes:
in this file:
includes/modules/pages/checkout_payment/jscript_square_webPay.php
make the following few changes:
all of the changes are in red.Code:// starting at line 41 from: $values = json_encode([ 'orderInfo' => $order->info, 'orderBilling' => $order->billing, 'orderCustomer' => $order->customer, 'appId' => MODULE_PAYMENT_SQ_WEBPAY_APPLICATION_ID, 'locationId' => $square_webPay->getLocationDetails()->getId(), 'handler' => DIR_WS_HTTPS_CATALOG . 'squareWebPay_handler.php', 'textTotal' => TEXT_YOUR_TOTAL ?? 'Total:', 'orderTotal' => zen_round($order->info['total'], 2), 'locale' => $locale, 'google' => $google, 'apple' => $applePay, 'creditCards' => $creditCards, ]); // to: $calculatedTotal = $order_total_modules->pre_confirmation_check(true); $values = json_encode([ 'orderInfo' => $order->info, 'orderBilling' => $order->billing, 'orderCustomer' => $order->customer, 'appId' => MODULE_PAYMENT_SQ_WEBPAY_APPLICATION_ID, 'locationId' => $square_webPay->getLocationDetails()->getId(), 'handler' => DIR_WS_HTTPS_CATALOG . 'squareWebPay_handler.php', 'textTotal' => TEXT_YOUR_TOTAL ?? 'Total:', 'orderTotal' => zen_round($calculatedTotal, 2), 'locale' => $locale, 'google' => $google, 'apple' => $applePay, 'creditCards' => $creditCards, ]); // on line 157 (now line 158... or thereabouts), from: async function verifyBuyer(payments, token) { const verificationDetails = { amount: squareOrderValues.orderInfo.total.toFixed(2), //to: async function verifyBuyer(payments, token) { const verificationDetails = { amount: squareOrderValues.orderTotal.toFixed(2),
please let us know how that goes!
best.


Reply With Quote
