Skip to content

Commit

Permalink
Remove iDEAL issuers code.
Browse files Browse the repository at this point in the history
  • Loading branch information
remcotolsma committed Jan 10, 2025
1 parent 53949bd commit 3adec2d
Showing 1 changed file with 0 additions and 43 deletions.
43 changes: 0 additions & 43 deletions src/Gateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@
use Pronamic\WordPress\Pay\Core\PaymentMethod;
use Pronamic\WordPress\Pay\Core\PaymentMethods;
use Pronamic\WordPress\Pay\Core\PaymentMethodsCollection;
use Pronamic\WordPress\Pay\Fields\CachedCallbackOptions;
use Pronamic\WordPress\Pay\Fields\IDealIssuerSelectField;
use Pronamic\WordPress\Pay\Fields\SelectFieldOption;
use Pronamic\WordPress\Pay\Fields\SelectFieldOptionGroup;
use Pronamic\WordPress\Pay\Fields\TextField;
use Pronamic\WordPress\Pay\Payments\FailureReason;
use Pronamic\WordPress\Pay\Payments\Payment;
Expand Down Expand Up @@ -110,13 +106,6 @@ public function __construct( Config $config ) {
add_action( 'pronamic_payment_status_update', [ $this, 'copy_customer_id_to_wp_user' ], 99, 1 );

// Fields.
$ideal_options = new CachedCallbackOptions(
function () {
return $this->get_ideal_issuers();
},
'pronamic_pay_ideal_issuers_' . \md5( (string) \wp_json_encode( $config ) )
);

$field_consumer_name = new TextField( 'pronamic_pay_consumer_bank_details_name' );
$field_consumer_name->set_label( __( 'Account holder name', 'pronamic_ideal' ) );
$field_consumer_name->set_required( true );
Expand Down Expand Up @@ -186,11 +175,6 @@ function () {
$payment_method_direct_debit_ideal = new PaymentMethod( PaymentMethods::DIRECT_DEBIT_IDEAL );
$payment_method_direct_debit_ideal->add_support( 'recurring' );

$field_ideal_issuer = new IDealIssuerSelectField( 'pronamic_pay_mollie_direct_debit_ideal_issuer' );
$field_ideal_issuer->set_options( $ideal_options );

$payment_method_direct_debit_ideal->add_field( $field_ideal_issuer );

$this->register_payment_method( $payment_method_direct_debit_ideal );

// Payment method direct debit and SOFORT.
Expand All @@ -215,11 +199,6 @@ function () {
$payment_method_ideal = new PaymentMethod( PaymentMethods::IDEAL );
$payment_method_ideal->add_support( 'recurring' );

$field_ideal_issuer = new IDealIssuerSelectField( 'pronamic_pay_mollie_ideal_issuer' );
$field_ideal_issuer->set_options( $ideal_options );

$payment_method_ideal->add_field( $field_ideal_issuer );

$this->register_payment_method( $payment_method_ideal );

// IN3.
Expand Down Expand Up @@ -378,23 +357,6 @@ private function maybe_enrich_payment_methods() {
}
}

/**
* Get iDEAL issuers.
*
* @return iterable<SelectFieldOption|SelectFieldOptionGroup>
*/
private function get_ideal_issuers() {
$issuers = $this->client->get_issuers();

$items = [];

foreach ( $issuers as $key => $value ) {
$items[] = new SelectFieldOption( $key, $value );
}

return $items;
}

/**
* Get webhook URL for Mollie.
*
Expand Down Expand Up @@ -746,11 +708,6 @@ private function get_payment_request( Payment $payment ) {

$request->set_metadata( $metadata );

// Issuer.
if ( Methods::IDEAL === $request->method ) {
$request->issuer = $payment->get_meta( 'issuer' );
}

// Card token.
if ( Methods::CREDITCARD === $request->method ) {
$card_token = $payment->get_meta( 'mollie_card_token' );
Expand Down

0 comments on commit 3adec2d

Please sign in to comment.