Plugin link: https://woocommerce.com/products/intuit-qbms/
Resolved by: https://wordpress.org/support/topic/intuit-paymentsqbms-gateway-support/
Trouble: I use multiple payment gateway like PayPal I want to allow customers to pay by CAD or USD as they want but Intuit Payments/QBMS Gateway only charge USD
Add next code to the functions.php file of the current wp theme:
1 2 3 4 5 6 7 8 9 10 11 12 | add_filter('wc_payment_gateway_intuit_qbms_get_order_base', 'intuit_qbms_return_currency_to_usd', 10, 1); function intuit_qbms_return_currency_to_usd($order) { global $WOOCS; if ($WOOCS) { $currencies = $WOOCS->get_currencies(); $current_currency = $WOOCS->current_currency; $usd_total = $WOOCS->back_convert($order->get_total(), $currencies[$current_currency]['rate'], 2); $order->payment_total = number_format($usd_total, 2, '.', ''); } return $order; } |
this will convert total to USD before send to Intuit Payments/QBMS Gateway.
