getPaymentOptions method Null safety
override
It's return all Payment options available (COD - CC - Apple pay)
Note
you should remove (Apple pay) option if the device is android.
Implementation
@override
Future<List<PaymentOptionsModel>> getPaymentOptions() async {
final response = await getData(path: 'checkout/paymentoptions');
final result = ApiReturnResult.fromJSON(response.data);
if (result.code == 200) {
return List<PaymentOptionsModel>.from(
result.data.map((model) => PaymentOptionsModel.fromJson(model)));
} else {
throw ExceptionApi(code: result.code, message: result.error?.first);
}
}