Skip to main content

PurseHeadlessCheckoutToken

Represents 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. // Edit token name await token.edit({ name: 'Personal Card' });

// Delete token await token.delete();


## Extends

- [`PurseHeadlessCheckoutEditable`](PurseHeadlessCheckoutEditable.mdx)

## Extended by

- [`PurseHeadlessCheckoutPrimaryToken`](PurseHeadlessCheckoutPrimaryToken.mdx)
- [`PurseHeadlessCheckoutSecondaryToken`](PurseHeadlessCheckoutSecondaryToken.mdx)

## Properties

### disabled

```ts
disabled: Readable<boolean>;

True mean that the token can't be involved in the checkout. Mainly set to true upon creation failure


id

id: string;

Unique identifier of the payment method

Examples

'hipay-bancontact'
'illicado-giftcard'
'aci-creditcard'

Inherited from

PurseHeadlessCheckoutBase.id

isSecondary

isSecondary: boolean;

Indicates if the payment method is a secondary mean of payment

Inherited from

PurseHeadlessCheckoutBase.isSecondary

method

method: string;

Type of payment method, it can be a card, a wallet, a bank transfer, etc.

Examples

'applepay'
'googlepay'
'creditcard'

Inherited from

PurseHeadlessCheckoutBase.method

name

name: string;

partner

partner: string;

Partner associated with the payment method

Examples

'hipay'
'payconiq'
'paypal'

Inherited from

PurseHeadlessCheckoutBase.partner

type

type: "token";

Overrides

PurseHeadlessCheckoutBase.type

Methods

delete()

delete(): Promise<void>;

Delete the token from the user's wallet

Returns

Promise<void>

Example

token.delete();

Inherited from

PurseHeadlessCheckoutEditable.delete


edit()

edit(payload): Promise<void>;

Edit the token's name

Parameters

ParameterTypeDescription
payload{ name: string; }
payload.namestring-

Returns

Promise<void>

Throws

HeadlessCheckoutTokenNotRegisterable if the token is not registerable

Throws

HeadlessCheckoutTokenNotRegistered if the token is not registered

Throws

HeadlessCheckoutTokenNameExists if the token name already exists

Example

token.edit({ name: 'New Name' });

Inherited from

PurseHeadlessCheckoutEditable.edit