Forums / Built-in Shipping and Payment Modules / Paypal IPN problem with comma in price

Paypal IPN problem with comma in price

Locked

Views: 2,087

Results 1 to 4 of 4
This thread is locked. New replies are disabled.
9 May 2007, 11:59 PM
#1
cnsystems avatar

cnsystems

New Zenner

Join Date:
Apr 2006
Posts:
20
Plugin Contributions:
0

Paypal IPN problem with comma in price

Hi,

I think I narrowed down my problem with stuck orders in the PayPal IPN module. Here is an error message from the Debug mode:

IPN WARNING :: Currency/Amount Mismatch. Details:
PayPal email address =
| mc_currency = USD
| submitted_currency = USD
| order_currency = USD
| mc_gross = 3312.56
| converted_amount = 3,312.56
| order_amount = 3312.56

It looks like it is adding a comma to the coverted amount making the currency a mismatch. This particular order got stuck and had to be retrieved via the Stuck order contibution.

The last order that I received a few days ago came through fine but coincidentially it was only for $300.00. It seems like once the order total reaches 1000.00 it's adding a comma to the converted amount making the order not go though to the admin and email.

Anyone have an ideas??

I did apply the latest Paypal IPN Handler file. Can the IPN Module be deleted and reinstalled? If so, what is the best way to do this. Or do you think something else is causing the comma to be added to the currency.

Any help would be greatly appreciated, It's kind of a pain to have these stuck orders.

Thanks,

CB

10 May 2007, 12:33 AM
#2
cnsystems avatar

cnsystems

New Zenner

Join Date:
Apr 2006
Posts:
20
Plugin Contributions:
0

Re: Paypal IPN problem with comma in price

Does anything look wrong with this code? -here is the code from paypal_functions for currecny:

function valid_payment($amount, $currency) {
global $currencies;
if (MODULE_PAYMENT_PAYPAL_CURRENCY == 'Selected Currency') {
$my_currency = $_SESSION['currency'];
} else {
$my_currency = substr(MODULE_PAYMENT_PAYPAL_CURRENCY, 5);
}
$currency_list = array('CAD', 'EUR', 'GBP', 'JPY', 'USD', 'AUD', 'CHF', 'CZK', 'DKK', 'HKD', 'HUF', 'NOK', 'NZD', 'PLN', 'SEK', 'SGD', 'THB');
if (!in_array($my_currency, $currency_list)) {
$my_currency = 'USD';
}
$transaction_amount = number_format(($amount) * $currencies->get_value($my_currency), $currencies->get_decimal_places($my_currency));
if ( ($_POST['mc_currency'] != $my_currency) || ($_POST['mc_gross'] != $transaction_amount && $_POST['mc_gross'] != -0.01) && MODULE_PAYMENT_PAYPAL_TESTING != 'Test' ) {
ipn_debug_email('IPN WARNING :: Currency/Amount Mismatch. Details: ' . "\n" . 'PayPal email address = ' . $_POST['business'] . "\n" . ' | mc_currency = ' . $_POST['mc_currency'] . "\n" . ' | submitted_currency = ' . $my_currency . "\n" . ' | order_currency = ' . $currency . "\n" . ' | mc_gross = ' . $_POST['mc_gross'] . "\n" . ' | converted_amount = ' . $transaction_amount . "\n" . ' | order_amount = ' . $amount );
return false;
}
ipn_debug_email('IPN INFO :: Currency/Amount Details: ' . "\n" . 'PayPal email address = ' . $_POST['business'] . "\n" . ' | mc_currency = ' . $_POST['mc_currency'] . "\n" . ' | submitted_currency = ' . $my_currency . "\n" . ' | order_currency = ' . $currency . "\n" . ' | mc_gross = ' . $_POST['mc_gross'] . "\n" . ' | converted_amount = ' . $transaction_amount . "\n" . ' | order_amount = ' . $amount );
return true;

10 May 2007, 7:56 AM
#3
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Paypal IPN problem with comma in price

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

11 May 2007, 2:30 AM
#4
cnsystems avatar

cnsystems

New Zenner

Join Date:
Apr 2006
Posts:
20
Plugin Contributions:
0

Re: Paypal IPN problem with comma in price

Thanks a bunch Dr. Byte. I applied the 5/10 update. I'll let you know how it works out.

CB