confirm 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 Cash on delivery
.
It will return the Order Code.
Implementation
@override
Future<String> confirm(
{required int customerId,
int? paymentOptionId,
int? addressId,
required int loyaltyPoints,
required double finalAmount,
int? storeId}) async {
final response = await postData(
path: 'checkout/confirm',
queryParameters: {
"PaymentOptionID": paymentOptionId,
"CustomerID": customerId,
"AddressID": addressId,
"PickStoreID": storeId,
"LoyaltyPointsRedeemed": loyaltyPoints,
"FinalAmount": paymentOptionId,
},
);
final result = ApiReturnResult.fromJSON(response.data);
if (result.code == 200) {
return result.data;
} else {
throw ExceptionApi(code: result.code, message: result.error?.first);
}
}