Skip to content

feat(payments): support the Wix Payment Element in mountCheckout - #386

Open
OleksandrSamsonov wants to merge 3 commits into
base44:mainfrom
OleksandrSamsonov:feat/wix-embedded-checkout
Open

OleksandrSamsonov wants to merge 3 commits into
base44:mainfrom
OleksandrSamsonov:feat/wix-embedded-checkout

Conversation

@OleksandrSamsonov

@OleksandrSamsonov OleksandrSamsonov commented Nov 20, 2026 •

Copy link
Copy Markdown

What

mountCheckout() can now render an embedded Base44 Payments checkout with the Wix Payment Element.

  • Public types: one new member, WixEmbeddedCheckout { provider: "wix"; client_id; order_id }, added to the EmbeddedCheckout union and exported. No new methods or options.
  • mountCheckout() loads the element script from the payments config (wix.script_url, host tpa.wixapps.net only), mounts the element, and adds a Pay button (class base44-checkout-pay).
  • The click calls confirmPayment() synchronously. succeeded → completeCheckout(checkout_id) → onComplete. canceled (a decline included) → onCancel. A rejection → onError. The button stays mounted for a retry, ignores double clicks, and stays off after a payment, same as PayPal.
  • Locale comes from <html lang> or navigator.language.
  • JSDoc updated for the provider table, callbacks, setDisabled, and completeCheckout.

preloadCheckout() stays "paypal" | "stripe".

Tests

  • Unit tests: mount args and locale, sync confirm inside the click, success / cancel / error, double click, setDisabled, mount failure cleanup, script host check.
  • Type test: embedded.provider === "wix" narrows.
  • npm test, npm run lint, npm run build pass.

🤖 Generated with Claude Code

OleksandrSamsonov and others added 2 commits November 20, 2026 16:37
Add a WixEmbeddedCheckout member to EmbeddedCheckout. mountCheckout loads
the element script from the payments config, mounts the element with a Pay
button the SDK owns, calls confirmPayment() inside the click, then
completes the checkout and calls onComplete, as it does for PayPal.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Its mount() is async, so a failed mount now rejects mountCheckout and
cleans up instead of leaving a Pay button. Also scope payment_declined
docs to PayPal and note that Base44 Payments checkouts are completed too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@OleksandrSamsonov
OleksandrSamsonov marked this pull request as ready for review November 20, 2026 15:52
The checkout never sets it, so the element is created with intentId only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant