BASE: Update Icons & Name Of The App.
This commit is contained in:
@@ -34,7 +34,7 @@ import '../payment/xenditScreen.dart';
|
||||
import '../service/fire_store_utils.dart';
|
||||
import 'package:customer/utils/preferences.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'package:uuid/uuid.dart';
|
||||
|
||||
@@ -45,7 +45,8 @@ class WalletController extends GetxController {
|
||||
|
||||
Rx<TextEditingController> topUpAmountController = TextEditingController().obs;
|
||||
|
||||
RxList<WalletTransactionModel> walletTransactionList = <WalletTransactionModel>[].obs;
|
||||
RxList<WalletTransactionModel> walletTransactionList =
|
||||
<WalletTransactionModel>[].obs;
|
||||
|
||||
Rx<UserModel> userModel = UserModel().obs;
|
||||
RxString selectedPaymentMethod = "".obs;
|
||||
@@ -71,17 +72,37 @@ class WalletController extends GetxController {
|
||||
|
||||
Future<void> getPaymentSettings() async {
|
||||
await FireStoreUtils.getPaymentSettingsData().then((value) {
|
||||
payFastModel.value = PayFastModel.fromJson(jsonDecode(Preferences.getString(Preferences.payFastSettings)));
|
||||
mercadoPagoModel.value = MercadoPagoModel.fromJson(jsonDecode(Preferences.getString(Preferences.mercadoPago)));
|
||||
payPalModel.value = PayPalModel.fromJson(jsonDecode(Preferences.getString(Preferences.paypalSettings)));
|
||||
stripeModel.value = StripeModel.fromJson(jsonDecode(Preferences.getString(Preferences.stripeSettings)));
|
||||
flutterWaveModel.value = FlutterWaveModel.fromJson(jsonDecode(Preferences.getString(Preferences.flutterWave)));
|
||||
payStackModel.value = PayStackModel.fromJson(jsonDecode(Preferences.getString(Preferences.payStack)));
|
||||
razorPayModel.value = RazorPayModel.fromJson(jsonDecode(Preferences.getString(Preferences.razorpaySettings)));
|
||||
payFastModel.value = PayFastModel.fromJson(
|
||||
jsonDecode(Preferences.getString(Preferences.payFastSettings)),
|
||||
);
|
||||
mercadoPagoModel.value = MercadoPagoModel.fromJson(
|
||||
jsonDecode(Preferences.getString(Preferences.mercadoPago)),
|
||||
);
|
||||
payPalModel.value = PayPalModel.fromJson(
|
||||
jsonDecode(Preferences.getString(Preferences.paypalSettings)),
|
||||
);
|
||||
stripeModel.value = StripeModel.fromJson(
|
||||
jsonDecode(Preferences.getString(Preferences.stripeSettings)),
|
||||
);
|
||||
flutterWaveModel.value = FlutterWaveModel.fromJson(
|
||||
jsonDecode(Preferences.getString(Preferences.flutterWave)),
|
||||
);
|
||||
payStackModel.value = PayStackModel.fromJson(
|
||||
jsonDecode(Preferences.getString(Preferences.payStack)),
|
||||
);
|
||||
razorPayModel.value = RazorPayModel.fromJson(
|
||||
jsonDecode(Preferences.getString(Preferences.razorpaySettings)),
|
||||
);
|
||||
|
||||
midTransModel.value = MidTrans.fromJson(jsonDecode(Preferences.getString(Preferences.midTransSettings)));
|
||||
orangeMoneyModel.value = OrangeMoney.fromJson(json.decode(Preferences.getString(Preferences.orangeMoneySettings)));
|
||||
xenditModel.value = Xendit.fromJson(jsonDecode(Preferences.getString(Preferences.xenditSettings)));
|
||||
midTransModel.value = MidTrans.fromJson(
|
||||
jsonDecode(Preferences.getString(Preferences.midTransSettings)),
|
||||
);
|
||||
orangeMoneyModel.value = OrangeMoney.fromJson(
|
||||
json.decode(Preferences.getString(Preferences.orangeMoneySettings)),
|
||||
);
|
||||
xenditModel.value = Xendit.fromJson(
|
||||
jsonDecode(Preferences.getString(Preferences.xenditSettings)),
|
||||
);
|
||||
|
||||
Stripe.publishableKey = stripeModel.value.clientpublishableKey.toString();
|
||||
Stripe.merchantIdentifier = 'GoRide';
|
||||
@@ -101,7 +122,9 @@ class WalletController extends GetxController {
|
||||
walletTransactionList.value = value;
|
||||
}
|
||||
});
|
||||
await FireStoreUtils.getUserProfile(FireStoreUtils.getCurrentUid()).then((value) {
|
||||
await FireStoreUtils.getUserProfile(FireStoreUtils.getCurrentUid()).then((
|
||||
value,
|
||||
) {
|
||||
if (value != null) {
|
||||
userModel.value = value;
|
||||
}
|
||||
@@ -123,9 +146,14 @@ class WalletController extends GetxController {
|
||||
paymentStatus: "success",
|
||||
);
|
||||
|
||||
await FireStoreUtils.setWalletTransaction(transactionModel).then((value) async {
|
||||
await FireStoreUtils.setWalletTransaction(transactionModel).then((
|
||||
value,
|
||||
) async {
|
||||
if (value == true) {
|
||||
await FireStoreUtils.updateUserWallet(amount: topUpAmountController.value.text, userId: FireStoreUtils.getCurrentUid()).then((value) {
|
||||
await FireStoreUtils.updateUserWallet(
|
||||
amount: topUpAmountController.value.text,
|
||||
userId: FireStoreUtils.getCurrentUid(),
|
||||
).then((value) {
|
||||
getWalletTransaction();
|
||||
Get.back();
|
||||
});
|
||||
@@ -139,20 +167,32 @@ class WalletController extends GetxController {
|
||||
Future<void> stripeMakePayment({required String amount}) async {
|
||||
log(double.parse(amount).toStringAsFixed(0));
|
||||
try {
|
||||
Map<String, dynamic>? paymentIntentData = await createStripeIntent(amount: amount);
|
||||
Map<String, dynamic>? paymentIntentData = await createStripeIntent(
|
||||
amount: amount,
|
||||
);
|
||||
log("stripe Responce====>$paymentIntentData");
|
||||
if (paymentIntentData!.containsKey("error")) {
|
||||
Get.back();
|
||||
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr());
|
||||
ShowToastDialog.showToast(
|
||||
"Something went wrong, please contact admin.".tr(),
|
||||
);
|
||||
} else {
|
||||
await Stripe.instance.initPaymentSheet(
|
||||
paymentSheetParameters: SetupPaymentSheetParameters(
|
||||
paymentIntentClientSecret: paymentIntentData['client_secret'],
|
||||
allowsDelayedPaymentMethods: false,
|
||||
googlePay: const PaymentSheetGooglePay(merchantCountryCode: 'US', testEnv: true, currencyCode: "USD"),
|
||||
googlePay: const PaymentSheetGooglePay(
|
||||
merchantCountryCode: 'US',
|
||||
testEnv: true,
|
||||
currencyCode: "USD",
|
||||
),
|
||||
customFlow: true,
|
||||
style: ThemeMode.system,
|
||||
appearance: PaymentSheetAppearance(colors: PaymentSheetAppearanceColors(primary: AppThemeData.primary300)),
|
||||
appearance: PaymentSheetAppearance(
|
||||
colors: PaymentSheetAppearanceColors(
|
||||
primary: AppThemeData.primary300,
|
||||
),
|
||||
),
|
||||
merchantDisplayName: 'GoRide',
|
||||
),
|
||||
);
|
||||
@@ -198,7 +238,10 @@ class WalletController extends GetxController {
|
||||
var response = await http.post(
|
||||
Uri.parse('https://api.stripe.com/v1/payment_intents'),
|
||||
body: body,
|
||||
headers: {'Authorization': 'Bearer $stripeSecret', 'Content-Type': 'application/x-www-form-urlencoded'},
|
||||
headers: {
|
||||
'Authorization': 'Bearer $stripeSecret',
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
},
|
||||
);
|
||||
|
||||
return jsonDecode(response.body);
|
||||
@@ -208,8 +251,14 @@ class WalletController extends GetxController {
|
||||
}
|
||||
|
||||
//mercadoo
|
||||
Future<Null> mercadoPagoMakePayment({required BuildContext context, required String amount}) async {
|
||||
final headers = {'Authorization': 'Bearer ${mercadoPagoModel.value.accessToken}', 'Content-Type': 'application/json'};
|
||||
Future<Null> mercadoPagoMakePayment({
|
||||
required BuildContext context,
|
||||
required String amount,
|
||||
}) async {
|
||||
final headers = {
|
||||
'Authorization': 'Bearer ${mercadoPagoModel.value.accessToken}',
|
||||
'Content-Type': 'application/json',
|
||||
};
|
||||
|
||||
final body = jsonEncode({
|
||||
"items": [
|
||||
@@ -222,11 +271,20 @@ class WalletController extends GetxController {
|
||||
},
|
||||
],
|
||||
"payer": {"email": userModel.value.email},
|
||||
"back_urls": {"failure": "${Constant.globalUrl}payment/failure", "pending": "${Constant.globalUrl}payment/pending", "success": "${Constant.globalUrl}payment/success"},
|
||||
"auto_return": "approved", // Automatically return after payment is approved
|
||||
"back_urls": {
|
||||
"failure": "${Constant.globalUrl}payment/failure",
|
||||
"pending": "${Constant.globalUrl}payment/pending",
|
||||
"success": "${Constant.globalUrl}payment/success",
|
||||
},
|
||||
"auto_return":
|
||||
"approved", // Automatically return after payment is approved
|
||||
});
|
||||
|
||||
final response = await http.post(Uri.parse("https://api.mercadopago.com/checkout/preferences"), headers: headers, body: body);
|
||||
final response = await http.post(
|
||||
Uri.parse("https://api.mercadopago.com/checkout/preferences"),
|
||||
headers: headers,
|
||||
body: body,
|
||||
);
|
||||
|
||||
if (response.statusCode == 200 || response.statusCode == 201) {
|
||||
final data = jsonDecode(response.body);
|
||||
@@ -239,7 +297,9 @@ class WalletController extends GetxController {
|
||||
}
|
||||
});
|
||||
} else {
|
||||
ShowToastDialog.showToast("Something want wrong please contact administrator".tr());
|
||||
ShowToastDialog.showToast(
|
||||
"Something want wrong please contact administrator".tr(),
|
||||
);
|
||||
print('Error creating preference: ${response.body}');
|
||||
return null;
|
||||
}
|
||||
@@ -284,9 +344,12 @@ class WalletController extends GetxController {
|
||||
|
||||
///PayStack Payment Method
|
||||
Future<void> payStackPayment(String totalAmount) async {
|
||||
await PayStackURLGen.payStackURLGen(amount: (double.parse(totalAmount) * 100).toString(), currency: "ZAR", secretKey: payStackModel.value.secretKey.toString(), userModel: userModel.value).then((
|
||||
value,
|
||||
) async {
|
||||
await PayStackURLGen.payStackURLGen(
|
||||
amount: (double.parse(totalAmount) * 100).toString(),
|
||||
currency: "ZAR",
|
||||
secretKey: payStackModel.value.secretKey.toString(),
|
||||
userModel: userModel.value,
|
||||
).then((value) async {
|
||||
if (value != null) {
|
||||
PayStackUrlModel payStackModel0 = value;
|
||||
Get.to(
|
||||
@@ -306,15 +369,23 @@ class WalletController extends GetxController {
|
||||
}
|
||||
});
|
||||
} else {
|
||||
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr());
|
||||
ShowToastDialog.showToast(
|
||||
"Something went wrong, please contact admin.".tr(),
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//flutter wave Payment Method
|
||||
Future<Null> flutterWaveInitiatePayment({required BuildContext context, required String amount}) async {
|
||||
Future<Null> flutterWaveInitiatePayment({
|
||||
required BuildContext context,
|
||||
required String amount,
|
||||
}) async {
|
||||
final url = Uri.parse('https://api.flutterwave.com/v3/payments');
|
||||
final headers = {'Authorization': 'Bearer ${flutterWaveModel.value.secretKey}', 'Content-Type': 'application/json'};
|
||||
final headers = {
|
||||
'Authorization': 'Bearer ${flutterWaveModel.value.secretKey}',
|
||||
'Content-Type': 'application/json',
|
||||
};
|
||||
|
||||
final body = jsonEncode({
|
||||
"tx_ref": _ref,
|
||||
@@ -327,14 +398,19 @@ class WalletController extends GetxController {
|
||||
"phonenumber": userModel.value.phoneNumber, // Add a real phone number
|
||||
"name": userModel.value.fullName(), // Add a real customer name
|
||||
},
|
||||
"customizations": {"title": "Payment for Services", "description": "Payment for XYZ services"},
|
||||
"customizations": {
|
||||
"title": "Payment for Services",
|
||||
"description": "Payment for XYZ services",
|
||||
},
|
||||
});
|
||||
|
||||
final response = await http.post(url, headers: headers, body: body);
|
||||
|
||||
if (response.statusCode == 200) {
|
||||
final data = jsonDecode(response.body);
|
||||
Get.to(MercadoPagoScreen(initialURl: data['data']['link']))!.then((value) {
|
||||
Get.to(MercadoPagoScreen(initialURl: data['data']['link']))!.then((
|
||||
value,
|
||||
) {
|
||||
if (value) {
|
||||
ShowToastDialog.showToast("Payment Successful!!".tr());
|
||||
walletTopUp();
|
||||
@@ -363,8 +439,14 @@ class WalletController extends GetxController {
|
||||
|
||||
// payFast
|
||||
void payFastPayment({required BuildContext context, required String amount}) {
|
||||
PayStackURLGen.getPayHTML(payFastSettingData: payFastModel.value, amount: amount.toString(), userModel: userModel.value).then((String? value) async {
|
||||
bool isDone = await Get.to(PayFastScreen(htmlData: value!, payFastSettingData: payFastModel.value));
|
||||
PayStackURLGen.getPayHTML(
|
||||
payFastSettingData: payFastModel.value,
|
||||
amount: amount.toString(),
|
||||
userModel: userModel.value,
|
||||
).then((String? value) async {
|
||||
bool isDone = await Get.to(
|
||||
PayFastScreen(htmlData: value!, payFastSettingData: payFastModel.value),
|
||||
);
|
||||
if (isDone) {
|
||||
Get.back();
|
||||
ShowToastDialog.showToast("Payment successfully".tr());
|
||||
@@ -389,7 +471,10 @@ class WalletController extends GetxController {
|
||||
'description': 'wallet Topup',
|
||||
'retry': {'enabled': true, 'max_count': 1},
|
||||
'send_sms_hash': true,
|
||||
'prefill': {'contact': userModel.value.phoneNumber, 'email': userModel.value.email},
|
||||
'prefill': {
|
||||
'contact': userModel.value.phoneNumber,
|
||||
'email': userModel.value.email,
|
||||
},
|
||||
'external': {
|
||||
'wallets': ['paytm'],
|
||||
},
|
||||
@@ -418,7 +503,10 @@ class WalletController extends GetxController {
|
||||
}
|
||||
|
||||
//Midtrans payment
|
||||
Future<void> midtransMakePayment({required String amount, required BuildContext context}) async {
|
||||
Future<void> midtransMakePayment({
|
||||
required String amount,
|
||||
required BuildContext context,
|
||||
}) async {
|
||||
await createPaymentLink(amount: amount).then((url) {
|
||||
ShowToastDialog.closeLoader();
|
||||
if (url != '') {
|
||||
@@ -436,15 +524,30 @@ class WalletController extends GetxController {
|
||||
|
||||
Future<String> createPaymentLink({required var amount}) async {
|
||||
var ordersId = const Uuid().v1();
|
||||
final url = Uri.parse(midTransModel.value.isSandbox! ? 'https://api.sandbox.midtrans.com/v1/payment-links' : 'https://api.midtrans.com/v1/payment-links');
|
||||
final url = Uri.parse(
|
||||
midTransModel.value.isSandbox!
|
||||
? 'https://api.sandbox.midtrans.com/v1/payment-links'
|
||||
: 'https://api.midtrans.com/v1/payment-links',
|
||||
);
|
||||
|
||||
final response = await http.post(
|
||||
url,
|
||||
headers: {'Accept': 'application/json', 'Content-Type': 'application/json', 'Authorization': generateBasicAuthHeader(midTransModel.value.serverKey!)},
|
||||
headers: {
|
||||
'Accept': 'application/json',
|
||||
'Content-Type': 'application/json',
|
||||
'Authorization': generateBasicAuthHeader(
|
||||
midTransModel.value.serverKey!,
|
||||
),
|
||||
},
|
||||
body: jsonEncode({
|
||||
'transaction_details': {'order_id': ordersId, 'gross_amount': double.parse(amount.toString()).toInt()},
|
||||
'transaction_details': {
|
||||
'order_id': ordersId,
|
||||
'gross_amount': double.parse(amount.toString()).toInt(),
|
||||
},
|
||||
'usage_limit': 2,
|
||||
"callbacks": {"finish": "https://www.google.com?merchant_order_id=$ordersId"},
|
||||
"callbacks": {
|
||||
"finish": "https://www.google.com?merchant_order_id=$ordersId",
|
||||
},
|
||||
}),
|
||||
);
|
||||
|
||||
@@ -452,7 +555,9 @@ class WalletController extends GetxController {
|
||||
final responseData = jsonDecode(response.body);
|
||||
return responseData['payment_url'];
|
||||
} else {
|
||||
ShowToastDialog.showToast("something went wrong, please contact admin.".tr());
|
||||
ShowToastDialog.showToast(
|
||||
"something went wrong, please contact admin.".tr(),
|
||||
);
|
||||
return '';
|
||||
}
|
||||
}
|
||||
@@ -469,13 +574,30 @@ class WalletController extends GetxController {
|
||||
static String orderId = '';
|
||||
static String amount = '';
|
||||
|
||||
Future<void> orangeMakePayment({required String amount, required BuildContext context}) async {
|
||||
Future<void> orangeMakePayment({
|
||||
required String amount,
|
||||
required BuildContext context,
|
||||
}) async {
|
||||
reset();
|
||||
var id = const Uuid().v4();
|
||||
var paymentURL = await fetchToken(context: context, orderId: id, amount: amount, currency: 'USD');
|
||||
var paymentURL = await fetchToken(
|
||||
context: context,
|
||||
orderId: id,
|
||||
amount: amount,
|
||||
currency: 'USD',
|
||||
);
|
||||
ShowToastDialog.closeLoader();
|
||||
if (paymentURL.toString() != '') {
|
||||
Get.to(() => OrangeMoneyScreen(initialURl: paymentURL, accessToken: accessToken, amount: amount, orangePay: orangeMoneyModel.value, orderId: orderId, payToken: payToken))!.then((value) {
|
||||
Get.to(
|
||||
() => OrangeMoneyScreen(
|
||||
initialURl: paymentURL,
|
||||
accessToken: accessToken,
|
||||
amount: amount,
|
||||
orangePay: orangeMoneyModel.value,
|
||||
orderId: orderId,
|
||||
payToken: payToken,
|
||||
),
|
||||
)!.then((value) {
|
||||
if (value == true) {
|
||||
ShowToastDialog.showToast("Payment Successful!!".tr());
|
||||
walletTopUp();
|
||||
@@ -486,13 +608,22 @@ class WalletController extends GetxController {
|
||||
}
|
||||
}
|
||||
|
||||
Future fetchToken({required String orderId, required String currency, required BuildContext context, required String amount}) async {
|
||||
Future fetchToken({
|
||||
required String orderId,
|
||||
required String currency,
|
||||
required BuildContext context,
|
||||
required String amount,
|
||||
}) async {
|
||||
String apiUrl = 'https://api.orange.com/oauth/v3/token';
|
||||
Map<String, String> requestBody = {'grant_type': 'client_credentials'};
|
||||
|
||||
var response = await http.post(
|
||||
Uri.parse(apiUrl),
|
||||
headers: <String, String>{'Authorization': "Basic ${orangeMoneyModel.value.auth!}", 'Content-Type': 'application/x-www-form-urlencoded', 'Accept': 'application/json'},
|
||||
headers: <String, String>{
|
||||
'Authorization': "Basic ${orangeMoneyModel.value.auth!}",
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
'Accept': 'application/json',
|
||||
},
|
||||
body: requestBody,
|
||||
);
|
||||
|
||||
@@ -500,17 +631,32 @@ class WalletController extends GetxController {
|
||||
Map<String, dynamic> responseData = jsonDecode(response.body);
|
||||
|
||||
accessToken = responseData['access_token'];
|
||||
return await webpayment(context: context, amountData: amount, currency: currency, orderIdData: orderId);
|
||||
return await webpayment(
|
||||
context: context,
|
||||
amountData: amount,
|
||||
currency: currency,
|
||||
orderIdData: orderId,
|
||||
);
|
||||
} else {
|
||||
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr());
|
||||
ShowToastDialog.showToast(
|
||||
"Something went wrong, please contact admin.".tr(),
|
||||
);
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
Future webpayment({required String orderIdData, required BuildContext context, required String currency, required String amountData}) async {
|
||||
Future webpayment({
|
||||
required String orderIdData,
|
||||
required BuildContext context,
|
||||
required String currency,
|
||||
required String amountData,
|
||||
}) async {
|
||||
orderId = orderIdData;
|
||||
amount = amountData;
|
||||
String apiUrl = orangeMoneyModel.value.isSandbox! == true ? 'https://api.orange.com/orange-money-webpay/dev/v1/webpayment' : 'https://api.orange.com/orange-money-webpay/cm/v1/webpayment';
|
||||
String apiUrl =
|
||||
orangeMoneyModel.value.isSandbox! == true
|
||||
? 'https://api.orange.com/orange-money-webpay/dev/v1/webpayment'
|
||||
: 'https://api.orange.com/orange-money-webpay/cm/v1/webpayment';
|
||||
Map<String, String> requestBody = {
|
||||
"merchant_key": orangeMoneyModel.value.merchantKey ?? '',
|
||||
"currency": orangeMoneyModel.value.isSandbox == true ? "OUV" : currency,
|
||||
@@ -525,7 +671,11 @@ class WalletController extends GetxController {
|
||||
|
||||
var response = await http.post(
|
||||
Uri.parse(apiUrl),
|
||||
headers: <String, String>{'Authorization': 'Bearer $accessToken', 'Content-Type': 'application/json', 'Accept': 'application/json'},
|
||||
headers: <String, String>{
|
||||
'Authorization': 'Bearer $accessToken',
|
||||
'Content-Type': 'application/json',
|
||||
'Accept': 'application/json',
|
||||
},
|
||||
body: json.encode(requestBody),
|
||||
);
|
||||
print(response.statusCode);
|
||||
@@ -541,7 +691,9 @@ class WalletController extends GetxController {
|
||||
return '';
|
||||
}
|
||||
} else {
|
||||
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr());
|
||||
ShowToastDialog.showToast(
|
||||
"Something went wrong, please contact admin.".tr(),
|
||||
);
|
||||
return '';
|
||||
}
|
||||
}
|
||||
@@ -558,7 +710,13 @@ class WalletController extends GetxController {
|
||||
await createXenditInvoice(amount: amount).then((model) {
|
||||
ShowToastDialog.closeLoader();
|
||||
if (model.id != null) {
|
||||
Get.to(() => XenditScreen(initialURl: model.invoiceUrl ?? '', transId: model.id ?? '', apiKey: xenditModel.value.apiKey!.toString()))!.then((value) {
|
||||
Get.to(
|
||||
() => XenditScreen(
|
||||
initialURl: model.invoiceUrl ?? '',
|
||||
transId: model.id ?? '',
|
||||
apiKey: xenditModel.value.apiKey!.toString(),
|
||||
),
|
||||
)!.then((value) {
|
||||
if (value == true) {
|
||||
ShowToastDialog.showToast("Payment Successful!!".tr());
|
||||
walletTopUp();
|
||||
@@ -574,7 +732,9 @@ class WalletController extends GetxController {
|
||||
const url = 'https://api.xendit.co/v2/invoices';
|
||||
var headers = {
|
||||
'Content-Type': 'application/json',
|
||||
'Authorization': generateBasicAuthHeader(xenditModel.value.apiKey!.toString()),
|
||||
'Authorization': generateBasicAuthHeader(
|
||||
xenditModel.value.apiKey!.toString(),
|
||||
),
|
||||
// 'Cookie': '__cf_bm=yERkrx3xDITyFGiou0bbKY1bi7xEwovHNwxV1vCNbVc-1724155511-1.0.1.1-jekyYQmPCwY6vIJ524K0V6_CEw6O.dAwOmQnHtwmaXO_MfTrdnmZMka0KZvjukQgXu5B.K_6FJm47SGOPeWviQ',
|
||||
};
|
||||
|
||||
@@ -587,7 +747,11 @@ class WalletController extends GetxController {
|
||||
});
|
||||
|
||||
try {
|
||||
final response = await http.post(Uri.parse(url), headers: headers, body: body);
|
||||
final response = await http.post(
|
||||
Uri.parse(url),
|
||||
headers: headers,
|
||||
body: body,
|
||||
);
|
||||
|
||||
if (response.statusCode == 200 || response.statusCode == 201) {
|
||||
XenditModel model = XenditModel.fromJson(jsonDecode(response.body));
|
||||
|
||||
Reference in New Issue
Block a user