@checkout-kit/core / CheckoutEngine
Interface: CheckoutEngine
Properties
| Property | Modifier | Type |
|---|---|---|
providerIds | readonly | readonly string[] |
Methods
abort()
ts
abort(reason?): Promise<PaymentResult>;Parameters
| Parameter | Type |
|---|---|
reason? | "user" | "timeout" |
Returns
Promise<PaymentResult>
fetchIntent()
ts
fetchIntent(intentId, providerId?): Promise<PaymentIntent>;Parameters
| Parameter | Type |
|---|---|
intentId | string |
providerId? | string |
Returns
Promise<PaymentIntent>
getSnapshot()
ts
getSnapshot(): CheckoutSnapshot;Returns
hydrate()
ts
hydrate(params?): Promise<PaymentResult | null>;Pick up a payment left in flight by a full-page redirect.
Parameters
| Parameter | Type |
|---|---|
params? | Readonly<Record<string, string>> |
Returns
Promise<PaymentResult | null>
on()
ts
on<T>(type, handler): () => void;Type Parameters
| Type Parameter |
|---|
T extends | "phase_changed" | "provider_changed" | "intent_created" | "action_required" | "action_started" | "action_finished" | "result" | "error" |
Parameters
| Parameter | Type |
|---|---|
type | T |
handler | (event) => void |
Returns
() => void
pay()
ts
pay(request): Promise<PaymentResult>;Parameters
| Parameter | Type |
|---|---|
request | PayRequest |
Returns
Promise<PaymentResult>
prepare()
ts
prepare(input): Promise<void>;Create the intent ahead of submission. A no-op for providers that do not need it.
Parameters
| Parameter | Type |
|---|---|
input | CreateIntentInput |
Returns
Promise<void>
reset()
ts
reset(): void;Returns
void
resumeWith()
ts
resumeWith(evidence): Promise<PaymentResult>;Continue with evidence the host obtained itself (e.g. from a return URL).
Parameters
| Parameter | Type |
|---|---|
evidence | ActionEvidence |
Returns
Promise<PaymentResult>
runPendingAction()
ts
runPendingAction(options?): Promise<PaymentResult>;Execute the pending action and hand its evidence to the provider.
Parameters
| Parameter | Type |
|---|---|
options? | RunActionOptions |
Returns
Promise<PaymentResult>
subscribe()
ts
subscribe(listener): () => void;Parameters
| Parameter | Type |
|---|---|
listener | () => void |
Returns
() => void
useProvider()
ts
useProvider(providerId): Promise<void>;Parameters
| Parameter | Type |
|---|---|
providerId | string |
Returns
Promise<void>