IntegrateIntegration modesHeadless CheckoutSDK ReferenceInterfacesPurseHeadlessCheckoutTokenOn this pagePurseHeadlessCheckoutTokenRepresents a saved payment token in the Purse checkout system. Tokens are secure references to saved payment methods like stored credit cards or digital wallet accounts. Example // Assume `token` is an instance of PurseHeadlessCheckoutToken// Edit token nameawait token.edit({ name: 'Personal Card' });// Delete tokenawait token.delete(); Extends PurseHeadlessCheckoutPaymentItemBase.PurseHeadlessCheckoutEditable Extended by PurseHeadlessCheckoutPrimaryToken PurseHeadlessCheckoutSecondaryToken Properties disabled disabled: Readable<DisabledState | null>; Indicates if the payment token is disabled with an error code and message id id: string; Unique identifier of the payment method Examples 'hipay-bancontact' 'illicado-giftcard' 'aci-creditcard' Inherited from PurseHeadlessCheckoutPaymentItemBase.id isSecondary isSecondary: boolean; Indicates if the payment method is a secondary mean of payment Inherited from PurseHeadlessCheckoutPaymentItemBase.isSecondary maxAmount maxAmount: number | null; Maximum amount to use the payment method Inherited from PurseHeadlessCheckoutPaymentItemBase.maxAmount method method: string; Type of payment method, it can be a card, a wallet, a bank transfer, etc. Examples 'applepay' 'googlepay' 'creditcard' Inherited from PurseHeadlessCheckoutPaymentItemBase.method minAmount minAmount: number | null; Minimum amount to use the payment method Inherited from PurseHeadlessCheckoutPaymentItemBase.minAmount name name: string; partner partner: string; Partner associated with the payment method Examples 'hipay' 'paypal' Inherited from PurseHeadlessCheckoutPaymentItemBase.partner type type: "token" | "temporary_token"; Overrides PurseHeadlessCheckoutPaymentItemBase.type Methods delete() delete(): Promise<void>; Delete the token from the user's wallet Returns Promise<void> Throws PurseHeadlessCheckoutError METHOD_NOT_IMPLEMENTED If the token is of type PurseHeadlessCheckoutTemporarySecondaryToken PurseHeadlessCheckoutError MISSING_SESSION If the session is missing PurseHeadlessCheckoutError MISSING_TOKEN If the provided token cannot be found PurseHeadlessCheckoutError MISSING_WALLET_SESSION If the wallet session is missing PurseHeadlessCheckoutError UNKNOWN_ERROR If an unknown error is caught during the deletion Example token.delete(); Inherited from PurseHeadlessCheckoutEditable.delete edit() edit(payload): Promise<void>; Edit the token's name Parameters ParameterTypeDescriptionpayload{ name: string; }payload.namestring- Returns Promise<void> Throws PurseHeadlessCheckoutError TOKEN_NOT_REGISTERABLE If the token is not registerable PurseHeadlessCheckoutError TOKEN_NOT_REGISTERED If the token is not registered (see PurseHeadlessCheckoutRegisterable.register) PurseHeadlessCheckoutError TOKEN_NAME_EXISTS If the token name already exists PurseHeadlessCheckoutError MISSING_TOKEN If the provided token cannot be found PurseHeadlessCheckoutError INVALID_TOKEN_NAME If the provided token name is invalid PurseHeadlessCheckoutError MISSING_WALLET_SESSION If the wallet session is missing Example token.edit({ name: 'New Name' }); Inherited from PurseHeadlessCheckoutEditable.edit