diff --git a/app/PaymentDrivers/GoCardlessPaymentDriver.php b/app/PaymentDrivers/GoCardlessPaymentDriver.php index 770a272c7d37..646c69619e21 100644 --- a/app/PaymentDrivers/GoCardlessPaymentDriver.php +++ b/app/PaymentDrivers/GoCardlessPaymentDriver.php @@ -38,6 +38,7 @@ class GoCardlessPaymentDriver extends BaseDriver public static $methods = [ GatewayType::BANK_TRANSFER => \App\PaymentDrivers\GoCardless\ACH::class, + GatewayType::DIRECT_DEBIT => \App\PaymentDrivers\GoCardless\DirectDebit::class, ]; const SYSTEM_LOG_TYPE = SystemLog::TYPE_GOCARDLESS; @@ -63,6 +64,14 @@ class GoCardlessPaymentDriver extends BaseDriver $types[] = GatewayType::BANK_TRANSFER; } + if ( + $this->client + && isset($this->client->country) + && in_array($this->client->country->iso_3166_3, ['GBR']) + ) { + $types[] = GatewayType::DIRECT_DEBIT; + } + return $types; }