startProcess method

Future<FawryResponse> startProcess ()

Start FawryPay SDK process.

Start FawryPay SDK process, whether it was initialized for payment, or initialized for card tokenizer. Returns a FawryResponse type of the resulted data. Throws exception if not completed well.

Implementation

Future<FawryResponse> startProcess() async {
  try {
    Map<dynamic, dynamic> data = await _channel.invokeMethod(_METHOD_START_PAYMENT);
    return FawryResponse.fromMap(data);
  } on PlatformException catch (e) {
    if (e.code == _ERROR_START_PAYMENT)
      throw "Error Occurred: Code: $_ERROR_START_PAYMENT. Message: ${e.message}. Details: SDK start process error";
    throw "Error Occurred: Code: ${e.code}. Message: ${e.message}. Details: ${e.details}";
  } catch (e) {
    throw "Error Occurred: $e";
  }
}