"This recipient does not accept payments denominated in"
« on: February 18, 2018, 11:22:18 AM »
Hello,

Paypal support just the listed currencies below:

https://www.paypal.com/bg/cgi-bin/webscr?cmd=p/sell/mc/mc_receive-outside

If we like to use any other currency not in this list, we have to modify the plugin to perform an automated conversion from unsupported to a supported currency while creating a request to paypal ( after clicking the paypal button). The idea is that the unsupported currency ( BGN ) should be visible to users for all products as long as they click the paypal button.

Any idea how to achieve that ?



As I can see there is a $free variable in osp_get_fee() function which might have something to do with the currency conversion in question:

$fee = round(osp_convert($item['i_price']/1000000, $item['fk_c_currency_code']), 2);


What if I hardcode the 'EUR' currency at the place of $item['fk_c_currency_code'] ?


Thanks!
« Last Edit: March 09, 2018, 09:13:35 AM by Lyubomir Minchev »

*

MB Themes

Re: "This recipient does not accept payments denominated in"
« Reply #1 on: February 18, 2018, 11:40:27 AM »
Conversion works for item price only, however plugin must operate in supported currency
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

Marked as best answer by frosticek on March 09, 2018, 10:53:37 AM
Re: "This recipient does not accept payments denominated in"
« Reply #2 on: March 09, 2018, 09:09:20 AM »
I've done it!

I had to force amount and currency conversion. Here is how I've put the amount multiplied by the paypal currency rate  0.487806182.

Code: [Select]

public static function button($amount = '0.00', $description = '', $itemnumber = '', $extra_array = null) {
      if($amount > 0) {
        if(osp_param('paypal_standard') == 1) {
          $amount = strval(intval($amount) * 0.487806182);
          self::standardButton($amount, $description, $itemnumber, $extra_array);
        } else {
          self::dgButton($amount, $description, $itemnumber, $extra_array);
        }
      }
    }

I know it would be better to set it dynamically, but that should be fine for BGN to EUR conversion, since the rate stays almost like a constant.

Then, inside of "public static function standardButton" I have hardcoded the currency to be 'EUR'.

Code: [Select]
<!-- <input type="hidden" name="currency_code" value="<?php echo osc_esc_html(osp_currency()); ?>" /> -->
<input type="hidden" name="currency_code" value="<?php echo osc_esc_html("EUR"); ?>" />

In this way all the prices on website are listed in BGN, and on paypal button click they are automatically being converted and sent in "EUR".
This is how all unsupported countries/currencies have to deal with paypal.

I hope this would help someone, who has stuck on this step.
« Last Edit: March 09, 2018, 09:15:48 AM by Lyubomir Minchev »