# Deprecated: Creating and Testing Stripe Integration

{% hint style="info" %}
&#x20;Stripe is **an online payment processing and credit card processing platform for businesses**. Adding this integration to your Flow allows safe and efficient processing of funds via credit card or bank and transfers those funds to the your account
{% endhint %}

## How to integrate Stripe?

### Step 1: Create a Stripe component

* Add a new component and choose **`Stripe Checkout`** as **`Component Type`**

![](https://1421794749-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MaGcfSakhqdHaWyb0T_%2F-MlW6R-pdDAFAnf6G3L3%2F-MlW7aNMU_aZPbKfvtbl%2Fstripe%20checkout.png?alt=media\&token=5b7f8006-4eec-4d87-80f3-8586b4cc62ec)

* Go to the **`Options`**&#x74;ab of the Component and select an **`Action`**

![](https://1421794749-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MaGcfSakhqdHaWyb0T_%2F-MhPmwqIZL0Vk9LMwtN1%2F-MhPnYT-0CmtphOW55Of%2Fimage.png?alt=media\&token=8a6fa623-af2b-4db4-aa10-3458bda61cbd)

* If you select **`One Time Payment`** you'll have to introduce the **`Amount`** to charge and the **`Billing Info`** that would probably be taken from inputs that have already been completed in the Flow.

![](https://1421794749-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MaGcfSakhqdHaWyb0T_%2F-MhPmwqIZL0Vk9LMwtN1%2F-MhPoed1LUk44fxBCo32%2Fimage.png?alt=media\&token=2d5f1e0d-6c41-48a8-8205-568b223d8130)

![](https://1421794749-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MaGcfSakhqdHaWyb0T_%2F-MhPmwqIZL0Vk9LMwtN1%2F-MhPoQA8PELDhRXD4r9d%2Fimage.png?alt=media\&token=be037b3e-b440-444c-a1a0-9100e7d08533)

* If you select **`Subscription`** you'll have these settings and some extra ones as **`Trial Period`**, **`Price ID`** and **`One Time Price ID.`**  These fields refer to different price settings in your Stripe account. For example, if you sell different products at different prices you should create a computed field that returns the price ID for the product selected in the Flow.

![](https://1421794749-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MaGcfSakhqdHaWyb0T_%2F-MhPoohcuAtHGos0-D-o%2F-MhPp2JfjfaD0eBH7Vw5%2Fimage.png?alt=media\&token=dda893bb-e363-4bbf-a62e-8a4c5c0f1fdf)

Example of computed field to return the Price ID

```
function result( { price_amount, } ) { 
  switch (price_amount) { 
    case '10': { 
      return { price: 'price_1JPT8TI9DDfHR2LquGl' 
      } 
    } 
    case '20': { 
      return { 
        price: 'price_1JPT8TI9DDfHR2LqSxaU' 
      } 
    } 
    case '25': { 
      return { price: 'price_1JPT8TI9DDfHR2LqHgc' 
      } 
    }
  }
}
```

### Step 2: Test the integration

* Publish the Flow
* Run two Tests:
  * Test Stripe credentials (`4242 4242 4242 4242` and `42424…` for all the other details)
  * Run through a live test of payments with real card details&#x20;
