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

Introduce a `$gateway->can_retry_payment( Payment $payment )` function? #243

Closed remcotolsma closed 1 year ago

remcotolsma commented 2 years ago

No longer use ( ! $payment->get_recurring() ) condition to determine a payment can be retried, maybe we should ask this to each $gateway? A Mollie payment can be retried if there is valid mandate ID?

https://github.com/pronamic/wp-pay-core/commit/41ecb7a7040310591642d9386d8c012cb174bb0a

rvdsteege commented 2 years ago

A Mollie payment can be retried if there is valid mandate ID?

There could be a mandate, but it should not be possible to retry a first payment even though there is a mandate.

remcotolsma commented 2 years ago

Then the question is why shouldn't a first payment that has failed be retried if there is a mandate that makes it possible? It may also be questionable whether a payment can be retried without interaction, with interaction every payment can be made again. It is not possible to automatically process a failed iDEAL payment again without interaction. I don't think this issue is a must within the "Subscriptions follow-up payments improvements" project, we can also improve / devise it at a later stage.

rvdsteege commented 2 years ago

Then the question is why shouldn't a first payment that has failed be retried if there is a mandate that makes it possible?

Because that would activate this subscription, while the user probably tried again themselves and already has an active subscription. Activating this subscription would mean duplicate payments in the future.

I don't think this issue is a must within the "Subscriptions follow-up payments improvements" project, we can also improve / devise it at a later stage.

👍

remcotolsma commented 1 year ago

This is no longer up to date, we already have a solution for this:

https://github.com/pronamic/wp-pronamic-pay-mollie/blob/ba457cec96fa7ff42eb71a208a5be95c058fd3ed/src/Gateway.php#L396-L446