Skip to content

Commit 6d7a3e1

Browse files
authored
Merge pull request #870 from sandervanhooft/feat/add-bacs-mandate-method
feat: Add BACS mandate method for UK direct debit support
2 parents 0ef7671 + 78d0fe9 commit 6d7a3e1

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

src/Types/MandateMethod.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
class MandateMethod
66
{
7+
public const BACS = 'bacs';
8+
79
public const DIRECTDEBIT = 'directdebit';
810

911
public const CREDITCARD = 'creditcard';
@@ -20,6 +22,10 @@ public static function getForFirstPaymentMethod($firstPaymentMethod)
2022
return static::PAYPAL;
2123
}
2224

25+
if ($firstPaymentMethod === PaymentMethod::BACS) {
26+
return static::BACS;
27+
}
28+
2329
if (in_array($firstPaymentMethod, [
2430
PaymentMethod::APPLEPAY,
2531
PaymentMethod::CREDITCARD,

tests/Types/MandateMethodTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ public function dpTestGetForFirstPaymentMethod()
2424
{
2525
return [
2626
[PaymentMethod::APPLEPAY, MandateMethod::CREDITCARD],
27+
[PaymentMethod::BACS, MandateMethod::BACS],
2728
[PaymentMethod::CREDITCARD, MandateMethod::CREDITCARD],
2829
[PaymentMethod::BANCONTACT, MandateMethod::DIRECTDEBIT],
2930
[PaymentMethod::BELFIUS, MandateMethod::DIRECTDEBIT],

0 commit comments

Comments
 (0)