Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: Stripe payment completed, but not registered by Dolibarr #32510

Open
JonBendtsen opened this issue Jan 3, 2025 · 6 comments
Open

BUG: Stripe payment completed, but not registered by Dolibarr #32510

JonBendtsen opened this issue Jan 3, 2025 · 6 comments
Labels
Bug This is a bug (something does not work as expected)

Comments

@JonBendtsen
Copy link
Contributor

Bug

Looking in my Dolibarr it appeared like a payment had not been made on an order, which usually creates an invoice, validated that invoice, registers a payment, and automatically email notification to the buyer.

But when customer was asked to pay, the customer replied that the payment was done, and I can see it in my Stripe Dashboard as not only completed but also added to a payout which actually is in my bank account.

As you can see in the picture the customer did have to make 4 attempts at paying before succeeding, but still I would expect that it would be registered as complete when it was complete.

Is there a way to auto detect such issues?

Dolibarr Version

docker v20.0.2

Environment PHP

docker v20.0.2

Environment Database

1:11.0.3+maria~ubu2204

Steps to reproduce the behavior and expected behavior

No response

Attached files

stripe_payment-not_registered

@JonBendtsen JonBendtsen added the Bug This is a bug (something does not work as expected) label Jan 3, 2025
@sonikf
Copy link
Contributor

sonikf commented Jan 3, 2025

Looking in my Dolibarr it appeared like a payment had not been made on an order, which usually creates an invoice, validated that invoice, registers a payment, and automatically email notification to the buyer.

Hi @JonBendtsen
Can you describe the full process?
Does the payment triggers the invoice generation?
Only payment registration step failed?

@JonBendtsen
Copy link
Contributor Author

JonBendtsen commented Jan 3, 2025

@sonikf sure I can.

Because the order is validated AFTER the notification is sent and the order reference thus changes from the email to after the email I sent them a link to my own little page that finds the "URL for payment" using the API and then it redirects them to that URL.

From that URL they fill out with their credit card information, this is sent to Stripe which in all other cases have created an invoice. But it does not always validate that invoice (see #32500). The final step is that it records the payment, which failed in this case, but not in #32500.

This in this case

  • no invoice created
  • no invoice validated
  • no payment registered

And I expected all 3.

@sonikf
Copy link
Contributor

sonikf commented Jan 3, 2025

So it seems that the problem is in the invoice generation step.
Did you check if there was any failed stripe payment in #32500 too?
Any log errors?
Do you use hooks? If a hook replaced existing dolibarr core code it could explain payment of invoice in draft status...
If you haven't already you should add some tests and logging to your code e.g.: if status == 1 (validated invoice) then allow payment?

@JonBendtsen
Copy link
Contributor Author

So it seems that the problem is in the invoice generation step. Did you check if there was any failed stripe payment in #32500 too?
No failed stripe payments with #32500

Any log errors? Do you use hooks? If a hook replaced existing dolibarr core code it could explain payment of invoice in draft status... If you haven't already you should add some tests and logging to your code e.g.: if status == 1 (validated invoice) then allow payment?

I do not use hooks, only business notifications module.

no nginx errors which proxyes the dolibarr container will check that next.

No dolibarr container errors (apache)

No errors in dolibarr.log (I run in level 5).

@JonBendtsen
Copy link
Contributor Author

The notifications I have for this customer (and almost 100% the other customers) are:

  • Customer proposal validated
  • Sales order validated
  • Customer invoice paid

When I look at automatic notifications sent I see:

  • 24/12/2024 09:28AM Sales order validated
  • 24/12/2024 17:24PM Customer invoice paid

@JonBendtsen
Copy link
Contributor Author

When I generated the invoice today using the GUI, I did not run into any issues with generating it. And the logs does not show any errors either?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug This is a bug (something does not work as expected)
Projects
None yet
Development

No branches or pull requests

2 participants