Conditionally show ACH for US customers

This commit is contained in:
Benjamin Beganović 2021-09-29 14:17:30 +02:00
parent ba0210fff6
commit 33f0b6b7c6

View File

@ -50,9 +50,17 @@ class GoCardlessPaymentDriver extends BaseDriver
public function gatewayTypes(): array public function gatewayTypes(): array
{ {
return [ $types = [];
GatewayType::BANK_TRANSFER,
]; if (
$this->client
&& isset($this->client->country)
&& in_array($this->client->country->iso_3166_3, ['USA'])
) {
$types[] = GatewayType::BANK_TRANSFER;
}
return $types;
} }
public function authorizeView(array $data) public function authorizeView(array $data)