Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SOFORT-beëindiging - 30 september 2024 #56

Open
remcotolsma opened this issue Sep 17, 2024 · 1 comment
Open

SOFORT-beëindiging - 30 september 2024 #56

remcotolsma opened this issue Sep 17, 2024 · 1 comment

Comments

@remcotolsma
Copy link
Member

https://help.mollie.com/hc/nl/articles/20904206772626-SOFORT-be%C3%ABindiging-30-september-2024

@rvdsteege
Copy link
Member

Discussed at office, no action needed for now as payment method will be deactivated by $gateway->maybe_enrich_payment_methods().

/**
* Maybe enrich payment methods.
*
* @return void
*/
private function maybe_enrich_payment_methods() {
$cache_key = 'pronamic_pay_mollie_payment_methods_' . \md5( (string) \wp_json_encode( $this->config ) );
$mollie_payment_methods = \get_transient( $cache_key );
if ( false === $mollie_payment_methods ) {
$mollie_payment_methods = $this->client->get_all_payment_methods();
\set_transient( $cache_key, $mollie_payment_methods, \DAY_IN_SECONDS );
}
// All payment methods are inactive by default.
foreach ( $this->payment_methods as $payment_method ) {
$payment_method->set_status( 'inactive' );
}
$method_transformer = new MethodTransformer();
foreach ( $mollie_payment_methods->_embedded->methods as $mollie_payment_method ) {
$core_payment_method_ids = $method_transformer->from_mollie_to_pronamic( $mollie_payment_method->id );
foreach ( $core_payment_method_ids as $core_payment_method_id ) {
$core_payment_method = $this->get_payment_method( $core_payment_method_id );
if ( null !== $core_payment_method ) {
switch ( $mollie_payment_method->status ) {
case 'activated':
$core_payment_method->set_status( 'active' );
break;
case 'pending-boarding':
case 'pending-review':
case 'pending-external':
$core_payment_method->set_status( $this->config->is_test_mode() ? 'active' : 'inactive' );
break;
case 'rejected':
case null:
$core_payment_method->set_status( 'inactive' );
break;
}
}
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants