The Integrated Payment SDK embeds a fully encapsulated Web Component (Custom Element with Shadow DOM) into your checkout page. A single JavaScript module registers the ic.payment.v1.mount(...) function, which renders a secure payment form with optional Apple Pay and Google Pay wallet buttons.
Note: Apple Pay and Google Pay are only available for card-based sale transactions (
POST /transactions/virtual-sale). Wallet buttons are not displayed for authorization, tokenization, or ACH sessions.
Script Endpoint
Load the SDK bundle on your checkout page:
<script src="https://cdn.omni.integratedcommerce.io/sdk/latest/ic-pay-sdk.js"></script>
Related API Endpoints
To start a hosted payment session and receive the sessionId used by ic.payment.v1.mount(...), call one of:
POST /transactions/virtual-sale— process a card-not-present salePOST /transactions/virtual-auth— authorize a card-not-present transactionPOST /payment-methods/virtual— tokenize a card or ACH bank account
Each response includes sessionId.
Minimal Integration
const controller = ic.payment.v1.mount({
sessionId: response.sessionId,
container: "#payment-container", // CSS selector, element ID, or HTMLElement
environment: "prod",
onComplete: (transaction) => console.log("Payment complete", transaction),
onError: (error) => console.error("Payment error", error),
});
// To tear down the payment form (e.g. on page navigation):
controller.unmount();
Full Configuration
All properties accepted by ic.payment.v1.mount(config):
| Property | Type | Required | Description |
|---|---|---|---|
sessionId |
string |
Yes | Payment session identifier returned by the API. |
container |
string or HTMLElement |
Yes | CSS selector, element ID, or DOM element to mount into. |
environment |
prod or sandbox |
No | Selects the API host. Defaults to "sandbox". |
wallets |
object |
No | { applePay?: boolean, googlePay?: boolean }. Both default to true. Only applies to card-based sale sessions. |
theme |
object |
No | Visual overrides — see Theming section below. |
onReady |
function |
No | Called when the form is ready. Receives { sessionId }. |
onComplete |
function |
No | Called when a transaction reached the payment gateway. Receives the full transaction object with success: true for approved transactions and success: false for declined transactions. |
onError |
function |
No | Called when an SDK error, session error, or other non-transaction error occurs. Receives a standard error object with code, status (Rejected or Interrupted), message, and timestamp. |
The return value is a MountController with a single method:
unmount()— removes the component, wallet buttons, event listeners, and cleans up all SDK state.
Theming
Pass a theme object to customize the payment form appearance. Theme values are applied as CSS custom properties on the Shadow DOM host and propagated to hosted card fields.
ic.payment.v1.mount({
sessionId: "...",
container: "#payment-container",
theme: {
primary: "#7c3aed",
primaryHover: "#6d28d9",
borderRadius: "8px",
textColor: "#111827",
},
});
Response Examples
onComplete receives the full transaction object for transactions that reached the payment gateway (both approved and declined). onError receives a standard error object for SDK errors, session errors, and other non-transaction failures.
Example Approved Transaction (onComplete)
{
"success": true,
"id": "trx_01J2F0EKHC7HY2R93C8ENBD1FG",
"timestamp": "2025-06-02T23:56:18.2102020Z",
"type": "Sale",
"status": "Completed",
"referenceId": "ref_s192i49i",
"orderNumber": "order_number_1234",
"invoiceNumber": "inv_12345678",
"requestedAmount": 1000,
"approvedAmount": 1000,
"balanceAmount": 0,
"paymentMethod": {
"id": "pmt_vrt_01JRZPTWS99Z7RB57Q1CVWSWDS",
"type": "Virtual",
"currency": "USD",
"description": "Online Checkout Iframe"
},
"accountHolder": {
"id": "ach_01JRZQ1A2B3C4D5E6F7G8H9J0K",
"externalId": "ext_customer_123",
"contact": {
"name": "Jane Doe",
"countryCode": "US",
"zipCode": "30303",
"address": "123 Peachtree St",
"address2": "Suite 200",
"state": "GA",
"city": "Atlanta"
}
},
"transactionResponses": [
{
"responseCode": 1,
"amountApproved": 1000,
"cardType": "VISA",
"paymentMethod": {
"id": "pmt_tok_01JRZQ2B3C4D5E6F7G8H9J0KL"
}
}
],
"resultCode": 0,
"resultText": "APPROVED"
}
Example Declined Transaction (onComplete)
{
"success": false,
"id": "trx_01J2F0EKHC7HY2R93C8ENBD1FG",
"timestamp": "2025-06-02T23:56:18.2102020Z",
"type": "Sale",
"status": "Completed",
"referenceId": "ref_s192i49i",
"orderNumber": "order_number_1234",
"invoiceNumber": "inv_12345678",
"requestedAmount": 1000,
"approvedAmount": 0,
"balanceAmount": 0,
"paymentMethod": {
"id": "pmt_vrt_01JRZPTWS99Z7RB57Q1CVWSWDS",
"type": "Virtual",
"currency": "USD",
"description": "Online Checkout Iframe"
},
"transactionResponses": [
{
"responseCode": 2,
"amountApproved": 0,
"cardType": "VISA",
"paymentMethod": {
"id": "pmt_tok_01JRZQ2B3C4D5E6F7G8H9J0KL"
}
}
],
"resultCode": 3000,
"resultText": "DECLINED"
}
Example Session Error (onError)
{
"code": 3201,
"status": "Rejected",
"message": "Failed to retrieve session data",
"traceId": "1-6838bcce-5c0074e82ac7170d4f990d87",
"timestamp": "2025-06-02T23:56:18.2102020Z"
}
Example SDK Error (onError)
{
"code": 6000,
"status": "Interrupted",
"message": "Payment processing failed",
"timestamp": "2025-06-02T23:56:18.2102020Z"
}
SDK Error Codes
The SDK uses a dedicated range of numeric error codes from 6000 to 6999. These codes are reported to the onError callback and are also sent to the server for observability.
General (6000–6099)
| Code | Name | Description |
|---|---|---|
| 6000 | SdkGenericError | Catch-all for unexpected SDK errors |
| 6001 | SdkJavaScriptError | Unexpected JavaScript runtime error |
Session (6100–6199)
| Code | Name | Description |
|---|---|---|
| 6100 | SdkSessionLoadFailed | Failed to fetch session data from the API |
| 6101 | SdkSessionExpired | The payment session timed out |
| 6102 | SdkSessionNotInitialized | Session or component not yet initialized |
Card / Tokenization (6200–6299)
| Code | Name | Description |
|---|---|---|
| 6200 | SdkCardFieldsInvalid | One or more hosted card fields failed validation |
| 6201 | SdkCardTokenizationFailed | Card tokenization request failed |
| 6202 | SdkCardInitFailed | Hosted card fields failed to initialize |
| 6203 | SdkCardProcessingFailed | Card payment API call failed |
ACH (6300–6399)
| Code | Name | Description |
|---|---|---|
| 6300 | SdkAchFieldsInvalid | ACH form fields failed validation |
| 6301 | SdkAchProcessingFailed | ACH payment API call failed |
EFT (6400–6499)
| Code | Name | Description |
|---|---|---|
| 6400 | SdkEftProcessingFailed | EFT payment API call failed |
Wallet (6500–6599)
| Code | Name | Description |
|---|---|---|
| 6500 | SdkWalletError | Error during Apple Pay or Google Pay flow |
| 6501 | SdkWalletProcessingFailed | Wallet payment API call failed |
Third-party SDK (6600–6699)
| Code | Name | Description |
|---|---|---|
| 6600 | SdkThirdPartySdkLoadFailed | Failed to load an external SDK (e.g. SafeCharge) |
Form / Validation (6700–6799)
| Code | Name | Description |
|---|---|---|
| 6700 | SdkFormValidationFailed | General form validation failure |
| 6701 | SdkBillingValidationFailed | Billing address fields failed validation |
3D Secure (6800–6899)
3DS-specific codes are surfaced on declined card transactions via the transaction's resultCode (and, correspondingly, on the failure redirect URL's errorCode query parameter and the JS SDK's onComplete callback payload). They let merchants distinguish a 3DS-driven decline from a generic issuer decline or an unrelated SDK error. Only emitted when the session was initiated with formConfig.enable3DSecure: true.
| Code | Name | Description |
|---|---|---|
| 6800 | Sdk3dsAuthenticationFailed | Issuer's ACS rejected the 3DS cardholder authentication (card auth failed, security failure, stolen card, suspected fraud, transaction not permitted, etc.). Hard decline — retrying the same card without 3DS is unlikely to succeed. |
| 6801 | Sdk3dsAuthenticationUnavailable | 3DS authentication could not be completed due to an upstream technical issue (ACS timeout, directory server unreachable, unexpected ACS error). Retrying later may succeed; retrying without 3DS is only safe if merchant policy allows. |
| 6802 | Sdk3dsNotEnrolled | The card is not enrolled in 3DS (Nuvei reason 13). Retry with 3DS disabled — if allowed by merchant policy — will succeed. |