Repository navigation
feat(payments): mountCheckout opens Paddle checkouts - #393
Draft
amitbardos wants to merge 6 commits into
Draft
amitbardos wants to merge 6 commits into
amitbardos wants to merge 6 commits into
Conversation
An embedded checkout with provider "paddle" draws a pay button that opens Paddle's overlay for the transaction. Paddle.js loads only from cdn.paddle.com, is initialized once per page with the seller's client-side token, and on Paddle's checkout.completed the SDK calls completeCheckout, which reads the transaction from Paddle, before onComplete. A closed window is onCancel and the buyer can try again; a paid checkout stays off. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
🚀 Package Preview Available!Install this PR's preview build with npm: npm i @base44-preview/sdk@0.8.63-pr.393.34b3870Prefer not to change any import paths? Install using npm alias so your code still imports npm i "@base44/sdk@npm:@base44-preview/sdk@0.8.63-pr.393.34b3870"Or add it to your {
"dependencies": {
"@base44/sdk": "npm:@base44-preview/sdk@0.8.63-pr.393.34b3870"
}
}
Preview published to npm registry — try new features instantly! |
mountCheckout takes a PaddleCheckoutOnClick ({ provider: "paddle",
createCheckout }) like PayPal's on-click mode: the button shows at once and
the checkout is created inside the click. Paddle's checkout opens in the
page rather than a popup, so it can open after the create and the buyer still
clicks once. Paddle.js initializes on the first click, for either mode.
Paddle's own "Add discount" field is hidden: the app prices discounts itself
through createCheckout, as with the other providers.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Email, country, postcode and card on one screen, so tax shows as the buyer types instead of after Continue. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The one-page checkout sits in the mount element, in the page's language when Paddle has it, instead of a full-page window. A pre-created checkout renders at once; an on-click one shows a Buy now button and renders in its place. Paddle's frame has no order summary, so onTotalsChange reports subtotal, discount, tax and total in minor units for the page to show. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
createCheckout's buyer can carry country and postal_code; the backend returns them on Paddle's embedded checkout and mountCheckout prefills Paddle with them, so Paddle works out tax at once and shows only the card. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds Paddle to
base44.payments.mountCheckout(). This goes with the backend proof of concept in base44-dev/apper#47082, wherecreateCheckouton a Paddle app returnsembedded: { provider: "paddle", client_token, transaction_id, environment, customer_email }.paddle.script_urlin/payments/config, and only fromcdn.paddle.com. It's initialized once per page with the seller's client-side token;Environment.set("sandbox")runs for sandbox transactions.checkout.completed, the SDK callscompleteCheckout, which reads the transaction from Paddle, and thenonComplete. After that the button stays off.checkout.closedcallsonCanceland the buyer can try again;checkout.errorcallsonError.PaddleEmbeddedCheckout, andpreloadCheckout("paddle").Testing
npm testpasses (489), including 4 newmountCheckoutcases for Paddle. The same flow was run by hand against a Paddle sandbox seller: a $9.80 test charge, completed throughcompleteCheckout.🤖 Generated with Claude Code