npx skills add ...
npx skills add caffeinelabs/skills --skill extension-stripe
Payment support based on Stripe, supporting credit cards and debit cards
npx skills add caffeinelabs/skills --skill extension-stripe
Stripe payment extension for Caffeine AI.
This skill adds Stripe payment support using HTTP outcalls. The backend manages Stripe configuration, creates checkout sessions, and checks payment status. The frontend handles checkout flow and payment result pages.
For Stripe payment integration:
Prerequisite: You must follow extension-authorization first, as this integration depends on it.
There is the prefabricated module mo:caffeineai-stripe/stripe.mo that that cannot be modified. It provides fundamental functionality for making HTTP GET or PUT requests in the backend.
Usage:
The migration chain head:
For Stripe payment integration:
Usage:
Implement a PaymentSetup component with:
isStripeConfigured() and setStripeConfiguration()StripeConfiguration.
Implement a checkout hook:
createCheckoutSession result is needed.url. If missing, throw an error and do not redirect.Implement a Payment component with:
useCreateCheckoutSession()ShoppingItem[] as input.CheckoutSession result.CheckoutSession: This allows the user to complete the payment.window.location.href./undefined; if session.url is missing, show an error and stop.Implement a PaymentSuccess and PaymentFailure component to handle payment success or failure, respectively.
Route two specific paths to the payment status components:
The admin view offers a menu to configure Stripe. If not yet configured, it asks the admin to configure Stripe on login.
Side note: Make sure that product images are properly rendered and resized inside the product canvas.