PayPal express currency fix (4.0.2)

Don’t know where to post this but I’ll do it here.



The current implementation of PayPal EXPRESS implementation is not finished. It only works with USD no matter what you choose in the administration area.



Please read until the end.

To fix this so that it acctualy matters what you select you need to modify the following file:

<br />
app/payments/paypal_express.php<br />

```<br />
<br />
Search for the following line:<br />
```php
<br />
function fn_paypal_set_express_checkout($payment_id, $order_id = 0, $order_info = array(), $cart = array())<br />

```<br />
<br />
Inside this function you will see the currency mode is hard coded to USD:<br />
```php
<br />
'PAYMENTREQUEST_0_CURRENCYCODE' => 'USD',<br />

```<br />
Change this to:<br />
```php
<br />
'PAYMENTREQUEST_0_CURRENCYCODE' => $processor_data['processor_params']['currency'],<br />

```<br />
<br />
Next search for:<br />
```php
<br />
function fn_paypal_do_express_checkout($processor_data, $paypal_checkout_details, $order_info)<br />

```<br />
Inside this function you need to add a line to the $request array:<br />
```php
<br />
$request = array(<br />
	'PAYERID' => $paypal_checkout_details['PAYERID'],<br />

```<br />
Add the following line:<br />
```php
<br />
'PAYMENTREQUEST_0_CURRENCYCODE' => $processor_data['processor_params']['currency'],<br />

```<br />
<br />
This part should end up looking like this:<br />
```php
<br />
$request = array(<br />
	'PAYERID' => $paypal_checkout_details['PAYERID'],<br />
	'PAYMENTREQUEST_0_CURRENCYCODE' => $processor_data['processor_params']['currency'],<br />

```<br />
<br />
Hope this helps somebody since I lost a couple of hours trying to figure it out.<br />
<br />
Also I hope this fix is added to the next version of CS-Cart.<br />
<br />
PS. This was tested on sandbox and worked as expected. Soon it will be deployed on a live shop.

The function isn't fn_paypal_[color=#ff0000]set[/color]_express_checkout ?

It would be better to post in the bug tracker else will be lost in the post.

Yes the first line was suppose to be function fn_paypal_set_express_checkout.

I corrected the original post thanks for the observation.

I'll post it in the bug tracker too.



Edit: Posted in bug tracker and it will be fixed in next version.