Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Accepting GBP and EUROs via PAYPAL


Guyver

Recommended Posts

Posted

I notice that you can now accept UK POUNDS and EUROS via paypal.

 

Has anyone got a clue how to do this?

 

Thanks

 

John

Posted

Thanks for that, I'm aware of the PAYPAL side, I just wanted to know if anyone has looked into the OSC side.

 

Having browser the code I see OSC sends money in USD, I wondering if its a matter of just changing that to GBP!?

 

Or even putting an option in to select!

 

John

  • 2 weeks later...
Posted

From paypal, and looking at the support site:

 

* Note1: Although we currently support GBP and EUR for our Send Money and Request Money products, non-US currencies will not be recognized in our website payment products until November 15th. 



Using the new <currency_code> field, you can identify the currency associated with the amount of an item. Here is a code sample used to specify an item that is priced in Euros:



<input type="hidden" name="currency_code" value="EUR"> 



Here is a list of currencies available on November 12th for use with the new <currency_code> variable:

- "GBP": Pounds Sterling (?) 

- "EUR": Euro (?) 

- "CAD": Canadian Dollar (C$) 

- "JPY": Japanese Yen (?) 

- "USD": US Dollar ($) 

(*note: if no currency_code specified, USD is default) 



Finally, here is a code sample for an item priced in Pounds Sterling:



<form action="https://www.paypal.com/cgi-bin/webscr" method="post">

<input type="hidden" name="cmd" value="_xclick">

<input type="hidden" name="business" value="[email protected]" >

<input type="hidden" name="item_name" value="Union Jack Flag">

<input type="hidden" name="amount" value="20">

<input type="hidden" name="currency_code" value="GBP">

<input type="image" src="http://images.paypal.com/images/x-clickbutcc.gif" border="0" name="submit">

</form>

 

So all we/someone needs to do is suss out how you can select the payment type at checkout time.

 

I did brave a look at the checkout code, but thought better off it :(

 

I imagine some sort of checkbox at pymt selection time for ? $ E ..

 

Not sure how hard it would be though, as this parm. would need to be sent to the paypal mod!.

 

John

Posted
So all we/someone needs to do is suss out how you can select the payment type at checkout time.

 

Why not just use the currency the shopper is shopping in??

 

replace

 

global $order, $currencies;

 

with

 

global $order, $currencies, $currency;

 

Replace

 

tep_draw_hidden_field('amount', number_format(($order->info['total'] - $order->info['shipping_cost']) * $currencies->currencies['USD']['value'], $currencies->currencies['USD']['decimal_places'])) .

 

with

 

tep_draw_hidden_field('amount', number_format(($order->info['total'] - $order->info['shipping_cost']) *  $currencies->get_value($currency), 2)) .

 

This hasn't been tested but should work :)

Mark Evans

osCommerce Monkey & Lead Guitarist for "Sparky + the Monkeys" (Album on sale in all good record shops)

 

---------------------------------------

Software is like sex: It's better when it's free. (Linus Torvalds)

Posted

Thanks for the code :).

 

However, if other UK buyers/traders like me have their paypal account loaded with $'s from sales they've done, forcing them to use ?'s my stop them from using it!?

 

John

Posted

I'm assuming that perhaps your cart is in UK ? only from your mail.

 

In which case, to force all your payments from the cart to be in UK ?, go to /catalog/includes/modules/payment/paypal.php and add:

 

tep_draw_hidden_field('currency_code', 'GBP') .

 

....in the process_button_string function (in my case I put this on the penultimate line). This will force PayPal to use ?.

 

I think this should provide a quick and dirty solution, but only when you are using a single currency.

 

Maybe someone else with better programming skills can come up with a more definitive and user-friendly version.

 

Gavin

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...