paymentTransaction method

Future<RedeTransactionResponse> paymentTransaction({
  1. required RedePaymentType paymentType,
  2. required int amount,
  3. int? installment,
})

Implementation

Future<RedeTransactionResponse> paymentTransaction({
  required RedePaymentType paymentType,
  required int amount,
  int? installment,
}) async {
  try {
    Map<String, dynamic> params = {
      'amount': amount,
    };

    if (installment != null) {
      params['installment'] = installment;
    }

    final response = await _channel.invokeMethod(paymentType.method, params);

    final model = RedeTransactionResponse.fromJson(response);
    return model;
  } catch (e) {
    rethrow;
  }
}