# Payment Terminal

Payment Terminal is a separate service which can help you to display your deposit address as a web page or embed it into your website as an i-frame.

As a merchant you need to generate a GET URL with a set of the established parameters according to the requirements below and redirect a user via that link to Payment Terminal. Data available for the user includes address and QR-code, currency and deposit amount (in case ‘amount’ parameter was sent).An example of implementation of Payment Terminal with i-frame

![An example of implementation of Payment Terminal with i-frame](https://1425667093-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MRshBMv9xFR-yIXF3oi%2F-MRsi6TbBX8EgNtePsPc%2F-MRt7If5N1TTfTk20Q92%2Fwallexpay_iframe_ready_02.png?alt=media\&token=ca4bad1a-b1e9-4e13-9a23-1cc53a97e03c)

![An example of implementation of Payment Terminal without i-frame](https://1425667093-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MRshBMv9xFR-yIXF3oi%2F-MRsi6TbBX8EgNtePsPc%2F-MRt7NeQS7wbIf6iGJMn%2Fwallexpay_iframe_ready_01.png?alt=media\&token=6d0ea976-d61b-46fe-b905-85a1b2d5a77f)

Once the user makes a deposit, it will be processed according to common deposit flow.

### Payment terminal workflow representation <a href="#payment-terminal-workflow-representation" id="payment-terminal-workflow-representation"></a>

![](https://gblobscdn.gitbook.com/assets%2F-L_wez5sfbmITmO009kC%2F-MGJbTLHlGqSNydsYQ0w%2F-MGJeBmr_K0okEuJcqH6%2Fimage.png?alt=media\&token=ec2cb7de-6157-44b8-be30-1bbbf9f8b728)

## Creating a request <a href="#creating-a-request" id="creating-a-request"></a>

You need to create a request which contains hash with two required parameters: data and signature.

The request address:

**<https://terminal.wllxpay.io/?'data> and signature'**

### **Data parameter generation** <a href="#data-parameter-generation" id="data-parameter-generation"></a>

You need to form JSON with [the following parameters](https://wallexpay.gitbook.io/api-doc/api-documentation/api-reference#payment-terminal-json-parameters)​

**Example:**

```javascript
{
    "client_id":1 ,
    "url_back":"https:\/\/wallexpay.io\/?1588146480",
    "amount":0.0005,
    "foreign_id":"15881464801588146480",
    "currency":"BTC",
    "convert_to":"EUR"
}
```

You need to convert the resulting represented code in JSON to base64 format.

**Example:**

```
eyJhZGRpdGlvbmFsX3BhcmFtZXRlcnMiOnsiY2xpZW50X2lkIjoxfSwidXJsX2JhY2siOiJodHRwczpcL1wvY29pbnNwYWlkLmNvbVwvPzE1ODgxNDY0ODAiLCJhbW91bnQiOjAuMDAwNSwiZm9yZWlnbl9pZCI6IjE1ODgxNDY0ODAxNTg4MTQ2NDgwIiwiY3VycmVuY3kiOiJCVEMiLCJjb252ZXJ0X3RvIjoiRVVSIn0=
```

### **Signature parameter generation** <a href="#signature-parameter-generation" id="signature-parameter-generation"></a>

You need to:

* concatenate JSON with secret key to generate signature

**Example:**

```javascript
{
    "pay_method":"method_x",
    "user":"user1",
    "amount":32.44,
    "currency":"USD"
}
ObPvxgtazKCkQ7ifz3qzocbv9TVXeB1LUIbCsYk2WUt5agvyt1n1MhQnnCBlcwhY
```

* The calculated hmac(sha512) hash in lowercase looks like:

**Example:**

```
9e4c091dbcc9e2eca21e2e3bd6300ebec225dd0d80f4c309da9ace88000bf6da804262c1415a0b956d1d9411e05f55a547b234ce86338bc55ba58c9962ca0dad
```

As a result, the request will have the following look:

```
GET https://terminal.wallexpay.io/?data=eyJjbGllbnRfaWQiOjEsImN1cnJlbmN5IjoiQlRDIiwiZm9yZWlnbl9pZCI6MTU4OTI2ODI1N30=&signature=9e4c091dbcc9e2eca21e2e3bd6300ebec225dd0d80f4c309da9ace88000bf6da804262c1415a0b956d1d9411e05f55a547b234ce86338bc55ba58c9962ca0dad
```
