Skip to content

Commit 697934d

Browse files
authored
Merge pull request #101 from daanrijpkemacb/2.4-bancontact
2.4: Add support for Bancontact payment method
2 parents 17a1c6b + a5a87aa commit 697934d

3 files changed

Lines changed: 24 additions & 1 deletion

File tree

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ Please contact us if you have any questions regarding the examples or the implem
7474

7575
## Notes per version
7676

77+
### Version 2.4
78+
- Added Bancontact support
79+
7780
### Version 2.3.2.4 (latest)
7881
- Added bank 'N26' to ePayments BIC list.
7982
- Restructured code for Magento compatibility.
@@ -314,6 +317,12 @@ To use Carte Bancaire, use the following method:
314317
$request = $request->setPaymentMethodToCarteBancaire();
315318
```
316319

320+
To use Bancontact, use the following method
321+
```php
322+
$request = $request->setPaymentMethodToBancontact();
323+
```
324+
325+
317326
These methods will throw an exception if required information is missing.
318327

319328
Once the request executes, the link to the transaction will send you to the Bluem Portal with the corresponding interface and flow.

src/Contexts/PaymentsContext.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,15 @@ class PaymentsContext extends BluemContext
1919
public const PAYMENT_METHOD_CREDITCARD = 'CreditCard';
2020
public const PAYMENT_METHOD_SOFORT = 'Sofort';
2121
public const PAYMENT_METHOD_CARTE_BANCAIRE = 'CarteBancaire';
22+
public const PAYMENT_METHOD_BANCONTACT = 'Bancontact';
2223

2324
public const PAYMENT_METHODS = [
2425
self::PAYMENT_METHOD_IDEAL,
2526
self::PAYMENT_METHOD_PAYPAL,
2627
self::PAYMENT_METHOD_CREDITCARD,
2728
self::PAYMENT_METHOD_SOFORT,
28-
self::PAYMENT_METHOD_CARTE_BANCAIRE
29+
self::PAYMENT_METHOD_CARTE_BANCAIRE,
30+
self::PAYMENT_METHOD_BANCONTACT,
2931
];
3032

3133
public string $debtorWalletElementName = self::PAYMENT_METHOD_IDEAL;
@@ -162,4 +164,9 @@ public function isCarteBancaire(): bool
162164
{
163165
return $this->debtorWalletElementName === self::PAYMENT_METHOD_CARTE_BANCAIRE;
164166
}
167+
168+
public function isBancontact(): bool
169+
{
170+
return $this->debtorWalletElementName === self::PAYMENT_METHOD_BANCONTACT;
171+
}
165172
}

src/Requests/PaymentBluemRequest.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,13 @@ public function setPaymentMethodToCarteBancaire(): self
260260
return $this;
261261
}
262262

263+
public function setPaymentMethodToBancontact(): self
264+
{
265+
$this->setPaymentMethod($this->context::PAYMENT_METHOD_BANCONTACT);
266+
return $this;
267+
}
268+
269+
263270
/**
264271
* @param mixed $dueDateTime
265272
* @return string

0 commit comments

Comments
 (0)