Jump to content
thirty bees forum
  • 0

PayPal 5.3.2 Invalid request - see details


Derbai

Question

I am not able to let Paypal module work. I get the following error:

Currency amount must be non-negative number, may optionally contain exactly 2 decimal places separated by '.', optional thousands separator ',', limited to 7 digits before the decimal point and currency which is a valid ISO Currency Code

The call is:

``` stdClass Object ( [transactions] => Array ( [0] => stdClass Object ( [amount] => stdClass Object ( [total] => 174.79 [currency] => EUR [details] => Array ( [shipping] => 7.00 [tax] => 29.98 [subtotal] => 136.27 [handling_fee] => 1.54 )

                    )

                [description] => Payment description
                [item_list] => Array
                    (
                        [items] => Array
                            (
                                [0] => stdClass Object
                                    (
                                        [name] => xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
                                        [currency] => EUR
                                        [quantity] => 1
                                        [price] => 136.27
                                        [tax] => 29.98
                                    )

                            )

                        [shipping_address] => Array
                            (
                                [recipient_name] => xxxxxx xxxxxx
                                [line1] => xxxxxxxxxx
                                [line2] => xxxxxxxxxx
                                [city] => xxxxxxxxxx
                                [country_code] => IT
                                [postal_code] => XXXXX
                                [state] => XX
                            )

                    )

            )

    )

[payer] => stdClass Object
    (
        [payment_method] => paypal
    )

[intent] => sale
[experience_profile_id] => XP-XSTK-xxxx-7UX3-xxxx
[redirect_urls] => stdClass Object
    (
        [cancel_url] => https://xxx.xxx.com/it/module/paypal/expresscheckoutcancel?id_cart=34
        [return_url] => https://xxx.xxx.com/it/module/paypal/expresscheckout?id_cart=34
    )

) ```

Can someone help me on fix it? Thansk, Daniele

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

To fix the same problem is needed also the following fix: on modules/paypal/classes/PayPalRestApi.php

$details['shipping_discount'] = abs(round($remaining - $giftWithoutTax, 2));

need to be changed as follow:

$details['shippingdiscount'] = numberformat(abs($remaining - $giftWithoutTax), 2);

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...