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]