addMerchantAccountInformation method
set merchant account information
merchant account information is map type.
u can add more than one item.
id
id No. is "02" up to "51".
Implementation
addMerchantAccountInformation(
{String? id, MerchantAccountInformation? value}) {
if (id != null && value != null) {
if (int.parse(id) < int.parse(ID.merchantAccountInformationRangeStart) ||
int.parse(id) > int.parse(ID.merchantAccountInformationRangeEnd)) {
// this.value = this.value.copyWith(unreservedTemplates: {});
throw InvalidId(title: "MerchantAccountInformation");
}
String _globally =
"${value.value.globallyUniqueIdentifier?.tag}${value.value.globallyUniqueIdentifier?.length}${value.value.globallyUniqueIdentifier?.value}";
String _payment = "";
value.value.paymentNetworkSpecific?.forEach((element) {
_payment += "${element.tag}${element.length}${element.value}";
});
MerchantAccountInformationModel mTLV = MerchantAccountInformationModel(
tag: id,
length: getValueLength(_globally + _payment),
value: value.value);
// add merchant account info
if (this.value.merchantAccountInformation != null) {
this.value.merchantAccountInformation?[id] = mTLV;
} else {
this.value =
this.value.copyWith(merchantAccountInformation: {id: mTLV});
}
}
}