# Redirect to your URL using an iframe

1. You send a request via server-to-server You initiate a request to the payment gateway via server-to-server (S2S) communication. This takes place between your backend and swcpay.

Typically, the request contains the following data: Order details (amount, currency, description). Customer information (name, email, and other parameters if required).

Example request:

```json
{ 
    "Currency": "USDT", 
    "ShopId": "L9Sp6TCXh7", 
    "FiatCurrency": "USD", 
    "Email": "mail@hotmail.com",
    "AmountFiat": 999,
    "Amount": 0,
    "Name": "Cristiano",
    "Lastname": "Ronaldo",
    "ClientId": "201",
    "CheckBilling": true,
    "BillingId": "8e8d68ae-a6c6-4962-972d-42218726d737"
}
```

2. You receive a response with JSON payment details and a link to the payment form

After a successful request, swcpay sends you a JSON response with payment details. This response contains: Unique payment identifier. Details for the payment. A link to the payment form to be embedded on your page.

Example response:

```json
{
    "message": {
        "currency": "USDT",
        "amount": 1000.43,
        "amountFiat": 999,
        "fiatCurrency": "USD",
        "public": "0x6eCB2278CA08d27dE4B714613f41A59a94301BC6",
        "destinationTag": null,
        "creationDate": "2024-08-14T09:23:40.7071243Z",
        "cancelDate": "2024-08-14T09:53:40.7071243Z",
        "id": 1799,
        "paymentLink": "https://dashboard.swc-pay.com/Payment/Details/8d20f753-0dd5-4d27-9859-ec882fbb7975"
    },
    "isSuccessful": true,
    "exceptions": []
}
```

3. You display the link on your page in an iframe

Once you have the payment link, you need to embed it into your page using the element. This will ensure that the payment form hosted by swcpay is displayed directly on your website.

Example of an embedded iframe:

```markup
<iframe
src="https://dashboard.swc-pay.com/Payment/Details/8d20f753-0dd5-4d27-9859-ec882fbb7975"
  width="600"
  height="400"
  frameborder="0">
</iframe>
```

4. You display the iframe with the payment form

When the customer visits your page to complete the payment, the iframe with the payment form is loaded and displays the page with the payment parameters (card, details, etc.). All the logic of interaction with the payment gateway happens inside the iframe, and you just provide the container for it. Payment completion, payment status and other details can be passed to you via the callback URL specified in your personal account settings.

Thus, iframe allows you to embed the payment process into your website without storing sensitive data on your server, while maintaining security and user-friendliness requirements.
