class PaymentMandateValidator

Validator for PaymentMandate entities

Constructors

new
PaymentMandateValidator(config?: ValidationConfig)

Properties

private
readonly
config: ValidationConfig

Methods

checkExpiry(
paymentMandate: PaymentMandate,
currentDate?: Date,
): Promise<boolean>

Check if PaymentMandate has expired (through its contents timestamp)

validate(paymentMandate: PaymentMandate): Promise<ValidationResult>

Validate PaymentMandate by delegating to contents validation

Validate the integrity of PaymentMandate by checking required fields

validateTransactionHashes(
paymentMandate: PaymentMandate,
expectedCartMandateHash?: string,
expectedPaymentMandateHash?: string,
): Promise<ValidationResult>

Validate that user_authorization contains expected transaction hashes

Validate user_authorization JWT format

Static Methods

checkExpiry(
paymentMandate: PaymentMandate,
currentDate?: Date,
): Promise<boolean>

Static method to check PaymentMandate expiry with default config

validate(paymentMandate: PaymentMandate): Promise<ValidationResult>

Static method to validate PaymentMandate with default config

Static method to validate PaymentMandate integrity with default config

withConfig(config: ValidationConfig): PaymentMandateValidator

Create a validator with custom configuration