feat: implement iDeal 2.0 support

Untested & draft, but this change should implement iDeal 2.0. The only thing I've heard is that we should remove issuer selection.
This commit is contained in:
Wouter van Os
2024-12-17 11:41:34 +01:00
committed by GitHub
parent 4e3fc4f1cb
commit bf67c41604

View File

@@ -97,7 +97,6 @@ function mollie_link($params, $method = Mollie_API_Object_Method::IDEAL)
'metadata' => array( 'metadata' => array(
'invoice_id' => $params['invoiceid'], 'invoice_id' => $params['invoiceid'],
), ),
'issuer' => ((isset($_POST['issuer']) && !empty($_POST['issuer'])) ? $_POST['issuer'] : NULL),
'dueDate' => (($method == \Mollie\Api\Types\PaymentMethod::BANKTRANSFER) ? date('Y-m-d', strtotime('+100 days')) : NULL), 'dueDate' => (($method == \Mollie\Api\Types\PaymentMethod::BANKTRANSFER) ? date('Y-m-d', strtotime('+100 days')) : NULL),
)); ));
@@ -108,18 +107,6 @@ function mollie_link($params, $method = Mollie_API_Object_Method::IDEAL)
} else { } else {
$return = '<form action="viewinvoice.php?id=' . $params['invoiceid'] . '" method="POST">'; $return = '<form action="viewinvoice.php?id=' . $params['invoiceid'] . '" method="POST">';
if ($method == \Mollie\Api\Types\PaymentMethod::IDEAL) {
$issuers = $mollie->methods->get('ideal', ['include' => 'issuers'])->issuers;
$return .= '<label for="issuer">' . $_GATEWAYLANG['selectBank'] . ':</label> ';
$return .= '<select name="issuer">';
foreach ($issuers as $issuer) {
$return .= '<option value=' . htmlspecialchars($issuer->id) . '>' . htmlspecialchars($issuer->name) . '</option>';
}
$return .= '</select>';
}
$return .= '<input type="submit" name="start" value="' . $_GATEWAYLANG['payWith' . ucfirst($method)] . '" /></form>'; $return .= '<input type="submit" name="start" value="' . $_GATEWAYLANG['payWith' . ucfirst($method)] . '" /></form>';
return $return; return $return;