# Stripe Setup

Gravity handles the hard work of creating and managing subscriptions in your application, you just need to [create a Stripe account](https://dashboard.stripe.com/register) and configure a few settings before you can start processing payments.

{% hint style="warning" %}
While you can run Stripe in test mode without an SSL certificate, you will need one before you can use Stripe in your live application.
{% endhint %}

## 1. Register Your Stripe Account

Head over to[ Stripe and create your account](https://dashboard.stripe.com/register). Setup is free – you'll only be charged a small fee on each transaction that you process.

## 2. Activate Test Data

Once you've registered and signed in to your account, you'll be presented with your Stripe dashboard.

Stripe has two development modes:&#x20;

1. Test
2. Live&#x20;

Test mode is a great feature that enables you to build and test your payment engine without using  real credit cards. You can use test card numbers to test different scenarios and error messages.

Go ahead and toggle the **Test Mode** switch at in the main left menu to start working in test mode.

{% hint style="info" %}
When using Stripe in test mode, you can use the test credit card details:

**Card Number:** 4242 4242 4242 4242\
**Expiry Date:** 04 32\
**CCV:** 424\
**Postcode:** 42424
{% endhint %}

## 3. Create a Product

Next, click on **Products** and click the + **Add Product** button.

Enter a product name (the name of your application), description and statement descriptor here, which is the name that will appear on your customer's credit card statement (it's only required in live mode).

## 4. Add Pricing Plans

Next, create your pricing plan(s).&#x20;

{% hint style="info" %}
Use something easy to identify, lik&#x65;**:** **plan\_startup** to make your life easier when coding the back-end of your application.
{% endhint %}

Select **Standard pricing,** set the price and currency and set the interval to **recurring** to create a subscription. You can also set the billing period here.

<div align="left"><img src="https://3357577683-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LlnrBGdA8s50Vnplq1j%2Fuploads%2FcL1aoEuEK6sSKaIcULQp%2Fstripe_pricing.png?alt=media&#x26;token=4525cc64-2e33-4516-8803-16e87c48ef55" alt="" width="276"></div>

## 5. Copy The API Keys

Finally, make a note of the API keys. \
\
Stripe has two API keys:&#x20;

1. Publishable Key (used client-side)
2. Secret Key (used server-side)

There are two sets of keys for working with live data and test data. \
\
During development, you'll use the test API keys, but when you deploy your application – ensure you switch these to the live keys.

Click on **Developers** > **API Keys**

Copy the API keys somewhere safe for now. You'll need them soon.

That's it for Stripe. There are a lot of other options you can customise. Please refer to the [Stripe Documentation](https://stripe.com/docs) for further information.
