Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

currency problem.


Guest

Recommended Posts

Hi.

As far as I am aware, I have my store set up to defualt currency GBP british pounds.

When i did a test purchase it was returning an error. Having looked at the data sent over to my gateway company. It is sending the payment in USp.

I get an error from them saying check currency and transaction type.

 

Can anyone give me some pointers as to where I should be looking for the mistake.

 

Thanks

Link to comment
Share on other sites

includes/languages/english.php

 

define('LANGUAGE_CURRENCY', 'USD');

 

It is a part of that file so you do need to look again.

 

Vger

 

hi vger

 

this is the code from my english.php

 

// if USE_DEFAULT_LANGUAGE_CURRENCY is true, use the following currency, instead of the applications default currency (used when changing language)

define('LANGUAGE_CURRENCY', 'GBP');

 

as you see, it is set correctly. i'm getting a bit baffled with it now.

Link to comment
Share on other sites

hi vger

 

this is the code from my english.php

 

// if USE_DEFAULT_LANGUAGE_CURRENCY is true, use the following currency, instead of the applications default currency (used when changing language)

define('LANGUAGE_CURRENCY', 'GBP');

 

as you see, it is set correctly.  i'm getting a bit baffled with it now.

 

 

I have changed the setting from "use default currency - to use any currency but i am getting the same error.

Link to comment
Share on other sites

I have changed the setting from "use default currency - to use any currency but i am getting the same error.

 

Here is the line with the error in the data that is being sent to ProtX.

 

Crypt=VendorTxCode=??????????????????&Amount=0&Currency=USp&Description

 

Does anyone have any idea where it might be pulling the Currency=USp

Our account is only setup to accept payment in GBP and I cannot for the life of me, find where this string is coming from.

 

Thanks for your time guys.

Link to comment
Share on other sites

Which Protx module are you using?  If it is this one below then it requires that a Protx extension is loaded into PHP on the server before it can be used:

http://www.oscommerce.com/community/contri...ll/search,Protx

 

Vger

 

 

i'm using the one with pre auth here

Protx Form Payment Module v1.06 Pre-Authorisation

http://www.oscommerce.com/community/contri...,1/search,protx

Link to comment
Share on other sites

I did have the same problem and I resolved it by changing this:

 

switch (MODULE_PAYMENT_PROTX_FORM_CURRENCY) {

case 'Default Currency':

$protx_currency = DEFAULT_CURRENCY;

break;

case 'Any Currency':

default:

$protx_currency = $currency;

break;

}

in the includes/modules/payment/protx_form.php to this:

 

switch (MODULE_PAYMENT_PROTX_FORM_CURRENCY) {

// case 'Default Currency':

// $protx_currency = DEFAULT_CURRENCY;

// break;

// case 'Any Currency':

// default:

// $protx_currency = $currency;

// break;

default:

$protx_currency = 'GBP';

break;

 

}

 

 

BUT!!!! Now I have a problem whereby protx is saying:

 

The minimum amount accepted for a transaction is 1.00.

 

ARGHHHH!!!!! We'll get there ;)

Link to comment
Share on other sites

The minimum amount accepted for a transaction is 1.00.

 

 

And that to was a problem with the currency. Im all up and running now so it can be done. In the end I had to decrypt the $crypt variable and my form was sending the Amount as 0. You can fix this by looking at the number_format function in that file when the script is compiling the $plain string, basically take out the class lookup by replacing:

 

$plain .= "Amount=" . number_format($order->info['total'] * $currencies->get_value($protx_currency), $currencies->get_decimal_places($protx_currency)) . "&";

 

with this:

 

$plain .= "Amount=" . number_format($order->info['total'],2) . "&";

 

Your next problem will be getting Protx to give you test credit card numbers - you'll see what I mean ;)

 

Good luck people...

 

ME

Link to comment
Share on other sites

And that to was a problem with the currency.  Im all up and running now so it can be done.  In the end I had to decrypt the $crypt variable and my form was sending the Amount as 0.  You can fix this by looking at the number_format function in that file when the script is compiling the $plain string, basically take out the class lookup by replacing:

 

$plain .= "Amount=" . number_format($order->info['total'] * $currencies->get_value($protx_currency), $currencies->get_decimal_places($protx_currency)) . "&";

 

with this:

 

$plain .= "Amount=" . number_format($order->info['total'],2) . "&";

 

Your next problem will be getting Protx to give you test credit card numbers - you'll see what I mean ;)

 

Good luck people...

 

ME

 

Damn!!!!!!

I really thought that was going to sort it for me then. I searched the file for the strings and it wasn't there????

Link to comment
Share on other sites

Damn!!!!!!

I really thought that was going to sort it for me then. I searched the file for the strings and it wasn't there????

 

 

Does anybody else have any ideas where it is pulling currency=USp from?

I am struggling here

 

Thanks Guys.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...