> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gr4vy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Paysquad

> Connect to Paysquad to accept push payments through the Paysquad hosted page.

Paysquad is a push payment method. The buyer is sent to a Paysquad hosted page where they complete the payment from their own account, and Paysquad notifies Gr4vy of the outcome via webhook. Buyers are not redirected back to the `redirect_url` you provided when the transaction was created.

## Setup

Paysquad does not provide self-service sign-up. Reach out to [Paysquad](https://paysquad.co) to set up a sandbox and production account.

## Credentials

When setting up Paysquad in the dashboard, configure the following credentials. You can request these details from your Paysquad Merchant Portal once you are set up with an account.

* **API Key** - Your secret API key used to authenticate requests to the Paysquad API.
* **Client ID** - Your merchant client identifier.
* **Webhook Secret** (optional) - A shared secret used to validate the signature of webhooks received from Paysquad. See [Webhooks](#webhooks) below.

## Features

Paysquad supports the following features:

* **Refunds** - Full refunds of captured transactions
* **Deep linking** - The `approval_url` can be opened directly in a mobile app
* **Transaction sync** - Automatic transaction status synchronization
* **Custom approval expiration** - The window during which a buyer can complete the payment can be customized

## Supported countries

Paysquad supports transactions from buyers in the following countries:

| Country code | Country code | Country code | Country code | Country code | Country code | Country code | Country code |
| ------------ | ------------ | ------------ | ------------ | ------------ | ------------ | ------------ | ------------ |
| `AD`         | `AE`         | `AF`         | `AG`         | `AI`         | `AL`         | `AM`         | `AO`         |
| `AQ`         | `AR`         | `AS`         | `AT`         | `AU`         | `AW`         | `AX`         | `AZ`         |
| `BA`         | `BB`         | `BD`         | `BE`         | `BF`         | `BG`         | `BH`         | `BI`         |
| `BJ`         | `BL`         | `BM`         | `BN`         | `BO`         | `BQ`         | `BR`         | `BS`         |
| `BT`         | `BV`         | `BW`         | `BY`         | `BZ`         | `CA`         | `CC`         | `CD`         |
| `CF`         | `CG`         | `CH`         | `CI`         | `CK`         | `CL`         | `CM`         | `CN`         |
| `CO`         | `CR`         | `CU`         | `CV`         | `CW`         | `CX`         | `CY`         | `CZ`         |
| `DE`         | `DJ`         | `DK`         | `DM`         | `DO`         | `DZ`         | `EC`         | `EE`         |
| `EG`         | `EH`         | `ER`         | `ES`         | `ET`         | `FI`         | `FJ`         | `FK`         |
| `FM`         | `FO`         | `FR`         | `GA`         | `GB`         | `GD`         | `GE`         | `GF`         |
| `GG`         | `GH`         | `GI`         | `GL`         | `GM`         | `GN`         | `GP`         | `GQ`         |
| `GR`         | `GS`         | `GT`         | `GU`         | `GW`         | `GY`         | `HK`         | `HM`         |
| `HN`         | `HR`         | `HT`         | `HU`         | `ID`         | `IE`         | `IL`         | `IM`         |
| `IN`         | `IO`         | `IQ`         | `IR`         | `IS`         | `IT`         | `JE`         | `JM`         |
| `JO`         | `JP`         | `KE`         | `KG`         | `KH`         | `KI`         | `KM`         | `KN`         |
| `KP`         | `KR`         | `KW`         | `KY`         | `KZ`         | `LA`         | `LB`         | `LC`         |
| `LI`         | `LK`         | `LR`         | `LS`         | `LT`         | `LU`         | `LV`         | `LY`         |
| `MA`         | `MC`         | `MD`         | `ME`         | `MF`         | `MG`         | `MH`         | `MK`         |
| `ML`         | `MM`         | `MN`         | `MO`         | `MP`         | `MQ`         | `MR`         | `MS`         |
| `MT`         | `MU`         | `MV`         | `MW`         | `MX`         | `MY`         | `MZ`         | `NA`         |
| `NC`         | `NE`         | `NF`         | `NG`         | `NI`         | `NL`         | `NO`         | `NP`         |
| `NR`         | `NU`         | `NZ`         | `OM`         | `PA`         | `PE`         | `PF`         | `PG`         |
| `PH`         | `PK`         | `PL`         | `PM`         | `PN`         | `PR`         | `PS`         | `PT`         |
| `PW`         | `PY`         | `QA`         | `RE`         | `RO`         | `RS`         | `RU`         | `RW`         |
| `SA`         | `SB`         | `SC`         | `SD`         | `SE`         | `SG`         | `SH`         | `SI`         |
| `SJ`         | `SK`         | `SL`         | `SM`         | `SN`         | `SO`         | `SR`         | `SS`         |
| `ST`         | `SV`         | `SX`         | `SY`         | `SZ`         | `TC`         | `TD`         | `TF`         |
| `TG`         | `TH`         | `TJ`         | `TK`         | `TL`         | `TM`         | `TN`         | `TO`         |
| `TR`         | `TT`         | `TV`         | `TW`         | `TZ`         | `UA`         | `UG`         | `UM`         |
| `US`         | `UY`         | `UZ`         | `VA`         | `VC`         | `VE`         | `VG`         | `VI`         |
| `VN`         | `VU`         | `WF`         | `WS`         | `XK`         | `YE`         | `YT`         | `ZA`         |
| `ZM`         | `ZW`         |              |              |              |              |              |              |

## Supported currencies

Paysquad supports processing payments in the following currencies:

| Currency code | Currency code | Currency code | Currency code | Currency code | Currency code | Currency code | Currency code |
| ------------- | ------------- | ------------- | ------------- | ------------- | ------------- | ------------- | ------------- |
| `AUD`         | `CAD`         | `CHF`         | `DKK`         | `EUR`         | `GBP`         | `HKD`         | `JPY`         |
| `MXN`         | `NOK`         | `NZD`         | `SEK`         | `SGD`         | `USD`         |               |               |

## Limitations

The following features are not supported by this connector:

* **Delayed capture** - Authorization and capture happen together
* **Partial capture** - Capturing a portion of the authorized amount is not supported
* **Partial refunds** - Refunding a portion of the captured amount is not supported
* **Void** - Canceling a transaction is not supported
* **Payment method tokenization** - Storing payment methods for future use is not supported
* **Zero auth** - Zero-dollar verification transactions are not supported
* **3-D Secure** - 3-D Secure authentication is not applicable
* **Settlement reporting** - Automatic settlement reporting is not supported

Additional push payment limitations:

* A buyer may never complete the payment, in which case the transaction expires after the approval window
* Buyers are not returned to the `redirect_url` after completing the payment, so webhooks are required to detect the final status

## Webhooks

Paysquad sends webhook events to notify Gr4vy when a payment succeeds or fails. The webhook endpoint is configured automatically when you set up the connector in the dashboard. To validate the signature of incoming webhooks, set a **Webhook Secret** value on the connector and configure the same value on the Paysquad side.

## Integration

Paysquad is a push payment method. Any Paysquad transaction created returns a `transaction` resource with a `status` of `processing` and a `payment_method.approval_url`. Display this approval URL to the buyer in a popup, iframe, or by redirecting to it.

Once the buyer completes the payment on the Paysquad hosted page, Paysquad sends a webhook to Gr4vy. The transaction status is then updated and your system is notified via a Gr4vy webhook.

Start by creating a new transaction with the following required fields.

<CodeGroup>
  ```csharp C# theme={"system"}
  var transaction = await client.Transactions.CreateAsync(
    transactionCreate: new TransactionCreate()
    {
      Amount = 1299,
      Currency = "EUR",
      Country = "NL",
      PaymentMethod =
        TransactionCreatePaymentMethod.CreateRedirectPaymentMethodCreate(
          new RedirectPaymentMethodCreate()
          {
            Method = "paysquad",
            Country = "NL",
            Currency = "EUR",
            RedirectUrl = "https://example.com/callback",
          }
        ),
    }
  );
  ```

  ```go Go theme={"system"}
  amount := int64(1299)
  currency := "EUR"
  country := "NL"
  method := components.RedirectPaymentMethodCreateMethodPaysquad
  redirectUrl := "https://example.com/callback"

  redirectPaymentMethodCreate := components.RedirectPaymentMethodCreate{
    Method: method,
    Country: country,
    Currency: currency,
    RedirectURL: redirectUrl,
  }
  paymentMethod := components.CreateTransactionCreatePaymentMethodRedirectPaymentMethodCreate(redirectPaymentMethodCreate)

  transactionCreate := components.TransactionCreate{
    Amount:        amount,
    Currency:      currency,
    Country:       &country,
    PaymentMethod: &paymentMethod,
  }

  transaction, err := client.Transactions.Create(ctx, transactionCreate, nil, nil, nil)
  ```

  ```java Java theme={"system"}
  CreateTransactionResponse transactionResponse = gr4vyClient.transactions().create()
    .transactionCreate(TransactionCreate.builder()
      .amount(1299L)
      .currency("EUR")
      .country("NL")
      .paymentMethod(TransactionCreatePaymentMethod.of(RedirectPaymentMethodCreate.builder()
        .method(RedirectPaymentMethodCreateMethod.PAYSQUAD)
        .country("NL")
        .currency("EUR")
        .redirectUrl("https://example.com/callback")
        .build()))
      .build())
    .call();

  Transaction transaction = transactionResponse.transaction().orElse(null);
  ```

  ```php PHP theme={"system"}
  $transactionCreate = new TransactionCreate(
    amount: 1299,
    currency: 'EUR',
    country: 'NL',
    paymentMethod: new RedirectPaymentMethodCreate(
      method: 'paysquad',
      country: 'NL',
      currency: 'EUR',
      redirectUrl: 'https://example.com/callback'
    )
  );
  $response = $client->transactions->create($transactionCreate);
  $transaction = $response->transaction;
  ```

  ```python Python theme={"system"}
  transaction: models.Transaction = client.transactions.create(
    amount=1299,
    currency="EUR",
    country="NL",
    payment_method={
      "method": "paysquad",
      "country": "NL",
      "currency": "EUR",
      "redirect_url": "https://example.com/callback",
    }
  )
  ```

  ```ts TypeScript theme={"system"}
  const transaction = await client.transactions.create({
    amount: 1299,
    currency: "EUR",
    country: "NL",
    paymentMethod: {
      method: "paysquad",
      country: "NL",
      currency: "EUR",
      redirectUrl: "https://example.com/callback"
    }
  })
  ```
</CodeGroup>

After the transaction is created, the API response includes a `payment_method.approval_url` and the status is set to `processing`.

```json theme={"system"}
{
  "type": "transaction",
  "id": "ea1efdd0-20f9-44d9-9b0b-0a3d71e9b625",
  "status": "processing",
  "payment_method": {
    "type": "payment-method",
    "approval_url": "https://cdn.gr4vy.com/connectors/..."
  },
  "method": "paysquad"
}
```

Display the `approval_url` to the buyer (in a popup, iframe, or redirect) so they can complete the payment on the Paysquad hosted page. Rely on webhooks to detect the final status of the transaction.
