addRfuForEMVCo method

dynamic addRfuForEMVCo({
  1. String? id,
  2. String? value,
})

RFU for EMVCo

RFU for EMVCo is list type. u can add more than one item. id id is "03" to "99".

Implementation

addRfuForEMVCo({String? id, String? value}) {
  if (id != null && value != null) {
    if (int.parse(id) <
            int.parse(MerchantInformationID.rfuForEMVCoRangeStart) ||
        int.parse(id) >
            int.parse(MerchantInformationID.rfuForEMVCoRangeEnd)) {
      // this.value = this.value.copyWith(rfuForEMVCo: []);
      throw InvalidId(title: "RfuForEMVCo");
    }

    if (this.value.rfuForEMVCo != null) {
      this.value.rfuForEMVCo?.add(setTLV(value, id));
    } else {
      List<TLVModel> tlv = [];
      tlv.add(setTLV(value, id));
      this.value = this.value.copyWith(rfuForEMVCo: tlv);
    }
  }
}