@@ -248,3 +248,95 @@ contact:
248248 - { name: name, label: "Your Name", type: text, required: true, sender_name: true, rules: { length: { min: 2, max: 80 } } }
249249 - { name: email, label: "Email", type: email, required: true, reply_to: true }
250250 - { name: message, label: "Message", type: textarea, required: true, rules: { length: { min: 10, max: 4000 } } }
251+
252+ # Payments & Subscriptions Configuration
253+ # Required only by sites that take payments (donations, memberships, ...).
254+ # Install the optional package first: composer require neuron-php/payments
255+ #
256+ # A single engine drives every payment form via the [payment form="key"]
257+ # shortcode ( [donation] is a friendly alias ). One-time payments and recurring
258+ # subscriptions are both supported; each renewal is recorded and the
259+ # subscription lifecycle ( renewals, cancellations, failed payments ) is driven
260+ # by a signed webhook at /payments/webhook.
261+ #
262+ # Keep secret_key and webhook_secret in your encrypted secrets file
263+ # (secrets.yml.enc), NOT in this committed config. Only provider/currency and
264+ # the non-secret form definitions are safe to keep here.
265+ #
266+ # Gateway keys:
267+ # provider stripe (only supported provider today)
268+ # secret_key Stripe secret API key (sk_live_... / sk_test_...)
269+ # publishable_key Stripe publishable key (pk_...), if you need it client-side
270+ # webhook_secret Stripe signing secret for /payments/webhook (whsec_...)
271+ # currency ISO 4217 currency code (default: usd)
272+ #
273+ # Form keys (under payments.forms):
274+ # purpose what the payment is for: donation (default), membership, ...
275+ # label heading shown above the form
276+ # button submit button label
277+ # to internal email notified when a payment completes
278+ # product_name line-item label shown on the Stripe Checkout page
279+ # success_message thank-you message on the success page
280+ # amounts preset amount tiers in major units (e.g. dollars)
281+ # allow_custom_amount true|false - show a "custom amount" input
282+ # min_amount minimum accepted amount in major units
283+ # frequencies allowed cadences: one_time, monthly, quarterly,
284+ # semiannual, annual (omit/[] for one-time only)
285+ # fields payer fields (same schema as contact form fields)
286+ #
287+ # Backward compatibility: a legacy top-level `donations:` section (with the same
288+ # default_form/success_url/cancel_url/forms keys) is still read if `payments`
289+ # has no forms, so existing donation configs keep working.
290+ payments:
291+ provider: stripe
292+ secret_key: ""
293+ publishable_key: ""
294+ webhook_secret: ""
295+ currency: usd
296+ default_form: general # Form rendered by a bare [payment]/[donation] shortcode
297+ success_url: "/payments/success"
298+ cancel_url: "/payments/cancel"
299+ forms:
300+ general:
301+ purpose: donation
302+ label: "Make a Donation"
303+ button: "Donate"
304+ to: "info@yourdomain.com"
305+ product_name: "Donation"
306+ success_message: "Thank you for your generous donation!"
307+ amounts: [ 25, 50, 100, 250 ]
308+ allow_custom_amount: true
309+ min_amount: 5
310+ frequencies: [ one_time, monthly, quarterly, semiannual, annual ]
311+ fields:
312+ - { name: name, label: "Your Name", type: text, required: true, sender_name: true, rules: { length: { min: 2, max: 80 } } }
313+ - { name: email, label: "Email", type: email, required: true, reply_to: true }
314+ - { name: phone, label: "Phone", type: tel, required: false }
315+
316+ # ---------------------------------------------------------------------------
317+ # Store / products ( optional )
318+ #
319+ # The catalog itself is managed in the admin ( Content > Products ), not here.
320+ # A cart purchase is recorded as a payment with purpose "order" and reuses the
321+ # same Stripe gateway, webhook ( /payments/webhook ), and admin as donations.
322+ # This section only configures the storefront return URLs and notifications.
323+ #
324+ # title heading for a bare [products] grid
325+ # currency ISO 4217 ( defaults to payments.currency )
326+ # success_url return URL after a completed order
327+ # cancel_url return URL when the buyer cancels
328+ # notification_email internal recipient for new-order notifications
329+ # notification_subject / receipt_subject optional email subject overrides
330+ #
331+ # Shortcodes:
332+ # [products] grid of active products with add-to-cart
333+ # [products limit="6"] capped grid
334+ # [product id="3"] a single product card
335+ # [product slug="t-shirt"] a single product card by slug
336+ # [cart] a cart link / summary button
337+ store:
338+ title: "Shop"
339+ currency: usd
340+ success_url: "/store/success"
341+ cancel_url: "/store/cancel"
342+ notification_email: "orders@yourdomain.com"
0 commit comments