Official plugins
Payments — online payments (Stripe)
Cards and PromptPay through Stripe Checkout for the Shop, Donations, Courses and your own code, confirmed by a signed webhook
On this page
The Payments plugin (payments) connects Stripe Checkout (cards, and PromptPay on Stripe Thailand accounts). Needs 2.5.0 or later.
Settings#
- Stripe secret key (
sk_live_…, orsk_test_…to try it) — stored encrypted - Site code → Settings → allowed hosts: add
api.stripe.com - In Stripe → Developers → Webhooks add the endpoint
https://<your site>/payments/stripe/webhookwithcheckout.session.completedandcheckout.session.async_payment_succeeded, then paste its Signing secret (whsec_…) - Choose the payment methods: cards, or cards and PromptPay
With the other plugins#
- Shop — a Card payment method: customers pay on Stripe's page and the order becomes Paid by itself; if the page cannot open, the order waits with a pay-again button
- Donations — Give by card, confirmed with its receipt automatically
- Courses — buy a course by card and study at once
A payment counts only when its amount matches, and each one is confirmed once. The Online payments admin page lists them.
For developers#
const { url } = plugins.call('payments', 'checkout', { ref: 'site:' + code, amount: 500, description: 'Sign-up fee',
successPath: '/thanks', cancelPath: '/apply' });
site.on('payments.paid', (p) => { /* p.ref, p.amount, p.currency, p.sessionId */ });