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
QuoteFatal 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:
global $mosConfig_cachepath, $mosConfig_live_site, $mosConfig_absolute_path;

to:
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
Quote from: 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.



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 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 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: 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....

Quote from: 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: 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: 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
Quote from: 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

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: 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: 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: jameel on May 19, 2012, 17:01:23 PM
Quote from: 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.
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