# Setup Payment Gateway

## How to integrate with PayPal ? <a href="#how-to-integrate-with-paypal" id="how-to-integrate-with-paypal"></a>

Hubay app is integrated with PayPal gateway. To integrate your app with the payment gateway you need to have an account with Paypal.com. To apply for an account with PayPal [click here](https://www.paypal.com/ae/webapps/mpp/account-selection)​

There are two parameters to be configured in `src -> app -> common -> Config.js`

#### 1. Environment: <a href="#id-1-environment" id="id-1-environment"></a>

```
PayPal.SANDBOX
```

#### 2. ClientId: <a href="#id-2-clientid" id="id-2-clientid"></a>

```
AQMnlPwVOrcnwowKy_Xh6DCb7sLqNxumYcsG0YiBs0IMMOLD_1I-Ve7bs729H4LQSmW723BOl-qg40ba
```

You need to replace the above parameters in `Config.js` file as follows:

```
PayPal:{
    Environment: PayPal.SANDBOX, 
    ClientId: 'AQMnlPwVOrcnwowKy_Xh6DCb7sLqNxumYcsG0YiBs0IMMOLD_1I-Ve7bs729H4LQSmW723BOl-qg40ba'
  }
```

If you are running the PayPal test mode, then you need to use `PayPal.SANDBOX` otherwise you should use the production environment `PayPal.PRODUCTION`

Also you have to generate a client id. To generate for **SANDBOX** client id [click here](https://developer.paypal.com/docs/classic/lifecycle/sb_create-accounts/).

## How to integrate with Razorpay ?

To integrate your app with this payment gateway you need to have an account with razorpay.com . To apply for an account with razorpay [click here](https://razorpay.com) \
\
To configure razorpay change `RazorpayKey` with your key in  `src -> app -> common -> Config.js`

```
RazorpayKey: "rzp_test_1oesWLG5iUkyFQ",
```
