account_country ) { return [ Currency_Code::SINGAPORE_DOLLAR ]; } if ( Country_Code::UNITED_STATES === $account_country ) { return [ Currency_Code::UNITED_STATES_DOLLAR ]; } if ( Country_Code::HUNGARY === $account_country ) { return [ Currency_Code::HUNGARIAN_FORINT ]; } if ( in_array( $account_country, [ Country_Code::AUSTRIA, Country_Code::BELGIUM, Country_Code::BULGARIA, Country_Code::CYPRUS, Country_Code::CZECHIA, Country_Code::DENMARK, Country_Code::ESTONIA, Country_Code::FINLAND, Country_Code::FRANCE, Country_Code::GERMANY, Country_Code::GREECE, Country_Code::IRELAND, Country_Code::ITALY, Country_Code::LATVIA, Country_Code::LITHUANIA, Country_Code::LUXEMBOURG, Country_Code::MALTA, Country_Code::NETHERLANDS, Country_Code::NORWAY, Country_Code::PORTUGAL, Country_Code::ROMANIA, Country_Code::SLOVAKIA, Country_Code::SLOVENIA, Country_Code::SPAIN, Country_Code::SWEDEN, Country_Code::SWITZERLAND, Country_Code::CROATIA, ], true ) ) { return [ Currency_Code::EURO ]; } // fallback currency code, just in case. return [ Currency_Code::CHINESE_YUAN ]; } /** * Get the list of supported countries * * @return string[] Array of country codes */ public static function get_supported_countries(): array { return []; } /** * Get the payment method capabilities * * @return string[] */ public static function get_capabilities(): array { return [ PaymentMethodCapability::REFUNDS, PaymentMethodCapability::MULTI_CURRENCY, ]; } /** * Get the URL for the payment method's icon * * @param string|null $account_country Optional. The merchant's account country. * * @return string */ public static function get_icon_url( ?string $account_country = null ): string { return plugins_url( 'assets/images/payment-methods/alipay-logo.svg', WCPAY_PLUGIN_FILE ); } /** * Get the URL for the payment method's dark mode icon * * @param string|null $account_country Optional. The merchant's account country. * * @return string Returns regular icon URL if no dark mode icon exists */ public static function get_dark_icon_url( ?string $account_country = null ): string { return self::get_icon_url( $account_country ); } /** * Get the URL for the payment method's settings icon * * @param string|null $account_country Optional. The merchant's account country. * * @return string */ public static function get_settings_icon_url( ?string $account_country = null ): string { return self::get_icon_url( $account_country ); } /** * Get the testing instructions for the payment method * * @param string $account_country The merchant's account country. * @return string HTML string containing testing instructions */ public static function get_testing_instructions( string $account_country ): string { return ''; } /** * Get the currency limits for the payment method * * @return array> */ public static function get_limits_per_currency(): array { return []; } /** * Whether this payment method is available for the given currency and country * * @param string $currency The currency code to check. * @param string $account_country The merchant's account country. * * @return bool */ public static function is_available_for( string $currency, string $account_country ): bool { if ( ! PaymentMethodUtils::is_available_for( self::get_supported_currencies(), self::get_supported_countries(), $currency, $account_country ) ) { return false; } return true; } /** * Whether this payment method should be enabled by default * * @return bool */ public static function is_enabled_by_default(): bool { return false; } /** * Get the minimum amount for this payment method for a given currency and country * * @param string $currency The currency code. * @param string $country The country code. * * @return int|null The minimum amount or null if no minimum. */ public static function get_minimum_amount( string $currency, string $country ): ?int { return null; } /** * Get the maximum amount for this payment method for a given currency and country * * @param string $currency The currency code. * @param string $country The country code. * * @return int|null The maximum amount or null if no maximum. */ public static function get_maximum_amount( string $currency, string $country ): ?int { return null; } }