sendOtp method
Future<void>
sendOtp(
- PaymentSendOtpRequest paymentSendOtpRequest,
- dynamic onSuccess(
- String message
- dynamic onFailed()?,
Implementation
Future<void> sendOtp(
PaymentSendOtpRequest paymentSendOtpRequest,
Function(String message) onSuccess,
{Function(int code,String message)? onFailed}) async {
final response = await _executeNetworkRequest(FastpayFlutterSdk.instance.apiSendOtp,NetworkRequestType.POST,paymentSendOtpRequest.toJson(),onFailed: onFailed,isVersion2: true,isEmptyBody: true);
if(response != null){
try{
onSuccess.call(response);
}catch(e){
onFailed?.call(0,'Something went wrong');
}
}
}