Skip to content

Commit 819da97

Browse files
Merge pull request #21 from nofrixion/develop
PLU-20: moved 'getPispProviders()' call.
2 parents 9b647f3 + fa3310c commit 819da97

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

nofrixion-for-woocommerce.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,10 @@ public function processAjaxPaymentRequestInit()
220220
}
221221

222222
/**
223-
* Handles the AJAX callback from the Payment Request on the checkout page.
223+
* Handles the AJAX callback from the Payment Request on the checkout page.
224+
* TODO - Don't think this runs any more, confirm and remove.
224225
*/
226+
225227
public function processAjaxPaymentRequestUpdatePm()
226228
{
227229

src/Gateway/NoFrixionPisp.php

+6-2
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ public function __construct()
3131
// Admin facing title and description.
3232
$this->method_title = 'NoFrixion PISP';
3333
$this->method_description = __('NoFrixion gateway supporting all available PISP banks.', 'nofrixion-for-woocommerce');
34-
35-
$this->pispProviders = $this->getPayByBankSettings();
3634
}
3735

3836
// Handles MoneyMoov API success webhook that confirms payments received.
@@ -75,6 +73,9 @@ public function getPayByBankSettings(): array
7573

7674
public function payment_fields()
7775
{
76+
if (empty($this->pispProviders)){
77+
$this->pispProviders = $this->getPayByBankSettings();
78+
}
7879

7980
echo '<div class="nf-pisp-payment-options">';
8081
foreach ($this->pispProviders as $provider) {
@@ -137,6 +138,9 @@ public function process_payment($orderId)
137138
Logger::debug('Selected pisp provider: ' . $pispProviderId);
138139

139140
// Check for allowed pisp providers, store provider id to order.
141+
if (empty($this->pispProviders)){
142+
$this->pispProviders = $this->getPayByBankSettings();
143+
}
140144
$allowedPispProviders = array_column($this->pispProviders, 'personalInstitutionID');
141145
if (!in_array($pispProviderId, $allowedPispProviders)) {
142146
$msg_no_provider = __('No valid pisp provider found, aborting.', 'nofrixion-for-woocommerce');

0 commit comments

Comments
 (0)