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

mgifford’s picture

Status: Active » Needs review
StatusFileSize
new1.16 KB

I got a list off paypal and incorporated it in this patch. It's pretty trivial, but works.

kbahey’s picture

Status: Needs review » Needs work

First, an error:

$ patch -p0 < simple_paypal.module.patch
patching file simple_paypal.module
patch: **** malformed patch at line 42:

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.

kbahey’s picture

Also, 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).

mgifford’s picture

StatusFileSize
new1.79 KB

Ok, 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.

kbahey’s picture

Status: Needs work » Fixed

Thanks.

I committed it, and it should be in the -dev tarball by tomorrow.

mgifford’s picture

Great. Would be nice to see more folks using this module.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

venkat-rk’s picture

Status: Closed (fixed) » Active

Following 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?

kbahey’s picture

Status: Active » Postponed (maintainer needs more info)

Did you try the version that this fix went into? 5.x-1.x-dev.

Please try that and report back.

venkat-rk’s picture

I used 5.x-1.1. Shall try the dev version and report back.

venkat-rk’s picture

Okay, 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?

mgifford’s picture

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

venkat-rk’s picture

thank 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).