[Cakepay] alert iOS availability (#1837)

* feat: alert iOS availability

* feat: use regex, check iOS
This commit is contained in:
Rafael
2024-11-28 18:50:30 +02:00
committed by GitHub
parent 9cd69c4ba3
commit 63f26c034f
31 changed files with 100 additions and 12 deletions
+4 -8
View File
@@ -172,14 +172,12 @@ class CakePayApi {
}
/// Get Countries
Future<List<Country>> getCountries(
{required String CSRFToken, required String authorization}) async {
Future<List<Country>> getCountries({required String apiKey}) async {
final uri = Uri.https(baseCakePayUri, countriesPath);
final headers = {
'accept': 'application/json',
'authorization': authorization,
'X-CSRFToken': CSRFToken,
'Authorization': 'Api-Key $apiKey',
};
final response = await http.get(uri, headers: headers);
@@ -198,8 +196,7 @@ class CakePayApi {
/// Get Vendors
Future<List<CakePayVendor>> getVendors({
required String CSRFToken,
required String authorization,
required String apiKey,
int? page,
String? country,
String? countryCode,
@@ -226,8 +223,7 @@ class CakePayApi {
var headers = {
'accept': 'application/json; charset=UTF-8',
'authorization': authorization,
'X-CSRFToken': CSRFToken,
'Authorization': 'Api-Key $apiKey',
};
var response = await http.get(uri, headers: headers);
+2 -3
View File
@@ -25,7 +25,7 @@ class CakePayService {
/// Get Available Countries
Future<List<Country>> getCountries() async =>
await cakePayApi.getCountries(CSRFToken: CSRFToken, authorization: authorization);
await cakePayApi.getCountries(apiKey: cakePayApiKey);
/// Get Vendors
Future<List<CakePayVendor>> getVendors({
@@ -40,8 +40,7 @@ class CakePayService {
bool? custom,
}) async {
final result = await cakePayApi.getVendors(
CSRFToken: CSRFToken,
authorization: authorization,
apiKey: cakePayApiKey,
page: page,
country: country,
countryCode: countryCode,