class PaymentMandateClass

Class for PaymentMandate with user authorization functionality

Constructors

new
PaymentMandateClass(
options?: { id?: string; createdAt?: Date; status?: MandateStatus; },
)

Properties

Methods

Get payment mandate contents class

getUserAuthorization(): string | undefined

Get user authorization token

Check if mandate has user authorization

isSigned(): boolean

Check if mandate is signed (overrides base class for user auth support)

setUserAuthorization(userAuthorization: string): void

Set user authorization (SD-JWT-VC) This would typically be done by a wallet or user agent

toString(): string
protected
validate(): Promise<void>
verifyUserAuthorization(
expectedCartMandateHash?: string,
expectedPaymentMandateHash?: string,
): Promise<boolean>

Verify user authorization token with transaction hashes

Static Methods

createNew(
options?: { id?: string; createdAt?: Date; status?: MandateStatus; },
): Promise<PaymentMandateClass>

Create a new PaymentMandate instance

fromExisting(
options?: { validateUserAuth?: boolean; expectedCartMandateHash?: string; expectedPaymentMandateHash?: string; },
): Promise<PaymentMandateClass>

Create from existing payment mandate with user authorization