Skip to content

@checkout-kit/core / PaymentProviderInstance

Interface: PaymentProviderInstance ​

The live half of a plugin, created once per configured provider.

Rule, checked by the conformance suite: confirm and resume never throw. Network failures, bad replies and unknown statuses all come back as { status: 'error' }, because these two report what happened to the money and an exception cannot.

createIntent, getIntent and cancel may reject - the engine turns that into an error result.

Methods ​

cancel()? ​

ts
optional cancel(intentId, opts): Promise<PaymentIntent>;

Parameters ​

ParameterType
intentIdstring
optsCallOptions

Returns ​

Promise<PaymentIntent>


confirm() ​

ts
confirm(
   intentId, 
   instrument, 
   opts
): Promise<PaymentResult>;

Present the instrument. May settle immediately or ask for an action.

Parameters ​

ParameterType
intentIdstring
instrumentPaymentInstrument
optsCallOptions

Returns ​

Promise<PaymentResult>


createIntent() ​

ts
createIntent(input, opts): Promise<PaymentIntent>;

Parameters ​

ParameterType
inputCreateIntentInput
optsCallOptions

Returns ​

Promise<PaymentIntent>


getIntent() ​

ts
getIntent(intentId, opts): Promise<PaymentIntent>;

Authoritative re-read. The engine calls it whenever evidence alone is not enough.

Parameters ​

ParameterType
intentIdstring
optsCallOptions

Returns ​

Promise<PaymentIntent>


resume() ​

ts
resume(
   intentId, 
   evidence, 
   opts
): Promise<PaymentResult>;

Continue once an action has finished. The plugin, not the UI, decides what the evidence means - which is why one method serves a 3-D Secure verdict, a return URL and a wallet token alike.

Parameters ​

ParameterType
intentIdstring
evidenceActionEvidence
optsCallOptions

Returns ​

Promise<PaymentResult>

Apache-2.0 · Headless engine, provider adapters and runnable examples.