confirmOrder method Null safety
- {required int customerId,
- int? paymentOptionId,
- int? addressId,
- required int loyaltyPoints,
- required double finalAmount,
- int? storeId}
override
It's used to confirm the order if the payment is Credit card
.
It will return the data of the payment gatway.
Implementation
@override
Future<PaymentFrameModel> confirmOrder(
{required int customerId,
int? paymentOptionId,
int? addressId,
required int loyaltyPoints,
required double finalAmount,
int? storeId}) async {
final response = await postData(
path: 'checkout/confirmorder',
queryParameters: {
"PaymentOptionID": paymentOptionId,
"CustomerID": customerId,
"AddressID": addressId,
"PickStoreID": storeId,
"LoyaltyPointsRedeemed": loyaltyPoints,
"FinalAmount": paymentOptionId,
},
);
final result = ApiReturnResult.fromJSON(response.data);
if (result.code == 200) {
return PaymentFrameModel.fromJson(result.data);
} else {
throw ExceptionApi(code: result.code, message: result.error?.first);
}
}