pronamic / wp-pronamic-pay

The Pronamic Pay plugin allows you to easily accept payments with payment methods like credit card, iDEAL, Bancontact and Sofort through a variety of payment providers on your WordPress website.
https://pronamicpay.com
34 stars 14 forks source link

Make Mollie payments that don't require interaction (follow-up payments) asynchronous? #255

Closed remcotolsma closed 2 years ago

remcotolsma commented 2 years ago

https://github.com/wp-pay-gateways/mollie/blob/a65e919f6228483c5672be6bdfdb3ae64342975f/src/Gateway.php#L463-L464

When we make these create payment requests asynchronous it's easier to retry them?

Code Description
429 Too Many Requests – Your request has hit a rate limit. Please wait for a bit and retry.

https://docs.mollie.com/overview/handling-errors

I also mentioned Mollie error handling als in this issue: https://github.com/pronamic/wp-pronamic-pay/issues/188#issuecomment-907155800.

The follow-up payments that could not be started could be put in a queue.

Maybe https://actionscheduler.org/ (https://github.com/pronamic/wp-pronamic-pay/issues/253) can help us to make it easier to reschedule those actions.

rvdsteege commented 2 years ago

Possibly related / for reference:

remcotolsma commented 2 years ago

Nice catch, i didn't know the term idempotent:

remcotolsma commented 2 years ago

We have (partly) implemented this in https://github.com/wp-pay-gateways/mollie/blob/19a60e2d5ad3ee8ca7466f0cad78d666d59179d1/src/Gateway.php#L450-L494. In case of exceptions in checking/creating a Mollie user or mandate, there may still be room for improvement.