WordPress.org

Ready to get started?Download WordPress

Forums

WooCommerce Custom Currencies
Paypal Payment error: Currencies do not match (14 posts)

  1. WebCrusader
    Member
    Posted 10 months ago #

    WooCommerce Custom Currencies 1.4.1
    WooCommerce 2.1.6

    This shows in paypal logs. I have set currency that replaces existing currency in WooCommerce, but I have set conversion rate to EUR so I can use it for PayPal.

    I have tried enabling "Convert order total" option, but it double converts the amount for PayPal (bug ?) and the "Payment error: Currencies do not match" still occurs.

    https://wordpress.org/plugins/woocommerce-custom-currencies/

  2. GalalAly
    Member
    Plugin Author

    Posted 10 months ago #

    Hello,

    Thank you for your detailed instructions.

    I haven't tested the plugin with WC 2.1.x yet. I will issue an update as soon as I can.

    Sorry for the inconvenience.

  3. GalalAly
    Member
    Plugin Author

    Posted 10 months ago #

    Hello,

    I've just tested the plugin with WP3.8 and WC2.1.7 and it's working fine with the default Paypal payment gateway.

  4. joydipdas
    Member
    Posted 10 months ago #

    What it does.

    Say I have base currency in USD and if I want to convert it to GBP, it will do that conversion. Plus will paypal accept GBP instead of base currency USD.

    Using WP 3.9
    Woocommerce 2.1.8

  5. GalalAly
    Member
    Plugin Author

    Posted 10 months ago #

    If the currency that you're using as a base currency is already supported by PayPal the plugin will not function the way it's intended with the non-supported paypal currencies.

    So if you have USD as your base currency (supported by PayPal) and want to convert it to GBP for PayPal, it won't work as intended.

  6. JoshKay
    Member
    Posted 9 months ago #

    Any advice on how one can overcome that 'Currencies do not match' error?

    I don't see a hook to edit the currency or amount on an outgoing order to PayPal, which updates the order. Theoretically you could edit the order before it goes out, no?

  7. GalalAly
    Member
    Plugin Author

    Posted 9 months ago #

    Hello,

    Do you have the same case mentioned above?

  8. JoshKay
    Member
    Posted 9 months ago #

    My case is VND->USD

    WooCommerce has VND built in, but it doesn't allow it with PayPal - it disables the gateway completely.

  9. GalalAly
    Member
    Plugin Author

    Posted 9 months ago #

    Hello,

    Please contact me contact@galalaly.me

    Please mention the versions of WooCommerce and WordPress that you're using and if possible, please provide an admin account.

  10. fractalmask
    Member
    Posted 5 months ago #

    Hi GalalAly,

    Your plugin is fantastic added stars in plugin review.

    hopefully we'll have some improvement.
    --
    Added currency : 'VND'
    the local payment gateway will accept it (requires plugin) and its good

    Wth Paypal
    VND is changed to USD, paypal transaction completes successfully but WC updates status as

    'on-hold', 'Validation error: PayPal currencies do not match (code %s).'

    WC Log shows this

    Payment error: Currencies do not match (sent "VND" | returned "USD")

    WC thinks it had actually sent VND and got USD in return.
    Is WC aware that 'VND' was converted to 'USD' ?

  11. fractalmask
    Member
    Posted 5 months ago #

    WC checks things here

    woocommerce/includes/gateways/paypal/class-wc-gateway-paypal.php line:786

    // Validate currency
    if ( $order->get_order_currency() != $posted['mc_currency'] ) {
        if ( 'yes' == $this->debug ) {
            $this->log->add( 'paypal', 'Payment error: Currencies do not match (sent "' . $order->get_order_currency() . '" | returned "' . $posted['mc_currency'] . '")' );
        }
    
        // Put this order on-hold for manual checking
        $order->update_status( 'on-hold', sprintf( __( 'Validation error: PayPal currencies do not match (code %s).', 'woocommerce' ), $posted['mc_currency'] ) );
        exit;
    }
  12. fractalmask
    Member
    Posted 5 months ago #

    I need something like :

    if  $order->get_order_currency() is-not-equals-to $posted['mc_currency']
    
      then check 
    
            if the $posted['amt'] value returned by paypal is-equals-to ( value of product x conversion rate )
    
               tell woocommerce order that this is ok to have $order->update_status is everything fine
  13. fractalmask
    Member
    Posted 5 months ago #

    maybe something like this

    add_filter (‘woocommerce_payment_complete_order_status’, ‘my_change_status_function’);
    
    function my_change_status_function ($order_id) {
    $order = new WC_Order($order_id);
    //Do whatever additional logic you like before….
    return ‘completed';
    }

    reference : http://chrislema.com/automating-woocommerce-order-status-changes/

  14. fractalmask
    Member
    Posted 5 months ago #

    GalalAly, I've sent you a file .. please check it.

Reply

You must log in to post.

About this Plugin

About this Topic