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

multiple refunds on the same payment fail #256

Closed haayman closed 2 years ago

haayman commented 2 years ago

I'm pretty sure it worked before that it was possible to have multiple refunds on a single payment until the amount is zero.

I've got a ticket application where it is possible to cancel tickets. Right now you can only cancel tickets once, but before it was possible to cancel all tickets one at the time, creating a new refund on the same paymen. So why can't we have multiple refunds anymore?

sjorsvanheuveln commented 2 years ago

Since when did you start having issues with this? I have another issue, but my payment system has been broken since 18th of jan and was working 4 years straight without issues.

haayman commented 2 years ago

I don't know. Since the tickets are for a theater group and due to the pandemic I haven't worked on the system for a long time. Looking through my tests I notice I don't have that test-case unfortunately, but I'm convinced this was possible.

Pimm commented 2 years ago

Thanks for opening the issue.

According to our changelog, since 17 March 2020 "[d]uplicate Refunds (same amount as another Refund on the same Payment within the hour) are now blocked by the API." Could this be affecting you? I can imagine that if you cancel two tickets individually, the refunds are for the same amount.

I was not personally involved in this change, nor do I know whether there is a workaround. I will ask around internally.

Pimm commented 2 years ago

I learned that this protection, introduced in March 2020, can be disabled on a per-merchant basis.

This means that if the error you are receiving is in fact:

ApiError: A duplicate refund has been detected

then you can contact support and ask them to turn off this protection.

Please let me know whether this works for you.

haayman-imagem commented 2 years ago

yes, that makes a lot of sense. I will ask. Thanks a lot