Skip to content

Commit 9916e49

Browse files
authored
Merge pull request #39 from pronamic/remove-ideal-issuers
Remove iDEAL issuer selection.
2 parents 2051ad0 + 0449ab1 commit 9916e49

File tree

2 files changed

+0
-66
lines changed

2 files changed

+0
-66
lines changed

src/Client.php

-21
Original file line numberDiff line numberDiff line change
@@ -220,25 +220,4 @@ public function get_payment_brands( $access_token ) {
220220

221221
return $payment_brands;
222222
}
223-
224-
/**
225-
* Get issuers.
226-
*
227-
* @link https://developer.rabobank.nl/product/8949/api/8826
228-
* @param string $access_token Access token.
229-
* @return array<string>
230-
*/
231-
public function get_issuers( $access_token ) {
232-
$result = $this->request( 'GET', 'ideal/server/api/v2/issuers', $access_token );
233-
234-
$issuers = [];
235-
236-
if ( \property_exists( $result, 'issuers' ) ) {
237-
foreach ( $result->issuers as $issuer ) {
238-
$issuers[ $issuer->id ] = $issuer->name;
239-
}
240-
}
241-
242-
return $issuers;
243-
}
244223
}

src/Gateway.php

-45
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@
1616
use Pronamic\WordPress\Pay\Core\PaymentMethod;
1717
use Pronamic\WordPress\Pay\Core\PaymentMethods;
1818
use Pronamic\WordPress\Pay\Core\PaymentMethodsCollection;
19-
use Pronamic\WordPress\Pay\Fields\CachedCallbackOptions;
20-
use Pronamic\WordPress\Pay\Fields\IDealIssuerSelectField;
21-
use Pronamic\WordPress\Pay\Fields\SelectFieldOption;
2219
use Pronamic\WordPress\Pay\Payments\Payment;
2320
use Pronamic\WordPress\Pay\Refunds\Refund;
2421

@@ -68,19 +65,6 @@ public function __construct( Config $config ) {
6865
// Payment method iDEAL.
6966
$ideal_payment_method = new PaymentMethod( PaymentMethods::IDEAL );
7067

71-
$ideal_issuer_field = new IDealIssuerSelectField( 'ideal-issuer' );
72-
73-
$ideal_issuer_field->set_options(
74-
new CachedCallbackOptions(
75-
function () {
76-
return $this->get_ideal_issuers();
77-
},
78-
'pronamic_pay_ideal_issuers_' . \md5( (string) \wp_json_encode( $config ) )
79-
)
80-
);
81-
82-
$ideal_payment_method->add_field( $ideal_issuer_field );
83-
8468
// Payment methods.
8569
$this->register_payment_method( new PaymentMethod( PaymentMethods::BANCONTACT ) );
8670
$this->register_payment_method( new PaymentMethod( PaymentMethods::CREDIT_CARD ) );
@@ -180,26 +164,6 @@ private function maybe_enrich_payment_methods() {
180164
}
181165
}
182166

183-
/**
184-
* Get iDEAL issuers.
185-
*
186-
* @return array<SelectFieldOption>
187-
*/
188-
private function get_ideal_issuers() {
189-
$options = [];
190-
191-
// Maybe update access token.
192-
$this->maybe_update_access_token();
193-
194-
$result = $this->client->get_issuers( $this->config->access_token );
195-
196-
foreach ( $result as $id => $name ) {
197-
$options[] = new SelectFieldOption( $id, $name );
198-
}
199-
200-
return $options;
201-
}
202-
203167
/**
204168
* Start.
205169
*
@@ -271,15 +235,6 @@ public function start( Payment $payment ) {
271235
$order->set_payment_brand_force( PaymentBrandForce::FORCE_ONCE );
272236
}
273237

274-
// Issuer.
275-
if ( PaymentBrands::IDEAL === $payment_brand ) {
276-
$order->set_payment_brand_meta_data(
277-
(object) [
278-
'issuerId' => $payment->get_meta( 'issuer' ),
279-
]
280-
);
281-
}
282-
283238
// Description.
284239
$description = $payment->get_description();
285240

0 commit comments

Comments
 (0)