mollie / mollie-api-node

Official Mollie API client for Node
http://www.mollie.com
BSD 3-Clause "New" or "Revised" License
231 stars 63 forks source link

Exception on existing subscription #272

Closed ultimate-tester closed 2 years ago

ultimate-tester commented 2 years ago

While integrating Mollie in NodeJS, I've experienced an exception that is exactly the same as described in the PHP client: https://github.com/mollie/mollie-api-php/issues/149

The test case is to recreate a subscription with the same described as a canceled subscription.

ApiError: A subscription with the same description already exists for this customer
    at Function.createFromResponse (C:\Users\User\IntelliJ Projects\strms\node_modules\@mollie\api-client\dist\mollie.cjs.js:355:12)
    at throwApiError (C:\Users\User\IntelliJ Projects\strms\node_modules\@mollie\api-client\dist\mollie.cjs.js:754:22)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:93:5) 

Although the exception is thrown, the subscription is in fact created and working as confirmed on Mollie's web interface.

Pimm commented 2 years ago

We did some time travelling back to 2018 to gather some information.

It seems the issue to which you linked didn't actually demonstrate a bug in the PHP client; but rather in the Mollie platform. The bug was swiftly fixed back in 2018. And as it was fixed in the platform, it immediately affected all merchants (regardless of the client used).

This means it is unlikely that you are affected by this bug. Furthermore, if we try to reproduce your test case, we are not getting the same error.

My hunch is that you may have cancelled a subscription, and then created a new subscription with the same description twice. It succeeded the first time, but caused this error the second time.

If my hunch is incorrect, please elaborate your test case so we can get the same error.