Ionic Blocks
Use a Payment Block when you own the checkout page and the Pay button. Your backend creates a PaymentIntent, and the browser receives its client secret and confirms it through Ionic. The Ionic Blocks guide covers intent ownership, mounting, confirmation results, consent, and events.connectedMerchantId is the receiving merchant’s Ionic mer_… ID, returned by
your backend, which created the PaymentIntent for the same merchant with
Ionic-Account or the server SDK’s { account } option. The client keeps that
merchant for mounting, confirmation, and status checks; create a separate client
to collect for another merchant.
See both sides in Accept payments for connected accounts.
Build with test keys, then follow Going live when the flow
works end to end. mountPaymentFields remains available for tokenization-only
integrations; see Advanced card fields.
Install
Install@ionicfi/js with npm,
which is included with Node.js:
Use Blocks with npm
confirmSetup
with a SetupIntent to save a card without charging. Call
blocks.destroy() when your payment view unmounts. The
Blocks reference lists every option, event, and
error code.
Embedded checkout
Create a checkout session on your server withui_mode: "embedded", return it
to your frontend, and mount it. Include an element with id="payment-message"
and role="status" next to the checkout for error messages:
id, client_secret, and embed_url from the session your
backend returns. It keeps the client secret out of the iframe URL and sends it
only after the checkout document reports that it is ready.
Apple Pay
PassapplePay: true to render an Apple Pay button above the card form:
Script tag
The SDK is also available without a bundler:Versioning
0.x releases may introduce breaking changes without a major version bump.
What’s next
Build a payment page
Mount a Payment Block and confirm a PaymentIntent.
Embed checkout
Mount a complete checkout session in your page.
Use the React component
Render embedded checkout with
<CheckoutEmbed>.
