@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()?
optional cancel(intentId, opts): Promise<PaymentIntent>;Parameters
| Parameter | Type |
|---|---|
intentId | string |
opts | CallOptions |
Returns
Promise<PaymentIntent>
confirm()
confirm(
intentId,
instrument,
opts
): Promise<PaymentResult>;Present the instrument. May settle immediately or ask for an action.
Parameters
| Parameter | Type |
|---|---|
intentId | string |
instrument | PaymentInstrument |
opts | CallOptions |
Returns
Promise<PaymentResult>
createIntent()
createIntent(input, opts): Promise<PaymentIntent>;Parameters
| Parameter | Type |
|---|---|
input | CreateIntentInput |
opts | CallOptions |
Returns
Promise<PaymentIntent>
getIntent()
getIntent(intentId, opts): Promise<PaymentIntent>;Authoritative re-read. The engine calls it whenever evidence alone is not enough.
Parameters
| Parameter | Type |
|---|---|
intentId | string |
opts | CallOptions |
Returns
Promise<PaymentIntent>
resume()
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
| Parameter | Type |
|---|---|
intentId | string |
evidence | ActionEvidence |
opts | CallOptions |
Returns
Promise<PaymentResult>