ERROR IPN notification with invalid amount or currency or email: Array

Started by blackrat999, February 18, 2019, 12:44:25 PM

Previous topic - Next topic

blackrat999

Payments are left as "pending" when they go through to Paypal, otherwise all working fine. Can someone help me please with the error which doesnt mean anything to me, i have found a few similar issues while googling but nothing that has solved it so far. IPN is enabled in Paypal account.

I have removed correct emails and personal details from the below error.

2019-02-18 11:34:48 ERROR IPN notification with invalid amount or currency or email: Array
(
    [paypal_data] => Array
        (
            [mc_gross] => 14.43
            [invoice] => KGCG05
            [protection_eligibility] => Eligible
            [address_status] => confirmed
            [payer_id] => Z4EAXV7YPYFZ6
            [address_street] => Address here
            [payment_date] => 03:34:40 Feb 18, 2019 PST
            [payment_status] => Completed
            [charset] => windows-1252
            [address_zip] => EXPOSTCODE
            [first_name] => Richard
            [mc_fee] => 0.69
            [address_country_code] => GB
            [address_name] => Name Here
            [notify_version] => 3.9
            [custom] => b5c8693144ebb3fbb895bec5f151a320
            [payer_status] => verified
            [business] => email@addresshere.co.uk
            [address_country] => United Kingdom
            [address_city] => Town Here
            [quantity] => 1
            [verify_sign] => AilRlM2K-12r5vHGroVpSbu42v8xAq-cszjoC2256qg-3Wp2MAOimKz4
            [payer_email] => address@ishere.co.uk
            [txn_id] => 5LU82109PA506024V
            [payment_type] => instant
            [last_name] => Hughes
            [address_state] => EN
            [receiver_email] => email@ishere.co.uk
            [payment_fee] =>
            [shipping_discount] => 0.00
            [insurance_amount] => 0.00
            [receiver_id] => B6QUHPLLQLNM8
            [txn_type] => web_accept
            [item_name] => Order Number: KGCG05
            [discount] => 0.00
            [mc_currency] => GBP
            [item_number] =>
            [residence_country] => GB
            [shipping_method] => Default
            [transaction_subject] =>
            [payment_gross] =>
            [shipping] => 3.99
            [ipn_track_id] => 83f499fc44b26
        )

    [payment_order_total] => 10.44000
    [currency_code_3] => GBP
    [testing Total-mc-gross] => -3.99
    [testing Compare] => 0.01443
    [testing Result] => 1
)


Many thanks

GJC Web Design

no idea why but the payment is

[mc_gross] => 14.43

but the returned tested result is

    [payment_order_total] => 10.44000
    [currency_code_3] => GBP
    [testing Total-mc-gross] => -3.99

as it says - 3.99 short (10.44 + 3.99 = 14.43)

why?

shipping is => [shipping] => 3.99 - is that a clue?

these figures are tested in   plugins\vmpayment\paypal\paypal\helpers\paypal.php

by

            "paypal_data"         => $paypal_data,
            'payment_order_total' => $payments[0]->payment_order_total,
            'currency_code_3'     => $this->currency_code_3,
            'testing Total-mc-gross' => ($payments[0]->payment_order_total - $paypal_data['mc_gross']),
            'testing Compare' => ($paypal_data['mc_gross'] * 0.001),
            'testing Result' =>(int) (abs($payments[0]->payment_order_total - $paypal_data['mc_gross'] < abs($paypal_data['mc_gross'] * 0.001)) )
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

blackrat999

Thanks for having a look.
The first level of postage (done by weight) is set as £4.45 with no tax rule applied so im not sure where it gets the 3.99 from at all.

Do you have any suggestions about what might be best to do next please?

GJC Web Design

sorry .. none at all except check check and double check

only u know your settings in VM and Paypal - 99.9% of users have no problems so it is something in your setup

the amount that is supposedly to be charged doesn't match what Paypal sends back that it charged .. so of course the order cannot go to confirmed
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

blackrat999

Again thanks for reply.
Still not found the issue but...

It works fine in Sandbox mode - does that mean the issue is at Paypal account end?

For some reason it is charging an extra 3.99 when it gets to the first paypal screen (see screenshot)

where the hell is that 3.99 coming from!!? I have deleted and remade the shipping and payment plugins - at a bit of a loss now


blackrat999

Figured it out!

Doh!

The Paypal account had a previous load of postage settings 3.99 etc from the previous website that i had nothing to do with. Once i removed that it all worked fine. It was testing it in the sandbox and seeing it was working that kicked me in the backside!!

Hope this helps someone else as daft as me :-)

Thanks for your help GJC !!

stAn99

hello, we are experiencing same issue "ERROR IPN notification with invalid amount or currency or email: Array" but with a different setup:

1. we are using "shopping cart" mode in paypal, so it sends items

when investigating this problem, the IPN is:

[paypal_data] =&gt; Array
        (
            [mc_gross] =&gt; 354.85
            [invoice] =&gt; 0070974
            [protection_eligibility] =&gt; Eligible
            [address_status] =&gt; confirmed
            [item_number1] =&gt; {REMOVED}
            [item_number2] =&gt; {REMOVED}
            [payer_id] =&gt; {REMOVED}
            [address_street] =&gt; 15 {REMOVED}
            [payment_date] =&gt; 08:19:20 Feb 05, 2021 PST
            [payment_status] =&gt; Completed
            [charset] =&gt; windows-1252
            [address_zip] =&gt; 25300
            [mc_handling] =&gt; 76.85
            [first_name] =&gt; {REMOVED}
            [mc_fee] =&gt; 14.90
            [address_country_code] =&gt; FR
            [address_name] =&gt; {REMOVED}
            [notify_version] =&gt; 3.9
            [custom] =&gt; {REMOVED}
            [payer_status] =&gt; verified
            [business] =&gt; {REMOVED}
            [address_country] =&gt; France
            [num_cart_items] =&gt; 2
            [address_city] =&gt; {REMOVED}
            [verify_sign] =&gt; {REMOVED}
            [payer_email] =&gt; {REMOVED}
            [txn_id] =&gt; 59660466BP287111S
            [payment_type] =&gt; instant
            [last_name] =&gt; {REMOVED}
            [address_state] =&gt;
            [item_name1] =&gt; {REMOVED - PRODUCT1}
            [receiver_email] =&gt; {REMOVED}
            [item_name2] =&gt; {REMOVED - PRODUCT2}
            [payment_fee] =&gt;
            [shipping_discount] =&gt; 0.00
            [quantity1] =&gt; 1
            [insurance_amount] =&gt; 0.00
            [quantity2] =&gt; 1
            [receiver_id] =&gt; {REMOVED}
            [txn_type] =&gt; cart
            [discount] =&gt; 0.00
            [mc_gross_1] =&gt; 0.00
            [mc_currency] =&gt; EUR
            [mc_gross_2] =&gt; 278.00
            [residence_country] =&gt; CH
            [shipping_method] =&gt; Default
            [transaction_subject] =&gt;
            [payment_gross] =&gt;
            [ipn_track_id] =&gt; 3dd9c78b9e6c1
        )

    [payment_order_total] =&gt; 384.85000
    [currency_code_3] =&gt; EUR
    [testing Total-mc-gross] =&gt; 30
    [testing Compare] =&gt; 0.35485
    [testing Result] =&gt; 0
)


and the problem here is that
[mc_gross_1] =&gt; 0.00
and
[mc_gross_2] =&gt; 278.00

while mc_gross_2 of 278 is price of PRODUCT1

so it seems that the problem is caused by missing prices of PRODUCT2 as the sent items were shifted.

this only happens on a very few orders out of thousands and we cannot reproduce this yet. it just happens in 1 to a few hundred cases.


best regards, stan
----
RuposTel.com
www.rupostel.com
Your customized checkout solution for Virtuemart