allowed_country_currency_matrix = $allowed_country_currency_matrix; $this->currency = $currency; $this->country = $country; } /** * Returns whether GooglePay can be used in the current country and the current currency used. * * @return bool */ public function for_country_currency(): bool { if ( ! in_array( $this->country, array_keys( $this->allowed_country_currency_matrix ), true ) ) { return false; } return in_array( $this->currency, $this->allowed_country_currency_matrix[ $this->country ], true ); } }