pronamic / wp-pronamic-pay-mollie

Mollie driver for the WordPress payment processing library.
http://www.wp-pay.org/gateways/mollie/
6 stars 1 forks source link

Add payment methods with `recurring` feature support #33

Closed rvdsteege closed 1 year ago

rvdsteege commented 1 year ago

From customer in internal Help Scout ticket https://secure.helpscout.net/conversation/2291715621/25842:

We have Pronamic enabled on our WordPress site and when I go to the configuration (link via Mollie), Giropay has a green check mark. But I can't select this option with Restrict Content Pro. I can select all the other options we have enabled in Pronamic.

Apparently, we didn't have a Giropay payment method in Restrict Content Pro. I've already added the gateway in https://github.com/pronamic/wp-pronamic-pay-restrict-content-pro/commit/fe192f0c39fd04bfbd15624cc5af56f56c78a48e. However, this only allows for one-off payments as we don't add recurring feature support for Giropay when registering the payment methods in the Mollie gateway:

https://github.com/pronamic/wp-pronamic-pay-mollie/blob/16a8f9a7edfc216680e72c10ab83f0b81d193fde/src/Gateway.php#L128-L205

According to the Mollie documentation at https://docs.mollie.com/payments/recurring#setting-up-the-first-payment:

The following payment methods support a first payment and are thus allowed as a value for the method parameter of a first payment: applepay bancontact belfius creditcard eps giropay ideal kbc mybank paypal sofort

Of the mentioned methods, we're currently only adding recurring feature support for the following payment methods:

  1. applepay
  2. creditcard
  3. paypal

Additionally, we register separate payment methods with recurring payments support for these payments methods:

  1. bancontactPaymentMethods::DIRECT_DEBIT_BANCONTACT
  2. idealPaymentMethods::DIRECT_DEBIT_IDEAL
  3. sofortPaymentMethods::DIRECT_DEBIT_SOFORT

This leaves us with some unsupported recurring payment methods:

  1. belfius
  2. eps
  3. giropay
  4. kbc
  5. mybank (but we don't support this method at all)

To add support for these payment methods, we need to:

  1. add recurring feature support or;
  2. add separate payment methods, like we do for Bancontact, iDEAL and SOFORT.

What do you think, @remcotolsma?

remcotolsma commented 1 year ago

Probably related to:

rvdsteege commented 1 year ago

Probably related to: […]

It is, I just tested this:

🤨

Scherm­afbeelding 2023-07-07 om 15 35 21 Scherm­afbeelding 2023-07-07 om 15 35 56
remcotolsma commented 1 year ago

Discussed yesterday with @rvdsteege at @Pronamic HQ, PR is open: https://github.com/pronamic/wp-pronamic-pay-mollie/pull/34.