Gravity
  • Welcome to Gravity
  • Getting Started
  • Stack
  • Updates
  • Rules For AI
  • Troubleshooting
  • Gravity Server
    • Introduction
    • Installation
      • Install Node.js
      • Database Setup
      • Stripe Setup
      • Mailgun Setup
      • Install Gravity
    • Application Structure
    • REST API
      • API Scopes
      • Webhooks
    • Authentication
      • Email Verification
      • Social Sign On
      • Two-Factor Authentication
    • Authorization
      • Feature Access and Plan Restrictions
      • Permissions (Roles)
    • Config
    • Environment Variables
    • Database Queries
    • Handling Errors
    • Logging
    • Localization
    • Push Notifications
    • Email Notifications
    • User Feedback
    • User Onboarding
    • File Uploads
    • Billing
      • Seat Billing
      • Usage Billing
    • Free Accounts
    • CLI Toolbelt
    • Testing
    • AI Tools
    • Background Jobs
    • Deployment
  • Gravity Web
    • Introduction
    • Tailwind & SCSS
    • Routing
    • Events
    • Authentication
    • Localization
    • Hooks
      • useAPI
      • usePlans
      • usePermissions
    • Components
      • Alert
      • Animate
      • Avatar
      • Badge
      • Breadcrumb
      • Button
      • Calendar
      • Card
      • Chart
      • Checklist
      • Credit Card
      • Detail
      • Dialog
      • Dropdown
      • Feedback
      • Form
      • Grid
      • Header
      • Helper
      • Icon
      • Image
      • Layout
      • Link
      • List
      • Loader
      • Logo
      • Nav
      • Onboarding
      • Pagination
      • Popover
      • Progress
      • Row
      • Search
      • Separator
      • Sheet
      • Social
      • Stat
      • Table
      • Tabs
      • Toast (Notification)
      • Tooltip
      • User
      • View
    • Views
    • Handling Errors
    • Deployment
  • Gravity Native
    • Introduction
    • Prerequisites
    • Installation
    • App Context
    • Authentication
    • Localisation
    • External Linking
    • Handling Errors
    • Navigation
    • Config
    • Events
    • Views
    • Components
      • Badge
      • Blankslate
      • Button
      • Card
      • Chart
      • Form
      • Global
      • Grid
      • Icon
      • List
      • Logo
      • Message
      • Modal
      • Nav
      • Notification
      • Progress Bar
      • Search
      • Separator
      • Social
      • Stat
      • View
    • Push Notifications
    • Payments
    • Building Your App
  • Mission Control
    • Introduction
    • Installation
    • User Management
    • Feedback
    • Events
    • Logs
  • Website Template
    • Introduction
    • Environment Variables
    • Styling
    • Components
      • Article
      • Feature List
      • Footer
      • Hero
      • Layout
      • Pricing
      • Meta Data
      • Nav
      • Testimonial
    • Build and Deploy
Powered by GitBook
On this page
  • Trials
  • Failed Payments
  • Handling Cancelled Subscriptions
  • 3D Secure Authentication

Was this helpful?

  1. Gravity Server

Billing

PreviousFile UploadsNextSeat Billing

Last updated 6 months ago

Was this helpful?

Gravity comes with subscription payments out-of-the box using .

Users enter their credit card when they sign up and will be billed each month. To allow users to sign up without a credit card, please see the section on .

and are also supported out-of-the-box.

Trials

If you'd like to offer a trial period before a user's card is charged, add a trial_period_days value to the Stripe plan in .

trial_period_days: 5

This is only applied when a user first signs up and selects a plan, not when they upgrade to a paid plan. You can enable this functionality by passing trial_period_days to the stripe.customer.subscribe method.

Failed Payments

If a card payment fails, Stripe will retry to charge the card as per your and email the customer. If a customer needs to update their card details, Stripe will include a link to your billing settings.

Configure your billing link in Stripe to: so the customer can log into your app and update their card.

Handling Cancelled Subscriptions

If all retries have failed, then the subscription is marked as cancelled.

The default behaviour is to inform the user the next time they sign in and prompt them to create a new subscription or choose the free plan.

3D Secure Authentication

Strong Customer Authentication (SCA) is included with Gravity - you don't need to do anything to activate it.

When charging a European card, the customer's bank may ask for further verification. If this happens, a 3D secure pop-up will be displayed and the user can perform the validation in-app.

This will send an email to the customer to complete the verification. They will also be directed to the billing view the next time they log into your app and will see a message to check their email and verify the payment.

If a subscription payment requires verification while the user is off-app you should enable the Send a Stripe-hosted link for cardholders to authenticate when required option in your .

Stripe
free accounts
Seat billing
usage billing
config
subscription settings
https://yourdomain.com/account/billing
Stripe settings