payWithPaytm static method

Future<Map> payWithPaytm({
  1. required String mId,
  2. required String orderId,
  3. required String txnToken,
  4. required String txnAmount,
  5. required String callBackUrl,
  6. required bool staging,
  7. bool? appInvokeEnabled,
})

Implementation

static Future<Map<dynamic, dynamic>> payWithPaytm({
  required String mId,
  required String orderId,
  required String txnToken,
  required String txnAmount,
  required String callBackUrl,
  required bool staging,
  bool? appInvokeEnabled,
}) async {
  assert(mId != null);
  assert(orderId != null);
  assert(txnToken != null);
  assert(txnAmount != null);
  assert(callBackUrl != null);
  assert(staging != null);

  if (appInvokeEnabled == null) {
    appInvokeEnabled = true;
  }

  Map<dynamic, dynamic> response =
      await _channel.invokeMethod('payWithPaytm', {
    "mId": mId,
    'orderId': orderId,
    'txnToken': txnToken,
    'txnAmount': txnAmount,
    'callBackUrl': callBackUrl,
    "isStaging": staging,
    "appInvokeEnabled": appInvokeEnabled
  });

  if (response['response'] != null &&
      response['response'].runtimeType.toString() == "String") {
    response['response'] = json.decode(response['response']);
  }

  return response;
}