VirtueMart Forum

VirtueMart Dev/Coding Central: VM1 (old version) => Development Projects, Modifications, Hacks & Tweaks. VM1.1 => Payment Modules => Topic started by: deneb on May 03, 2006, 05:18:33 am

Title: [PAYMENT METHOD] PAYPAL - Currency Converter by Deneb
Post by: deneb on May 03, 2006, 05:18:33 am
a client needed a way to convert the currency of cart amounts, to those supported by PayPal.
This needed to occur prior to sending the customer over to PayPal to make the payment.

THIS IS AN ENHANCED VERSION OF THE STOCK CODE RELEASED IN VirtueMart 1.0.4

DO YOU NEED THIS?
--------------------------------
If you use a shop currency that is not one of these:
U.S. Dollar (USD)
Australian Dollar (AUD)
Canadian Dollar (CAD)
British Pounds Sterling (GBP)
Japanese Yen (JPY)
Euro (EUR)

...AND you wish to accept PayPal payments.
...BUT you can install this anyway and just disable it from the config.
...OR Dev Team can merge this into the next release.
--------------------------------

This payment Method:
->Converts the cart Total Amount and Shipping charges to one of the supported currencies that PayPal allows.
  TIP: The allowed currencies are viewable in your PayPal account, under 'Profile' > Financial Information - 'Currency Balances' links.
  TIP: For more payment receiving options related to currency, See 'Profile' > Selling Preferences - 'Payment Receiving Preferences' (make sure you are not blocking payments that you do not want blocked!)

->Shows a warning to the customer that the currency will be different in PayPal.(configurable!)

->Updates the payment variables sent to PayPal (Post Variables) with the new values. (Or in the case of customer viewing the order from 'Account Maintenance'...it formats the PayPal button correctly.

->Adds DEBUG output, which shows troubleshooting hints, conversion details, and PayPal post variables. (visible when VM DEBUG is turned on.)

->Adds PayPal config option to:
  => Enable/Disable the converter
  => Set the supported PayPal currencies
  => Select the PayPal currency to use.
  => Enable/Disable a currency convert warning on Order View
  => Set the Pre text on the warning (HTML OK)
  => Set the Post text on the warning (HTML OK)

One thing to think about...
The current functionality of VM allows customers to checkout with PayPal payment selected, and not immediately fulfill payment.
Also, the currency converter is pulled from daily exchage rates and converts using those rates on the fly.
...The PayPal button on the order.
...Exchange Rates change.
So, an order where the PayPal payment is still 'pending' (whether marked as such or not) could be converted later at a
substantially different rate than when purchsed. This may / may not be advantagous / disadvantagous to the vendor / customer.
--------------------------------

Install Steps:

1. First, back-up some files:
  a. PayPal class files
    ->folder: /administrator/components/com_virtuemart/classes/payment/
    ->file: ps_paypal.php
    ->file: ps_paypal.cfg.php
  b. Language file
    ->folder: /administrator/components/com_virtuemart/languages/
    ->file: english.php
2. Figure out if you have any hacks currently applied to your PayPal files.
   You may or may not need to merge them into the code supplied with this hack.
3. Back-up your PayPal - 'Payment Extra Info'
  ->Login to Joomla admin and go to the VirtueMart admin.
  ->Select 'Store' > 'List Payment Methods' menu item,
  ->Find PayPal method on the list and click it's name to Edit.
  ->Go to 'Configuration' tab
  ->Copy all text in the 'Payment Extra Info' textbox at the bottom.
  ->Paste it into a text editor and save it somewhere local.
4. Figure out if you have any hacks currently applied to your PayPal 'Payment Extra Info' code.
   You may or may not need to merge them into the code supplied with this hack.
5. Edit your Language file and add the language nuggets from the file supplied in this attached archive (english_paypal_currency.txt)
6. Upload the class files (ps_paypal.php, ps_paypal.cfg.php) to folder: /administrator/components/com_virtuemart/classes/payment/
7. Configure your new PayPal method, and 'Payment Extra Info'
  ->Login to Joomla admin and go to the VirtueMart admin.
  ->Select 'Store' > 'List Payment Methods' menu item.
  ->Find PayPal on the list and click name to Edit.
  ->Go to 'Configuration' tab.
  ->Re-enter your old settings (look in your backed-up config file), and Choose the new settings you want for currency converter section.
  ->Copy all text from the file supplied in this attached archive (paypal_PEI_currency.txt)
    and Paste it into the 'Payment Extra Info' textbox at the bottom.
  ->Click the SAVE button.
8. Test it.


[attachment cleanup by admin]
Title: Re: [PAYMENT METHOD] PAYPAL - Currency Converter by Deneb
Post by: alexlancaster on May 17, 2006, 18:38:21 pm
Hey, just made the changes, however, I'm getting an error message:

Warning: fopen(.../administrator/components/com_virtuemart/classes/payment/ps_paypal.cfg.php): failed to open stream: Permission denied in .../administrator/components/com_virtuemart/classes/payment/ps_paypal.php on line 266

Any ideas???
Title: Re: [PAYMENT METHOD] PAYPAL - Currency Converter by Deneb
Post by: alexlancaster on May 17, 2006, 19:31:49 pm
Ok, that was a CHMOD issue, got it solved. Now I seem to have a more serious problem, my customers are getting:

Fatal error: Call to a member function on a non-object in .../administrator/components/com_virtuemart/classes/currency_convert.php on line 59

When they try to complete and order.

Heeelp!
Title: Re: [PAYMENT METHOD] PAYPAL - Currency Converter b
Post by: deneb on May 17, 2006, 22:01:09 pm
Quote
Fatal error: Call to a member function on a non-object in .../administrator/components/com_virtuemart/classes/currency_convert.php on line 59

SOLUTION: You need to ensure that your Joomla/Mambo folder /media is writable. (Or, if using Joomla caching...make that cache folder writable, defined by $mosConfig_cachepath)

This error is displayed due to a minor flaw in the code in currency_convert.php...I think it is choking on the vmLogger function (used for displaying errors) so you don't get the real error.
BUT...the real problem you have is explained in above Solution.

To fix the minor flaw: (make $vmLogger global in the function: convertECB)
Backup this file:
/administrator/components/com_virtuemart/classes/currency_convert.php
Then, open that file for edit.

Change line 21 from:
Code: [Select]
global $mosConfig_cachepath, $mosConfig_live_site, $mosConfig_absolute_path;
to:
Code: [Select]
global $mosConfig_cachepath, $mosConfig_live_site, $mosConfig_absolute_path, $vmLogger;
Now you will see the reason for the currency conversion failure:
Go thru Checkout and select PayPal payment. You should see an error about how your folder is not writable, so it could not store the daily currency exchange rate file to your server folder mentioned above.

let us know... 8)
Title: Re: [PAYMENT METHOD] PAYPAL - Currency Converter by Deneb
Post by: alexlancaster on May 18, 2006, 17:46:05 pm
Hi! Thanks for the quick response...

 I made the changes you suggested and I stopped getting the error message. I checked the /media folder and found the daily.xml file.
At checkout, users are once again being sent to PayPal. However, the currency isn't getting converted. Needless to say that the curreny converter is enabled ;)
My store currency is MXP (Mexican Peso) and I want users to pay in USD. I tried changing my store currency to USD and PayPal to EUR, viceversa, and still didn't get conversion.
Title: Re: [PAYMENT METHOD] PAYPAL - Currency Converter by Deneb
Post by: bilba on June 09, 2006, 14:29:33 pm
Thank you very much for this add-on.. I works like a charm!!
Title: Re: [PAYMENT METHOD] PAYPAL - Currency Converter by Deneb
Post by: Boet van Tonder on July 24, 2006, 23:05:19 pm
Everything works it goes to paypal but the currency conversion does not take place giving me the following error on Paypal site:

"This recipient does not accept payments denominated in ZAR. Please contact the seller and ask him to update his payment receiving preferences to accept this currency."

Everything looks right in the setup and Enable currensy converter is set to "Yes"

Please help This is just what I need.

Title: Re: [PAYMENT METHOD] PAYPAL - Currency Converter b
Post by: RaXa on October 25, 2006, 05:09:56 am
Everything works it goes to paypal but the currency conversion does not take place giving me the following error on Paypal site:

"This recipient does not accept payments denominated in ZAR. Please contact the seller and ask him to update his payment receiving preferences to accept this currency."

Everything looks right in the setup and Enable currensy converter is set to "Yes"

Please help This is just what I need.



I have the same problem, I use Mexican pesos, everything is configured right but when checkout is complete, no warning about the currency convert or in fact the currency convert is not working, anyone who can help me ? thanks a lot
Title: Re: [PAYMENT METHOD] PAYPAL - Currency Converter by Deneb
Post by: deneb on October 25, 2006, 08:11:57 am
Turn on VirtueMart DEBUG and you will see why the currency convert failed.

most likely your daily.xml file is corrupt or missing (file with exchange rates)

see above reply #3 (http://virtuemart.net/index.php?option=com_smf&Itemid=71&topic=17979.msg43329#msg43329) for additional tips
Title: Re: [PAYMENT METHOD] PAYPAL - Currency Converter b
Post by: RaXa on October 25, 2006, 08:16:18 am
Turn on VirtueMart DEBUG and you will see why the currency convert failed.

most likely your daily.xml file is corrupt or missing (file with exchange rates)

see above reply #3 (http://virtuemart.net/index.php?option=com_smf&Itemid=71&topic=17979.msg43329#msg43329) for additional tips
Ok, but how i make the daily.xml or where i can get it, Thanl you
Title: Re: [PAYMENT METHOD] PAYPAL - Currency Converter by Deneb
Post by: RaXa on November 14, 2006, 05:56:15 am
Ok the link to download the list doesn´t work, the currency list don´t have mexican pesos, so I dont know how to make this to work, my head is about to explode.
Title: Re: [PAYMENT METHOD] PAYPAL - Currency Converter by Deneb
Post by: shurka on November 17, 2006, 18:55:16 pm
Hi deneb, nice converter, I just noticed that conversion failing when you switching to Checkout Process 4, what is the issue? I turned on debug but cant find error log, where should it be?
Title: Re: [PAYMENT METHOD] PAYPAL - Currency Converter by Deneb
Post by: shurka on November 17, 2006, 21:17:38 pm
One more, the error accures when I set option with zero cost on delivering (such a downloadable goods), so it might be issue of operation with "0". So, try invistigate the formula.
Title: Re: [PAYMENT METHOD] PAYPAL - Currency Converter b
Post by: Esteban on January 25, 2007, 22:08:18 pm
this still apply for VirtueMart 1.0.9?
Title: Re: [PAYMENT METHOD] PAYPAL - Currency Converter b
Post by: sungoddess on August 17, 2007, 20:53:01 pm
I have installed these files, and made the changes and I am STILL getting:

Return to Merchant

This recipient does not accept payments denominated in USD. Please contact the seller and ask him to update his payment receiving preferences to accept this currency.

-----

I am at my wits end!
Title: Re: [PAYMENT METHOD] PAYPAL - Currency Converter by Deneb
Post by: Francis Yap on December 12, 2007, 05:48:54 am
I need this modification make on my site also, I receive the same massage from PayPal

Quote
This recipient does not accept payments denominated in USD. Please contact the seller and ask him to update his payment receiving preferences to accept this currency.

I also do all the possible check and find out I dun have

Quote
daily currency exchange rate file

as deneb mention in  Reply #3 on:, can anyone give me guide how to generate this file.

Many thanks.
Title: Re: [PAYMENT METHOD] PAYPAL - Currency Converter by Deneb
Post by: Francis Yap on December 18, 2007, 09:46:38 am
anyone can lend me a hand?
Title: Re: [PAYMENT METHOD] PAYPAL - Currency Converter by Deneb
Post by: Francis Yap on January 08, 2008, 03:49:44 am
I need someone give me a hint how to do, please ...
Title: Re: [PAYMENT METHOD] PAYPAL - Currency Converter by Deneb
Post by: MoonWizard on March 16, 2008, 16:53:31 pm
Hello everybody!

I am making a virtuemart shop for Mexico... obviously PayPal doesn't still accept Mexican Peso and it is supposed that with this solution the currency will be converted to USD, isn't it?

Is this solution compatible with the latest release 1.0.15?

Best regards!
Title: Re: [PAYMENT METHOD] PAYPAL - Currency Converter by Deneb
Post by: MoonWizard on March 16, 2008, 17:49:58 pm
A pity....

Followed all instructions exactly and

Quote
This recipient does not accept payments denominated in USD. Please contact the seller and ask him to update his payment receiving preferences to accept this currency.

It is a pity that we can't use paypal in countries that their currencies are not allowed in Paypal.

Thanks deneb for your work. I'm always wondering why PayPal always make things so complicated.

A pity...
Title: Re: [PAYMENT METHOD] PAYPAL - Currency Converter by Deneb
Post by: gaswaru on April 07, 2008, 19:32:12 pm
Hi,
I'm totally new to this and drowning in this too...  :-[

I am developing the a site that use Malaysian Ringgit as default currency and need to be process in SGD in Paypal.

I have try using the package mention at the start of the thread but still no luck....

hope some one can help me... many many thanks!!
Title: Re: [PAYMENT METHOD] PAYPAL - Currency Converter by Deneb
Post by: gaswaru on April 10, 2008, 15:48:07 pm
any help please please....

Hi,
I'm totally new to this and drowning in this too...  :-[
I am developing the a site that use Malaysian Ringgit as default currency and need to be process in SGD in Paypal.
I have try using the package mention at the start of the thread but still no luck....
hope some one can help me... many many thanks!!
Title: Re: [PAYMENT METHOD] PAYPAL - Currency Converter by Deneb
Post by: thoman on April 20, 2008, 19:51:51 pm
I been trying out this hack and its not really working with our MYR Malaysian Ringgit, I cannot think of any other problem. I did change with other currency and it working $paypal_currencies =
array("USD","CAD","AUD","EUR","GBP","JPY");

Anyone got a solution to my problem....

Have a nice day...
Title: Re: [PAYMENT METHOD] PAYPAL - Currency Converter by Deneb
Post by: popobot on June 18, 2008, 02:21:00 am
Hi,

Will this work with Virtuemart 1.1? Please help. Thanks in advance.


Title: Re: [PAYMENT METHOD] PAYPAL - Currency Converter by Deneb
Post by: MoonWizard on July 02, 2008, 23:34:37 pm
Any updates on this module? Will be nice... :)
Title: Re: [PAYMENT METHOD] PAYPAL - Currency Converter by Deneb
Post by: yakusza on December 20, 2008, 15:27:43 pm
Hi

After doin some testing..i found out that, the currency conversion by deneb is only works on VM 1.0-1.0.13a only,it will not works on VM 1.0.15 and VM1.1..

I've tested is in VM1.0.13a and works right a way..but when use it on VM 1.0.15,it will show the error as others recieved.. compatible issue myb ,mr deneb?

my 2cent.
Title: Re: [PAYMENT METHOD] PAYPAL - Currency Converter by Deneb
Post by: maheshasher on January 05, 2009, 08:44:13 am
hi!
I have got a work around for this problem. All I had done is added a code provided by http://www.yourcurrencyconverter.com for virtuemart. Now since paypal does not accept Indian Rupees from a buyer, you can select your default currency as US Dollar and List of accepted currencies as US Dollar for your shop. While adding prices for the products convert the price of the product to US dollar and put it in dollars. Add this magical code provided by http://yourcurrencyconvertor.com as directed by them in their user manual for virtuemart. Thats it! the prices of the product gets displayed in both US Dollars and Indian Rupees and also you can receive the payment in US dollars at the same time maintaining the transparency between the US dollars and Indian Rupees conversion to Indian customers.
The only Problem I felt in the above process is, I have to update the prices of my products if the the dollar rate changes frequently (but it is ok, it does not make much difference) so now no more errors

"This recipient does not accept payments denominated in USD. Please contact the seller and ask him to update his payment receiving preferences to accept this currency"

Thank you Virtuemart and Joomla! the future of ecommerce...Hats off

You can view my site on http://veditsolutions.com

Please feel free to write to me at mahesh.asher@gmail.com
Title: Re: [PAYMENT METHOD] PAYPAL - Currency Converter by Deneb
Post by: weeonesbyjajoc on January 07, 2009, 18:56:55 pm
hi!
I have got a work around for this problem. All I had done is added a code provided by http://www.yourcurrencyconverter.com for virtuemart. Now since paypal does not accept Indian Rupees from a buyer, you can select your default currency as US Dollar and List of accepted currencies as US Dollar for your shop. While adding prices for the products convert the price of the product to US dollar and put it in dollars. Add this magical code provided by http://yourcurrencyconvertor.com as directed by them in their user manual for virtuemart. Thats it! the prices of the product gets displayed in both US Dollars and Indian Rupees and also you can receive the payment in US dollars at the same time maintaining the transparency between the US dollars and Indian Rupees conversion to Indian customers.
The only Problem I felt in the above process is, I have to update the prices of my products if the the dollar rate changes frequently (but it is ok, it does not make much difference) so now no more errors
"This recipient does not accept payments denominated in USD. Please contact the seller and ask him to update his payment receiving preferences to accept this currency"
Thank you Virtuemart and Joomla! the future of ecommerce...Hats off
You can view my site on http://veditsolutions.com
Please feel free to write to me at mahesh.asher@gmail.com

So by using the method you did now you've lost your automatic currency converter is my thinking correct?
Title: Re: [PAYMENT METHOD] PAYPAL - Currency Converter by Deneb
Post by: w259lkt on February 03, 2009, 14:20:51 pm
I just modded deneb converter for Virtuemart 1.1.x.
check this post: http://forum.virtuemart.net/index.php?topic=51168.0
Title: Re: [PAYMENT METHOD] PAYPAL - Currency Converter by Deneb
Post by: sundar on April 11, 2009, 15:39:03 pm
@mahesh this one is interest but we have to add daily manually for all products tats not possible
Title: Re: [PAYMENT METHOD] PAYPAL - Currency Converter by Deneb
Post by: Uriel on May 04, 2010, 19:39:42 pm
I also get the same old message - nothing is getting converted.

Virtuemart 1.1.4
Joomla 1.5

currency_convert.php is missing - where do I find this file ?
Title: Re: [PAYMENT METHOD] PAYPAL - Currency Converter by Deneb
Post by: chakstor on March 03, 2011, 06:39:51 am
Ok guys I found a solution that works like a charm for me.

First of all, the Currency Converter by Deneb worked really nice for me. But then i found a problem with the currency convertion.

Here is my thing:

1. As Paypal doesn't accept DOP (Dominican Peso), I decided that I wanted to keep DOP in my site as my Normal Currency, while (in a magical, mysterious way :P) VM makes the convertion from DOP to USD when I get to the paypal screen. Because, as I said PayPal doesn't accept my local currency.

2. Using convertECB wasn't suitable for me since the convertion it makes is based on EUR, and not DOP, which is my case.

If this is your case, or you are using a currency that is not supported by paypal, keep reading your case is just as mine.


SOLUTION

1. Go up to the top of the post and follow the Currency Converter by Deneb's guide.
2. Install the Oanda Currency Converter, here is the link to the module: http://extensions.virtuemart.net/index.php?option=com_sobi2&sobi2Task=sobi2Details&catid=6&sobi2Id=94&Itemid=2
3. In the VM Administration page under Admin/Config/Core Settings change "Select a currency converter module" from convertECB to convertOANDA.
4. Under Store/List Payment Methods select PayPal (more specifically im using paypal (legacy), but that just the default name). In the configuration tab, in Payment Extra Info, just change all convertECB to convertOANDA.

And voilà! There you go.
You have a VM store which display the prices in your local currency, and make the right convertion to USD.

NOTE: If you wanna check if OANDA's Convertion is suitable for you, you can check this website: http://www.oanda.com/lang/es/currency/converter/

Sorry for my poor english ;)
Title: Re: [PAYMENT METHOD] PAYPAL - Currency Converter by Deneb
Post by: pingry on May 17, 2011, 13:46:22 pm
I'm using Virtuemart 1.1.8 with Deneb's mod modified (traznet_paypall) and it wasn´t working...but finally I found out it was because shipping was cero $! Now everything works perfect for me : )
Title: Re: [PAYMENT METHOD] PAYPAL - Currency Converter by Deneb
Post by: chucurulo on June 10, 2011, 06:51:00 am
de soja pana de republica dominicana y Tengo El Mismo Problema Que Tu Lo de la ESA la conversión de un dolar no entendi Muy bien "-la ultima instancia de parte en convertECB Por sustituir a convertOANDA ya Que No vi nada de ESO por ahi.
Title: Re: [PAYMENT METHOD] PAYPAL - Currency Converter by Deneb
Post by: chucurulo on June 11, 2011, 18:51:45 pm
Greetings friend

can someone explain a little this step is not understood very well that file specifically is that going to change because there are several in lenguje of virtuemart
is the next step;

5. Edit your language file and add the language from the file nuggets Supplies in this attached archive (english_paypal_currency.txt)
Title: Re: [PAYMENT METHOD] PAYPAL - Currency Converter by Deneb
Post by: alicheva on August 19, 2011, 15:28:00 pm
yes, can someone, please, specify which english.php file because I have put it in checkout.php and the code isn't working for me....
Title: Re: [PAYMENT METHOD] PAYPAL - Currency Converter by Deneb
Post by: jameel on September 15, 2011, 16:57:13 pm
you need to convert ZAR or any paypal unsupported currency into paypal supported currency. here is one module that does all for you and you can set any currency from the list of 98 and set to any one supported by paypal.

http://www.itechshop.org/index.php?option=com_virtuemart&page=shop.product_details&flypage=flypage.tpl&product_id=19&vmcchk=1&Itemid=7

this module uses Google finance to converted paypal unsupported currencies into paypal supported
Title: Re: [PAYMENT METHOD] PAYPAL - Currency Converter by Deneb
Post by: chucurulo on November 19, 2011, 05:08:39 am
Greetings friends,

I use the manual deneb for DOP currency coverter dominiana U.S. republic, and it worked perfectly the convercion physical products, but the conversion does not work when the product is downloadable. to be any extra settings should do???
Title: Re: [PAYMENT METHOD] PAYPAL - Currency Converter by Deneb
Post by: chocolatepudding on December 16, 2011, 20:09:55 pm
Hello folks,

I need to download the module as I have 2 payment gateways, and Paypal does not accept ZAR while the other only accepts ZAR. When I try to download the zip file on the first post of this topic, I get a php file call "index" and it's less than 1kb in size. I've tried searching online for the zip file with no avail. May someone please assist??

Thank you.

UPDATE:

2 mins after posting this, I found the zip file online on the virtuemart forum but it looks different to this one, though it's the same forum, same posts and users... very strange.

Oh, it's the archive!!

here's the link: http://forum.virtuemart.net/archive/index.php?topic=17979.0
Title: Re: [PAYMENT METHOD] PAYPAL - Currency Converter by Deneb
Post by: chocolatepudding on December 16, 2011, 22:00:32 pm
Hello,

Where in english.php am I supposed to add the info in the zip file from deneb? I had to reload my backup file as after I added that text, my site did not show at all..

Thanks.
Title: Re: [PAYMENT METHOD] PAYPAL - Currency Converter by Deneb
Post by: jameel on May 19, 2012, 17:01:23 pm
Hello,

Where in english.php am I supposed to add the info in the zip file from deneb? I had to reload my backup file as after I added that text, my site did not show at all..

Thanks.
you can modules by itechshop.org and you don't need to do any thing manually and this module with convert ZAR into USD with latest rates by google finance