class PaytabsTransactionResponseModel {
  dynamic tranTotal;
  String? transactionReference;
  String? cartCurrency;
  String? cartDescription;
  String? cartID;
  String? tranCurrency;
  String? payResponseReturn;
  bool? isPending;
  bool? isOnHold;
  String? token;
  String? transactionType;
  bool? isAuthorized;
  String? trace;
  dynamic cartAmount;
  dynamic merchantId;
  dynamic profileId;
  bool? isProcessed;
  dynamic serviceId;
  PaymentInfo? paymentInfo;
  bool? isSuccess;

  PaytabsTransactionResponseModel(
      {this.tranTotal,
        this.transactionReference,
        this.cartCurrency,
        this.cartDescription,
        this.cartID,
        this.tranCurrency,
        this.payResponseReturn,
        this.isPending,
        this.isOnHold,
        this.token,
        this.transactionType,
        this.isAuthorized,
        this.trace,
        this.cartAmount,
        this.merchantId,
        this.profileId,
        this.isProcessed,
        this.serviceId,
        this.paymentInfo,
        this.isSuccess});

  PaytabsTransactionResponseModel.fromJson(Map<String, dynamic> json) {
    tranTotal = json['tran_total'];
    transactionReference = json['transactionReference'];
    cartCurrency = json['cartCurrency'];
    cartDescription = json['cartDescription'];
    cartID = json['cartID'];
    tranCurrency = json['tran_currency'];
    payResponseReturn = json['payResponseReturn'];
    isPending = json['isPending'];
    isOnHold = json['isOnHold'];
    token = json['token'];
    transactionType = json['transactionType'];
    isAuthorized = json['isAuthorized'];
    trace = json['trace'];
    cartAmount = json['cartAmount'];
    merchantId = json['merchantId'];
    profileId = json['profileId'];
    isProcessed = json['isProcessed'];
    serviceId = json['serviceId'];
    paymentInfo = json['paymentInfo'] != null
        ? PaymentInfo.fromJson(Map<String, dynamic>.from(json['paymentInfo'] as Map))
        : null;
    isSuccess = json['isSuccess'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['tran_total'] = this.tranTotal;
    data['transactionReference'] = this.transactionReference;
    data['cartCurrency'] = this.cartCurrency;
    data['cartDescription'] = this.cartDescription;
    data['cartID'] = this.cartID;
    data['tran_currency'] = this.tranCurrency;
    data['payResponseReturn'] = this.payResponseReturn;
    data['isPending'] = this.isPending;
    data['isOnHold'] = this.isOnHold;
    data['token'] = this.token;
    data['transactionType'] = this.transactionType;
    data['isAuthorized'] = this.isAuthorized;
    data['trace'] = this.trace;
    data['cartAmount'] = this.cartAmount;
    data['merchantId'] = this.merchantId;
    data['profileId'] = this.profileId;
    data['isProcessed'] = this.isProcessed;
    data['serviceId'] = this.serviceId;
    if (this.paymentInfo != null) {
      data['paymentInfo'] = this.paymentInfo!.toJson();
    }
    data['isSuccess'] = this.isSuccess;
    return data;
  }
}

class PaymentInfo {
  String? cardScheme;
  String? cardType;
  dynamic expiryMonth;
  dynamic expiryYear;
  String? paymentDescription;
  String? paymentMethod;

  PaymentInfo(
      {this.cardScheme,
        this.cardType,
        this.expiryMonth,
        this.expiryYear,
        this.paymentDescription,
        this.paymentMethod});

  PaymentInfo.fromJson(Map<String, dynamic> json) {
    cardScheme = json['cardScheme'];
    cardType = json['cardType'];
    expiryMonth = json['expiryMonth'];
    expiryYear = json['expiryYear'];
    paymentDescription = json['paymentDescription'];
    paymentMethod = json['payment_method'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['cardScheme'] = this.cardScheme;
    data['cardType'] = this.cardType;
    data['expiryMonth'] = this.expiryMonth;
    data['expiryYear'] = this.expiryYear;
    data['paymentDescription'] = this.paymentDescription;
    data['payment_method'] = this.paymentMethod;
    return data;
  }
}
