fromJson static method

GetnetStatusPaymentResponse fromJson({
  1. required Map json,
})
override

Implementation

static GetnetStatusPaymentResponse fromJson({required Map json}) {
  bool refundData = false;
  if (json['refunded'] is String) {
    if (json['refunded'].toString().toLowerCase() == 'true') {
      refundData = true;
    } else {
      refundData = false;
    }
  }

  return GetnetStatusPaymentResponse(
    result: json['result'],
    resultDetails: json['resultDetails'],
    amount: json['amount'] ?? 0.00,
    callerId: json['callerId'] ?? 'this value of response is null',
    nsu: json['nsu'] ?? 'this value of response is null',
    nsuLastSuccesfullMessage: json['nsuLastSuccesfullMessage'],
    cvNumber: json['cvNumber'],
    receiptAlreadyPrinted: json['receiptAlreadyPrinted'] ?? false,
    type: json['type'] ?? 'this value of response is null',
    brand: json['brand'],
    inputType: json['inputType'] ?? 'this value of response is null',
    installments: json['installments'],
    gmtDateTime: json['gmtDateTime'],
    nsuLocal: json['nsuLocal'],
    authorizationCode: json['authorizationCode'],
    cardBin: json['cardBin'],
    cardLastDigits: json['cardLastDigits'],
    extraScreensResult: json['extraScreensResult'],
    splitPayloadResponse: json['splitPayloadResponse'],
    cardholderName: json['cardholderName'],
    automationSlip: json['automationSlip'],
    printMerchantPreference: json['printMerchantPreference'],
    orderId: json['orderId'],
    pixPayloadResponse: json['pixPayloadResponse'],
    refunded: refundData,
  );
}