Skip to main content

Intent

@littleapp/little-pay-api / Exports / Intent

Class: Intent

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new Intent(params): Intent

Parameters

NameType
paramsCreateIntentParams

Returns

Intent

Properties

checkoutUrl

Private Optional checkoutUrl: string


creationParams

Private creationParams: CreateIntentParams


paToken

Private Optional paToken: PaToken


reference

Private Optional reference: string

Methods

create

create(clientId, clientSecret, tokenId): Promise\<{ checkoutUrl: string ; message: string ; reference: string }>

Parameters

NameType
clientIdstring
clientSecretstring
tokenIdstring

Returns

Promise\<{ checkoutUrl: string ; message: string ; reference: string }>


createPaToken

createPaToken(params): Promise\<PaToken>

Parameters

NameType
paramsProcessorPayload\<"CARDS">

Returns

Promise\<PaToken>


getCheckoutUrl

getCheckoutUrl(): string

Get the checkout URL.

Returns

string

  • The checkout URL

Throws

LittlePayError Will throw an error if the checkout URL is not available.


getPaToken

getPaToken(): undefined | PaToken

Get the PaToken.

Returns

undefined | PaToken

  • The PaToken

getReference

getReference(): string

Get the intent reference.

Returns

string

  • The intent reference

Throws

LittlePayError If the reference is not available.


redirectToCheckout

redirectToCheckout(): void

Redirects the user to the checkout page. If you set a return URL when creating the intent, the user will be redirected to that URL after the payment is completed.

Returns

void

Throws

LittlePayError If the checkout URL is not available.