Skip to content

Commit

Permalink
Removed support for iDeal issuers to be compatible with iDeal 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
boboldehampsink committed Sep 20, 2024
1 parent 2c295be commit 4dc5924
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 40 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 1.3.0 - 2024-09-20

### Removed
- Removed support for iDeal issuers to be compatible with iDeal 2.0

## 1.2.0 - 2024-04-15

### Added
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "robuust/craft-commerce-pay",
"description": "PAY integration for Craft Commerce 4.0+",
"version": "1.2.0",
"version": "1.3.0",
"type": "craft-plugin",
"keywords": [
"pay",
Expand Down
27 changes: 0 additions & 27 deletions src/gateways/Gateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,9 @@
use craft\web\View;
use Omnipay\Common\AbstractGateway;
use Omnipay\Common\Exception\InvalidRequestException;
use Omnipay\Common\Issuer;
use Omnipay\Common\PaymentMethod;
use Omnipay\Paynl\Gateway as OmnipayGateway;
use Omnipay\Paynl\Message\Request\FetchIssuersRequest;
use Omnipay\Paynl\Message\Request\FetchTransactionRequest;
use Omnipay\Paynl\Message\Response\FetchIssuersResponse;
use Omnipay\Paynl\Message\Response\FetchPaymentMethodsResponse;
use robuust\pay\models\forms\PayOffsitePaymentForm;
use yii\base\Exception;
Expand Down Expand Up @@ -130,10 +127,6 @@ public function populateRequest(array &$request, BasePaymentForm $paymentForm =
if ($paymentForm->paymentMethod) {
$request['paymentMethod'] = $paymentForm->paymentMethod;
}

if ($paymentForm->issuer) {
$request['issuer'] = $paymentForm->issuer;
}
}
}

Expand Down Expand Up @@ -305,7 +298,6 @@ public function getPaymentFormHtml(array $params): ?string
'gateway' => $this,
'paymentForm' => $this->getPaymentFormModel(),
'paymentMethods' => $this->fetchPaymentMethods(),
'issuers' => $this->fetchIssuers(),
];
} catch (\Throwable $exception) {
// In case this is not allowed for the account
Expand Down Expand Up @@ -356,25 +348,6 @@ public function fetchPaymentMethods(array $parameters = [])
return $response->getPaymentMethods();
}

/**
* @param array $parameters
*
* @return Issuer[]
*
* @throws InvalidRequestException
*/
public function fetchIssuers(array $parameters = [])
{
/** @var OmnipayGateway $gateway */
$gateway = $this->createGateway();
/** @var FetchIssuersRequest $issuersRequest */
$issuersRequest = $gateway->fetchIssuers($parameters);
/** @var FetchIssuersResponse $data */
$data = $issuersRequest->sendData($issuersRequest->getData());

return $data->getIssuers();
}

/**
* {@inheritdoc}
*/
Expand Down
5 changes: 0 additions & 5 deletions src/models/forms/PayOffsitePaymentForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,4 @@ class PayOffsitePaymentForm extends BasePaymentForm
* @var string|null
*/
public ?string $paymentMethod = null;

/**
* @var string|null
*/
public ?string $issuer = null;
}
8 changes: 1 addition & 7 deletions src/templates/paymentForm.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,4 @@
<option value="{{ method.id }}">{{ method.name }}</option>
{% endfor %}
</select>

<select name="issuer">
{% for issuer in issuers %}
<option value="{{ issuer.id }}">{{ issuer.name }} - {{ issuer.paymentMethod }}</option>
{% endfor %}
</select>
</div>
</div>

0 comments on commit 4dc5924

Please sign in to comment.