merchantCriteria property
MerchantCriteria
get
merchantCriteria
Retrieves the Merchant Criteria (MC) from the QR code data.
The Merchant Criteria is used to identify the type of transaction or payment method. There are two main cases for retrieving the merchant criteria:
- For Payment Credit with Inquiry MPAN, the value is taken from the inquiry MPAN response.
- For Payment Credit without Inquiry MPAN, the value is taken from the QR data tag
26
to45
, specifically sub-tag03
.
The function will check the merchant_criteria
field in the following tags:
- Tag
26
- Tag
27
- Tag
50
- Tag
51
If the merchant_criteria
is found, it will be converted to a MerchantCriteria
enum value. If no valid
merchant_criteria
is found, it will default to MerchantCriteria.regular
.
Returns:
- A
MerchantCriteria
enum value based on the retrieved criteria. If no criteria is found, it returnsMerchantCriteria.regular
as the default.
Example:
MerchantCriteria criteria = QRISMPM(qrData).merchant.merchantCriteria;
print(criteria); // MerchantCriteria.regular or another value depending on the QR data
Implementation
MerchantCriteria get merchantCriteria {
for (var tagId in _baseTagIds) {
var merchantData = _raw['merchant_information_$tagId'];
if (merchantData != null && merchantData['merchant_criteria'] != null) {
String criteria = merchantData['merchant_criteria'];
return criteria.toMerchantCriteria;
}
}
return MerchantCriteria.regular;
}