checkoutReview method Null safety
- {required int customerId,
- int? paymentOptionId,
- int? addressId,
- int? loyaltyPoints,
- int? pickStoreID}
override
It's used to get final stage in checkout cycle, It's just a review contains order Items - selected payment - selected address
Implementation
@override
Future<CheckoutReviewModel> checkoutReview(
{required int customerId,
int? paymentOptionId,
int? addressId,
int? loyaltyPoints,
int? pickStoreID}) async {
final response = await getData(
path: 'checkout/review',
queryParameters: {
"PaymentOptionID": paymentOptionId,
"CustomerID": customerId,
"AddressID": addressId,
"PickStoreID": pickStoreID,
"LoyaltyPointsRedeemed": loyaltyPoints,
},
);
final result = ApiReturnResult.fromJSON(response.data);
if (result.code == 200) {
return CheckoutReviewModel.fromJson(result.data);
} else {
throw ExceptionApi(code: result.code, message: result.error?.first);
}
}