• Resolved jemunozp

    (@jemunozp)


    Hi Oscar,

    My payment gateway is not making the transaction with the right currency.. for example I have a product with two prices: $20.000COP and $20USD (is not the same ammount) and even if user is making the purchase in USD currency and he is located in United States the payment gateway process the purchase in COP, in my example I only receive $20COP (this is nothing) when should be $20USD…
    The gateway do accepts payments in differents currencies including USD..

    I assume gateway plugin works with the default woocommerce currency (‘currency’ => get_option(‘woocommerce_currency’)…

    How can I change it to make it work correctly with your plugin?

    Your plugin store the price of product (either COP or USD) in any custom variable?

    I leave here some extract of payment gateway plugin code:

    $paymentData = array(
                'unsigned_field_names'	=> '',
                'transaction_type'	=> 'authorization',
                'payment_method' 	=> 'card',
                'transaction_uuid' 	=> uniqid( $order->order_key ),
                'signed_date_time' 	=> gmdate("Y-m-d\TH:i:s\Z", strtotime( $order->order_date )),
                'locale' 		=> $currentLanguage,
                'currency' 		=> get_option('woocommerce_currency'),
                'reference_number' 	=> $order->id,
                'amount' 		=> $order->order_total,
                'order_id' 		=> $order->order_key,
    	    'description'	=> trim($description, ', '),
                'bill_to_email'	=> $order->billing_email,
                'bill_to_surname'	=> $order->billing_last_name,
                'bill_to_forename'	=> $order->billing_first_name,
                'bill_to_address_city'	=> $order->billing_city,
                'bill_to_address_line1'	=> $order->billing_address_1,
                'bill_to_address_country'	=> $order->billing_country,
                'bill_to_address_postal_code'	=> $order->billing_postcode,
                'bill_to_phone' 	=> $order->billing_phone,
                'merchant_defined_data5' 	=> $order->order_tax,
            );

    Can you help to make it work ok?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Oscar Gare

    (@oscargare)

    Hi, You are right. The correct way is

    'currency' => $order->get_currency(),

    If you are using WC < 3.0 :

    'currency' => $order->get_order_currency(),

    Thread Starter jemunozp

    (@jemunozp)

    Thanks for the quickly response…

    I wrote to Payment gateway and they answered me.

    they ask me to change
    'currency' => get_option('woocommerce_currency'),
    for
    'currency' => get_woocommerce_currency(),

    What is the correct way?
    Yours –> 'currency' => $order->get_currency(),
    or them –> 'currency' => get_woocommerce_currency(),

    I suppose yours… right? I use Woocommerce 3.0.6

    Thanks in advance…

    • This reply was modified 7 years, 9 months ago by jemunozp.
    • This reply was modified 7 years, 9 months ago by jemunozp.
    Plugin Author Oscar Gare

    (@oscargare)

    Hi,
    get_woocommerce_currency() is better than get_option(‘woocommerce_currency’), but using $order->get_currency() you make sure that you are taking the correct currency for the order.

    Hi Oscar,

    Was thinking if you could make sure your plugin updates the get_woocommerce_currency() variable so that at checkout, whatever gateway is being used picks the correct price from that variable.

    Is that possible? I want to deploy this plugin for my site and I want to be sure how to anticipate this issue and how to get it fixed or avoided.

    Thanks.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Payment gateway using defalt woocommerce currency and not the order currency’ is closed to new replies.