Skip to content

HTML, JavaScript & WordPress

Published release: SDK 0.1.3 is publicly available on npm. Package installation does not activate new backend features.

HTML or WordPress with a static Buy link: create a Checkout Link in Kordiva CMS. There is no SDK installation and no Store API key for this static link.

Plain JavaScript with a dynamic cart: use @kordiva/[email protected] to validate and open the URL returned by your own protected backend:

Терминал
pnpm add @kordiva/[email protected]

React or Next.js: use @kordiva/react and @kordiva/checkout in browser components, with @kordiva/sdk and the Store API key only on the backend.

For standard HTML or WordPress, the simplest supported integration is an approved Checkout Link. Create it in Kordiva, copy the URL and place it in an anchor or WordPress Custom HTML block. Replace the example URL below with your actual approved link. No SDK or API key is required for that static link.

For a dynamic cart, a browser calls your own protected checkout endpoint. The tested JavaScript helper below accepts that request callback, an exact origin allowlist and a navigation function. Never put a store key in WordPress page HTML, a shortcode output or browser JavaScript.

The example adapter in Kordiva’s source repository is not an npm package export. Implement your own authenticated checkout endpoint using @kordiva/sdk; Next.js can use the documented Node route example. These are code samples, not a WordPress payment plugin.

Static Checkout Link payment status: Kordiva processes Stripe notifications and updates the corresponding CMS/payment records. A WordPress thank-you URL is not authoritative payment proof. For a dynamic site that needs to show payment status, use a protected Node backend and the LIVE confirmation guide. 0.1.3 supports signed Business events to a merchant backend; a static WordPress thank-you page is not a webhook receiver or payment authority.

The link does not override product availability, seller approval, tax/market restrictions or the seller model. Individual links remain one-time approved digital offers.

javascript.mjs
import { checkoutHref, redirectToCheckout } from "@kordiva/checkout";
/** @param {()=>Promise<Response>} requestCheckout @param {string[]} allowedOrigins @param {(url:string)=>void} navigate @param {import("@kordiva/checkout").CheckoutNavigationOptions} [checkoutOptions] */
export async function openCheckout(
requestCheckout,
allowedOrigins,
navigate,
checkoutOptions = {},
) {
const response = await requestCheckout();
if (!response.ok)
throw new Error("Checkout unavailable; check the order before retrying.");
const data = await response.json();
const handoff = {
url: checkoutHref({ url: data.url }, allowedOrigins, checkoutOptions),
};
redirectToCheckout(handoff, allowedOrigins, navigate, checkoutOptions);
}
HTML / WordPress
<!-- Standard HTML: replace with the approved Checkout Link copied from Kordiva.
No secret key is needed. This exact anchor also works in a WordPress Custom HTML block. -->
<a href="https://shop.example.test/q/approved-link" rel="noopener"
>Continue to secure checkout</a
>

SDK · Checkout · Security · API

Recurring checkout and subscription reads → Signed Business events → Raw-body verification → Business refunds → API reference. Individual MoR follows its separate refund process.