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
Unique identifier of the payment method
Examples
Inherited from
PurseHeadlessCheckoutBase.id
isSecondary
Indicates if the payment method is a secondary mean of payment
Inherited from
PurseHeadlessCheckoutBase.isSecondary
method
Type of payment method, it can be a card, a wallet, a bank transfer, etc.
Examples
Inherited from
PurseHeadlessCheckoutBase.method
name
partner
Partner associated with the payment method
Examples
Inherited from
PurseHeadlessCheckoutBase.partner
type
Overrides
PurseHeadlessCheckoutBase.type
Methods
delete()
Delete the token from the user's wallet
Returns
Promise
<void
>
Example
Inherited from
PurseHeadlessCheckoutEditable
.delete
edit()
edit(payload): Promise<void>;
Edit the token's name
Parameters
Parameter | Type | Description |
---|
payload | { name : string ; } | |
payload.name | string | - |
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