addPaymentSystemSpecific method

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

Payment System Specific

payment system specific is list type. u can add more than one item. id id is "50" to "99".

Implementation

addPaymentSystemSpecific({String? id, String? value}) {
  if (id != null && value != null) {
    if (int.parse(id) <
            int.parse(
                AdditionalID.paymentSystemSpecificTemplatesRangeStart) ||
        int.parse(id) >
            int.parse(AdditionalID.paymentSystemSpecificTemplatesRangeEnd)) {
      // this.value = this.value.copyWith(paymentSystemSpecific: []);
      throw InvalidId(title: "PaymentSystemSpecific");
    }

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