I'd like more languages, and I'd like the good old Canadian Loonie to come first. This looks like the required change based on the other examples I've seen on paypal. However, been a while since I played with their interface.
Would be nice if there were a list of all of Paypal's supported currencies here.
function simple_paypal_get_currencies() {
return array(
'CAD' => t('Canadian Dollar'),
'EUR' => t('Euro'),
'USD' => t('American Dollar'),
);
}
Think the list of currencies that are relevant here are:
https://www.paypal.com/cgi-bin/webscr?cmd=p/sell/mc/mc_intro-outside
Thanks again for developing this.. One more useful app by the good folks at 2bits..
Comments
Comment #1
mgiffordI got a list off paypal and incorporated it in this patch. It's pretty trivial, but works.
Comment #2
kbahey commentedFirst, an error:
Second, I am not sure if just displaying $ in front of all "dollars" would be confusing. For example, a site that accepts Canadian and US dollars can be quite misleading if it does not distinguish between different currencies.
Comment #3
kbahey commentedAlso, it would be best if we made the currencies configurable, e.g. a list of them on an admin page with checkboxes, so a site that does not accept all these currencies need not have them all display (e.g. on the drupal association web site, we only accept Euro and US Dollar, no need for the extra noise).
Comment #4
mgiffordOk, here's another attempt. Hopefully you can view the patch. It was created with:
diff -Naur /var/www/drupalContribs/modules/simple_paypal/simple_paypal.module Desktop/simple_paypal.module > Desktop/simple_paypal.module2.patch
For the dollars & Kroners I've appended the country code. I do agree that it would be a bit confusing without that. I also added other currencies so that it was more global. I was mostly doing this to follow the example that you had set with the USD & Euro. Seemed to make sense to me to just follow that course. Think I got the currencies right (though finding a list of utf8 currency characters was harder than I had thought.
As far as the configuration, I left that in the donations module. I don't know how to use this as a stand alone module so assumed the configuration of what currencies you would accept would be done somewhere else. Those were part of my changes to the donation module.
simple_paypal_get_currencies() should be all supported paypal currencies as far as I am concerned.
simple_paypal_format_amount() should just respond to the selected currency.
Can simple_paypal just be run on it's own? Is it better to have the list of supported currency in this module vs the public facing one (like donation). What other modules do you see interfacing with the simple paypal module?
Anyways, think we're getting somewhere.
Comment #5
kbahey commentedThanks.
I committed it, and it should be in the -dev tarball by tomorrow.
Comment #6
mgiffordGreat. Would be nice to see more folks using this module.
Comment #7
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #8
venkat-rk commentedFollowing through from http://drupal.org/node/154841#comment-780541, it seems this got into the tarball. But, I am using 5.x-1.1, and I don't see configurable options for the currencies, just the drop-down with the two paypal urls at /admin/settings/paypal
Am I missing something?
Comment #9
kbahey commentedDid you try the version that this fix went into? 5.x-1.x-dev.
Please try that and report back.
Comment #10
venkat-rk commentedI used 5.x-1.1. Shall try the dev version and report back.
Comment #11
venkat-rk commentedOkay, I tried this out and saw that the ../admin/settings/paypal page still showed just a drop-down with the two paypal urls.
I agree with kbahey's comment above that the currencies should be configurable through an admin page for this module - it makes a lot more sense to let this module handle all the paypal related configuration.
mgifford, do you think there is merit in this logic?
Comment #12
mgiffordWould be fine with me if it were just a config option. I figured that in proposing this I'd just use the ones that Paypal supported. That list is likely to change though.. I was mostly looking to add some more flexibility to what was already there.
Comment #13
venkat-rk commentedthank you, mgifford. I will try to get someone to roll out a patch that will make the currencies configurable through an admin page with checkboxes, as kbahey suggested. I agree that we should probably stick to the ones supported by paypal as this module interfaces with the paypal system, after all. No need to clutter the module with all the currencies in the world, I guess. :-)
As PayPal adds support for more currencies, it should be easy to roll patches to the module that will add support for that currency(ies).