How do I connect Stripe?
You need the owner or admin role and a verified MFA session. Use your live Stripe account: test keys are refused and test mode events are ignored.
- In Manalens, open Settings, Integrations, Stripe, and click Create webhook URL.
- In the Stripe Dashboard, add a webhook endpoint with that URL. Select invoice.paid, checkout.session.completed, checkout.session.async_payment_succeeded, payment_intent.succeeded, charge.refunded, customer.subscription.created, customer.subscription.updated and customer.subscription.deleted.
- Create a restricted key with read access to Invoices, Charges, Subscriptions, Checkout Sessions and PaymentIntents.
- Paste the webhook signing secret and the restricted key in Manalens, then click Connect Stripe. The first sync reads the last 7 days and every current subscription.
Which Stripe payments count?
One sale is counted once. Webhook retries and the daily sync of the same payment keep one row.
- Invoices: invoice.paid records the amount paid. This covers subscriptions, invoices you send, and Checkout with invoice creation on.
- One-time Checkout payments: a paid Checkout Session in payment mode, also from a Payment Link, with no invoice. You do not need to turn on invoice creation.
- Direct payments: a payment with no Checkout and no invoice, such as a custom Payment Element flow, from payment_intent.succeeded.
- Refunds: charge.refunded records a full or partial refund as a negative amount.
How do I link Stripe payments to players?
Use one opaque player ID, not an email, in your analytics and in the checkout. Put it as user_id in the metadata of the object that the webhook reads: the Checkout Session, the invoice or the subscription. A Checkout Session with no metadata user_id uses its client_reference_id. Or send the identify trait stripe_customer_id from the game.
On a Payment Link, the buyer can change client_reference_id in the URL. When the player ID must come from your server, create the Checkout Session on your server and set metadata user_id.
Node.js, on your server
// A one-time sale. No invoice is needed.
const session = await stripe.checkout.sessions.create({
mode: 'payment',
line_items: [{ price: 'price_supporter_pack', quantity: 1 }],
client_reference_id: 'player_8f3k2', // read when metadata has no user_id
metadata: { user_id: 'player_8f3k2' },
success_url: 'https://example.com/thanks',
});How do I check the Stripe connection?
A green check shows next to Stripe when the integration is connected. Make a small real purchase and refund it. Then check both rows in Activity, and the revenue on the player profile.
Frequently asked questions
Do I need Stripe invoices for one-time game sales?
No. Manalens records a paid one-time Checkout Session from checkout.session.completed, with no invoice, also when it comes from a Payment Link. A delayed method such as a bank debit is recorded from checkout.session.async_payment_succeeded. If you turn on invoice creation, the sale is recorded once, from invoice.paid.
Can I test with Stripe test mode?
No. Test keys are refused and test mode events are ignored, so test data never mixes with real revenue. Connect your live account, make a small real purchase, then refund it. Check that the sale and the refund both show in Activity and on the player profile.
How does Manalens know which player paid?
From a user_id in the Stripe metadata of the Checkout Session, invoice or subscription, or from client_reference_id on a Checkout Session. You can also send the identify trait stripe_customer_id from the game. Use an opaque player ID, not an email, so the same ID links the game and the payment.
What happens when I disconnect Stripe?
Click Disconnect in Settings, Integrations, Stripe. Manalens removes the signing secret and the read key, and stops taking webhooks and daily syncs. Revenue that is already recorded stays in your reports. Then delete the webhook endpoint in the Stripe Dashboard, so Stripe stops sending events.