Dolibarr / dolibarr

Dolibarr ERP CRM is a modern software package to manage your company or foundation's activity (contacts, suppliers, invoices, orders, stocks, agenda, accounting, ...). it's an open source Web application (written in PHP) designed for businesses of any sizes, foundations and freelancers.
https://www.dolibarr.org
GNU General Public License v3.0
5.44k stars 2.79k forks source link

[Resolved] Stripe: Unable to charge over €10,000.00 #26633

Closed SBordier44 closed 11 months ago

SBordier44 commented 11 months ago

Bug

Hi, when I want to pay an invoice of more than €10,000, I get the error "Invalid parameter amount. Amount must be at most €10,000.00 EUR".

I tried to change the API version to 2023-10-16 with the STRIPE_FORCE_VERSION parameter, without success, the problem remains the same.

I tried to update the lib in the include/stripe/stripe-php folder but that doesn't change anything.

--

I carried out some tests with the Stripe API outside of Dolibarr by following the Stripe developer documentation and it works very well with large amounts. Namely, the limit of a paymentIntent is 999,999.99 :-)

Does anyone have an idea/way to correct this?

Thank you all and by the way, great work you do, thank you ^^

Environment Version

1.8.3

Environment OS

Linux (shared hosting)

Environment Web server

Apache 2.4

Environment PHP

8.2

Environment Database

MariaDB 10.6.16

Environment URL(s)

(private)

Expected and actual behavior

No response

Steps to reproduce the behavior

Attached files

Capture d’écran du 2023-11-16 17-35-32

JonBendtsen commented 11 months ago

If you search for

"Invalid parameter amount. Amount must be at most €10,000.00 EUR"

in Dolibarrs source code, do you find it any where?

SBordier44 commented 11 months ago

Hello Jon, Thanks a lot for your answer :)

I searched, yes, unfortunately I found nothing. However, I found this error in the Stripe API log console.

Obviously, the paymentIntent object sent by Dolibarr to the Stripe API is no longer really what is expected with the latest versions of the Stripe API. I think the objects sent to Stripe remained in the format of Stripe API version 2020-08-27. https://github.com/Dolibarr/dolibarr/blob/445824f7833f04b86bca65ad3fbe0acc8f888112/htdocs/stripe/config.php#L55

I compared the calls made with the developer scripts provided by Stripe and the calls made by Dolibarr and the format is not the same. I think that's where the error comes from.

Here's where the code falls into error: https://github.com/Dolibarr/dolibarr/blob/445824f7833f04b86bca65ad3fbe0acc8f888112/htdocs/stripe/class/stripe.class.php#L535

I would have liked to help evolve the Stripe code in Dolibarr, but I admit I'm a little lost, I'm relatively new to the Dolibarr world, and I'm a little short of time ^^

hansemschnokeloch commented 11 months ago

Hello,

In the Stripe documentation there's a 10k€ limit specified for SEPA direct debits. Maybe you're in this case.

https://stripe.com/docs/payments/sepa-debit?locale=fr-FR

SBordier44 commented 11 months ago

Hi Pascal :) Thanks for reply! i'm not in this case, i'm use a credit card. When make tests with Stripe api demo scripts, payment of an amount greater than €10,000 works fine.

atm-maxime commented 11 months ago

Hi ! I think that this message is directly coming from the Stripe API. Maybe there's a limitation on your Stripe account ?

SBordier44 commented 11 months ago

Hi Maxime! After verifications, no, I do not have any limitations on my account.

I did tests with Stripe's quickstarts without having any problems with an amount greater than €10,000. https://stripe.com/docs/payments/quickstart

Indeed, I confirm that the message comes from the API. But this error does not occur with Stripe quickstarts.

The only link I found is the PaymentIntent object sent by Dolibarr which does not match what I found in the Stripe docs.

Could someone test it to make sure the issue isn't mine?

Thanks :)

SBordier44 commented 11 months ago

Um.... I found the problem which ultimately isn't a problem...

In the Stripe module options, I had the option "Enable direct debit payments with Stripe" activated, which added the "sepa_debit" item in the payment_method_types array of the API call.

Payments by direct debit being in fact limited to €10,000, this was the reason for the error.

After deactivating this option, everything works correctly :D

Really sorry for the inconvenience and thanks again to everyone and especially to @hansemschnokeloch because he had a good line of research!

Good luck to the Dolibarr dev team, you do a great job, well done and thank you ^^