isPanValid method

bool isPanValid({
  1. bool checkLuhn = true,
})

Validates the Merchant PAN using the Luhn Algorithm.

The Luhn algorithm is used to validate the integrity of the PAN. This method checks if the PAN passes the checksum validation.

Returns:

  • true if the PAN is valid according to the Luhn algorithm.
  • false if the PAN is invalid or null.

Implementation

bool isPanValid({bool checkLuhn = true}) {
  if (pan.isNotEmpty) {
    return pan.isValidPAN(checkLuhn: checkLuhn);
  }
  return false;
}