mollie / laravel-cashier-mollie

Official Mollie integration for Laravel Cashier
https://www.cashiermollie.com/
MIT License
138 stars 44 forks source link

Webhook Handling Error in Laravel Cashier Mollie #269

Open WEBronckhorst opened 2 weeks ago

WEBronckhorst commented 2 weeks ago

Issue: Webhook Handling Error in Laravel Cashier Mollie

Description

When handling the webhook for first payments, the webhook fails and results in an internal server error.

Error Details

Request Details

Application Details

Database Queries

  1. SELECT * FROM customers WHERE customers.id = 2 LIMIT 1 (2.6 ms)
  2. SELECT * FROM payments WHERE mollie_payment_id = 'tr_xxxxxxxx' LIMIT 1 (0.58 ms)
  3. UPDATE customers SET mollie_mandate_id = NULL, customers.updated_at = '2024-11-04 17:05:00' WHERE id = 2 (0.57 ms)

Steps to Reproduce

  1. Trigger a POST request to the /webhooks/mollie/first-payment endpoint.
  2. Include a valid id in the request body, such as "id": "tr_xxxxxxxx".
  3. Observe the error response and exception thrown.

Expected Behavior

The webhook should be handled without any exceptions or errors, and the payment should be processed correctly.

Actual Behavior

An InvalidMandateException is thrown, resulting in an internal server error.

Possible Related Issues

Suggested Solution

Investigate why the mollie_mandate_id is set to NULL during the process and ensure that valid mandates are present for the customer.

sandervanhooft commented 2 weeks ago

Hi @WEBronckhorst ,

Thanks for the extensive report.

To get started:

WEBronckhorst commented 2 weeks ago

Here’s an improved and translated response in Markdown format:

Hi @sandervanhooft,

Thank you for your response!

Here's the information you requested:

Best regards,

Let me know if this version captures everything accurately or if you'd like any adjustments.

WEBronckhorst commented 2 weeks ago

something went wrong with my last pee it has not been resolved yet

sandervanhooft commented 2 weeks ago

Thanks @WEBronckhorst ,

That leaves these questions open:

what specific (2.x.y) package version are you using?

You can find the installed package version using composer show mollie/laravel-cashier-molllie

have you recently changed Mollie environments, i.e. from test to live, or changed the Mollie profile key for another profile's?

for these specific resources, what is the Mollie dashboard telling you about the history?