Lien du plugin : https://woocommerce.com/products/intuit-qbms/
Résolu par : https://wordpress.org/support/topic/intuit-paymentsqbms-gateway-support/
Problème : J'utilise plusieurs passerelles de paiement comme PayPal. Je veux permettre aux clients de payer en CAD ou USD comme ils le souhaitent, mais la passerelle Intuit Payments/QBMS ne facture qu'en USD.
Ajoutez le code suivant au fichier functions.php du thème WP actuel :
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;
}
Cela convertira le total en USD avant de l'envoyer à la passerelle Intuit Payments/QBMS.