PurseHeadlessCheckoutPrimaryToken
Represents a primary token in the Purse checkout system.
Primary tokens are saved payment methods like stored credit cards or digital wallet accounts.
Extends
Properties
description
Description holds all display values to describe the token in a UI. This is useful since the rendering of a token
is limited to the CVV.
brand?
Brand of the token
expiration_date
Date at which the token is excepted to expire
holderName?
optional holderName: string;
Holder name of the token
label?
Label is optional, the user have not necessarily given a label to the token when creating it.
masked_pan
Will contain displayable value of the PAN or the account email
disabled
disabled: Readable<boolean>;
True mean that the token can't be involved in the checkout.
Mainly set to true upon creation failure
Inherited from
PurseHeadlessCheckoutToken
.disabled
Unique identifier of the payment method
Examples
Inherited from
PurseHeadlessCheckoutToken
.id
isSecondary
Indicates if the token is a secondary mean of payment
Overrides
PurseHeadlessCheckoutToken
.isSecondary
method
Type of payment method, it can be a card, a wallet, a bank transfer, etc.
Examples
Inherited from
PurseHeadlessCheckoutToken
.method
name
Inherited from
PurseHeadlessCheckoutToken
.name
partner
Partner associated with the payment method
Examples
Inherited from
PurseHeadlessCheckoutToken
.partner
type
Inherited from
PurseHeadlessCheckoutToken
.type
Methods
delete()
Delete the token from the user's wallet
Returns
Promise
<void
>
Example
Inherited from
PurseHeadlessCheckoutToken
.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
PurseHeadlessCheckoutToken
.edit
getPaymentElement()
getPaymentElement(options?): PurseHeadlessCheckoutPaymentElement;
Method to get the payment element. Creates the UI instance on first call.
If you need to render a partner's UI, you will need a PaymentElement
Parameters
Returns
PurseHeadlessCheckoutPaymentElement
Example
const paymentElement = token.getPaymentElement();
paymentElement.appendTo('#payment-container');
setAsPrimarySource()
setAsPrimarySource(): void;
Use this method if you want to change which primary to use in the split.
This can be useful if you have moutned multiple primary payment elements (ie. Wallet AND installments for
instance).
Returns
void
Example
token.setAsPrimarySource();