[MarketPress eCommerce] MarketPress PayPal currency

Hello,
We have setup Stripe and PayPal as payment methods for our site in combination with Appointment+. While the Stripe handles the payments with our local currency (BGN), PayPal makes the charge in EUR. This means that if in the Appointment+ we set a price of 30, stripe will charge 30 BGN while PayPal would charge 30 EUR which equals to 60 BGN. You can see how this would be an issue for our clients that choose to pay with PayPal. Please help us solve this issue.

  • Dimitris

    Hello there goinfancy,

    hope you're doing good and thanks for reaching us! :slight_smile:

    It seems that PayPal doesn't support Bulgarian Lev for receiving money.
    https://www.paypal.com/bg/cgi-bin/webscr?cmd=p/sell/mc/mc_receive-outside

    You could surpass this with some custom coding, by converting Euros to Bulgarian Levs, even though this may need constant "care", in order to set the conversation rate daily.
    As this is surpassing the scope of our support, you should hire a developer to custom code this for you.
    https://premium.wpmudev.org/docs/getting-started/getting-support/#chapter-1
    If you select to go this way and more info is required by developer about proper hooks/filters in MarketPress, please do respond back here and we can escalate to our developers and get this info for you.

    Hope that was some help!
    Warm regards,
    Dimitris

  • Panos

    Hi goinfancy ,

    I tried the following snippet which seems to be changing and converting to EUR currency:

    add_filter( 'mp_setting_gatewayspaypal_expresscurrency', function( $currency ){
    	if (
    		( isset( $_REQUEST['action'] ) && 'mp_update_checkout_data' == $_REQUEST['action'] ) ||
    		( ! isset( $_REQUEST['payment_method'] ) || 'paypal_express' != $_REQUEST['payment_method'] )
    	 ) {
    		return $currency;
    	}
    	$currency = 'EUR';
    	return $currency;
    }, 20 );
    
    add_filter( 'mp_product/get_price', function( $price, $product ){
    
    	if (
    		( isset( $_REQUEST['action'] ) && 'mp_update_checkout_data' == $_REQUEST['action'] ) ||
    		( ! isset( $_REQUEST['payment_method'] ) || 'paypal_express' != $_REQUEST['payment_method'] )
    	 ) {
    		return $price;
    	}
    
    	$from_rate = 1; // 1 BGN
    	$to_rate = 0.51; // 1 BGN = 0.51 EUR
    
    	if ( isset( $price['regular'] ) ){
    		$price['regular'] = wpmudev_mp_simle_currency_converter( $price['regular'], $from_rate, $to_rate );
    	}
    
    	if ( isset( $price['lowest'] ) ){
    		$price['lowest'] = wpmudev_mp_simle_currency_converter( $price['lowest'], $from_rate, $to_rate );
    	}
    
    	if ( isset( $price['highest'] ) ){
    		$price['highest'] = wpmudev_mp_simle_currency_converter( $price['highest'], $from_rate, $to_rate );
    	}
    
    	if ( isset( $price['sale']['amount'] ) ){
    		$price['sale']['amount'] = wpmudev_mp_simle_currency_converter( $price['sale']['amount'], $from_rate, $to_rate );
    	}
    
    	return $price;
    }, 20, 2 );
    
    function wpmudev_mp_simle_currency_converter( $amount, $from_rate = '', $to_rate = '', $decimals = 2 ) {
    	return ( number_format( ( $amount / $from_rate ) * $to_rate, $decimals ) );
    }

    You can add this snippet in a mu-plugin file. If you are not familiar with mu-plugins, you can read more about them here:
    https://premium.wpmudev.org/manuals/wpmu-manual-2/using-mu-plugins/

    You will probably need to change this line

    $to_rate = 0.51; // 1 BGN = 0.51 EUR

    and replace 0.51 with the actual current exchange rate. You will probably need to keep an eye on the exchange rates and update it regularly.

    Hope this helps :slight_smile:

    Kind regards!

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.