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

Remove global gateway test/live mode setting/meta `_pronamic_gateway_mode` #308

Closed remcotolsma closed 2 years ago

remcotolsma commented 2 years ago

Within iDEAL Basic / Advanced, the test / sandbox environment is completely separate from the production environment. The test / sandbox environment has its own server URL and also its own certificates. Other gateways such as Mollie also do not need a test / live mode setting. The Mollie API key starts with test_ or live_ to indicate this difference. Therefore we could remove the global setting _pronamic_gateway_mode. We should probably introduce a $gateway->get_mode() function.

remcotolsma commented 2 years ago

Originally posted by @rvdsteege in https://github.com/pronamic/wp-pay-core/issues/55#issuecomment-1041657452

remcotolsma commented 2 years ago

I don't think I fully understand how the mode is handled with gateways such as for example Buckaroo or Sisow if the 'Mode' setting gets removed. Or will we end up with all separate gateways for test and production?

I think that depends a bit on the gateway. If a payment provider has a separate environment for test and production payments, then splitting it into separate gateways makes sense. At Mollie we know that this is not the case, they use the API key prefix test_ or live_. DigiWallet has test parameter, I consider that as a gateway configuration setting. DigiWallet users should be able to activate test mode via a checkbox.

Will hooking into get_post_metadata not negatively impact overall website performance? This is quite a low-level filter.

Don't think this is noticeable, but maybe we can introduce our own filter for it.

rvdsteege commented 2 years ago

I've tried starting payments with all gateways after the recent removal of the config in core gateway.

Fixed a few issues:

remcotolsma commented 2 years ago

👆 thanks @rvdsteege

I think this issue is done, we only need a way to update some of the add-ons:

As discussed via Slack we need a custom updater for this, similar to: https://github.com/pronamic/wp-pronamic-client/blob/develop/classes/Updater.php.

In the future we should include a Update URI: header in all the add-ons: https://make.wordpress.org/core/2021/06/29/introducing-update-uri-plugin-header-in-wordpress-5-8/