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

# Stripe - Hosted payment page

> Configure the Stripe hosted payment page as a payment method in Gr4vy.

**Stripe**

The Stripe hosted payment page sends the buyer to a Stripe Checkout Session hosted by Stripe, where they pay with Stripe Link or any other payment method you have enabled. Unlike [Onelink](https://docs.byzly.com/connections/payments/stripe-onelink.md), which renders the Stripe Payment Element on a Gr4vy-hosted page, nothing is rendered or confirmed on a Gr4vy surface: Stripe owns the whole payment page.

By default the page offers card and Stripe Link. Stripe Link recognizes a returning buyer by their email address and lets them check out with saved details.

## Setup

Follow the [Stripe setup instructions](https://docs.byzly.com/connections/payments/stripe.md) before configuring the hosted payment page.

After setting up your Stripe account, make sure card payments, Stripe Link, and any other payment methods you intend to offer are enabled in Stripe.

For shared APM credentials and payment IDs, see [Stripe APM credentials](https://docs.byzly.com/connections/payments/stripe.md#apm-credentials).

## Configuration

### Payment method types

The **Payment method types** credential controls which methods Stripe offers on the Checkout page. Set it to a comma-separated list, for example `card, link, paypal`. Leave it blank to offer card and Link.

> [!NOTE]
>
> Stripe rejects a Checkout Session that offers Link on its own, so `card` is always included alongside `link`. If the list contains a value that is not recognized, the connector falls back to card and Link rather than sending something Stripe would reject.

## Capabilities

This list is for guidance only. It doesn't guarantee availability or
create any rights, and the provider may need to enable some features for
your account.

## Supported countries

## Supported currencies

## Webhooks

The buyer completes the payment on Stripe's page, so webhooks must be configured to keep the status of transactions in sync. Webhooks are configured in the Stripe Dashboard within Developer Settings under **Webhooks**. Each Gr4vy connection has its own webhook URL and needs its own event destination. See [Stripe webhooks](https://docs.byzly.com/connections/payments/stripe.md#webhooks).

This connector relies on the following Stripe webhooks:

* `payment_intent.canceled`
* `charge.expired`
* `charge.refund.updated`
* `charge.refunded`
* `payment_intent.succeeded`
* `payment_intent.amount_capturable_updated`
* `payment_intent.payment_failed`

## Limitations

* **No stored payment methods** - The connector does not tokenize or store payment methods, so it cannot be used for recurring payments. Use [Card via Stripe](https://docs.byzly.com/connections/payments/stripe-card.md) for stored credentials and merchant-initiated transactions.
* **Full captures only** - Partial capture is not supported. Refunds, including partial refunds, are supported.
* **Popup required** - The redirect opens in a popup rather than an inline frame, because Stripe's Checkout page cannot be embedded.

## Integration

The integration is a redirect to the Stripe-hosted Checkout page. Start by creating a new transaction with the following required fields.

```csharp C# theme={"system"}
var transaction = await client.Transactions.CreateAsync(
  transactionCreate: new TransactionCreate()
  {
    Amount = 1299,
    Currency = "USD",
    Country = "US",
    Intent = "capture",
    PaymentMethod =
      TransactionCreatePaymentMethod.CreateRedirectPaymentMethodCreate(
        new RedirectPaymentMethodCreate()
        {
          Method = "stripe",
          Country = "US",
          Currency = "USD",
          RedirectUrl = "https://example.com/callback",
        }
      ),
  }
);
```

```go Go theme={"system"}
amount := int64(1299)
currency := "USD"
country := "US"
method := components.RedirectPaymentMethodCreateMethodStripe
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,
  Intent:       gr4vy.Pointer(components.TransactionIntentCapture),
  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("USD")
    .country("US")
    .intent(TransactionIntent.CAPTURE)
    .paymentMethod(TransactionCreatePaymentMethod.of(RedirectPaymentMethodCreate.builder()
      .method(RedirectPaymentMethodCreateMethod.STRIPE)
      .country("US")
      .currency("USD")
      .redirectUrl("https://example.com/callback")
      .build()))
    .build())
  .call();

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

```php PHP theme={"system"}
$transactionCreate = new TransactionCreate(
  amount: 1299,
  currency: 'USD',
  country: 'US',
  intent: 'capture',
  paymentMethod: new RedirectPaymentMethodCreate(
    method: 'stripe',
    country: 'US',
    currency: 'USD',
    redirectUrl: 'https://example.com/callback'
  )
);
$response = self::$sdk->transactions->create($transactionCreate);
$transaction = $response->transaction;
```

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

```ts TypeScript theme={"system"}
const transaction = await gr4vy.transactions.create({
  amount: 1299,
  currency: "USD",
  country: "US",
  intent: "capture",
  paymentMethod: {
    method: "stripe",
    country: "US",
    currency: "USD",
    redirectUrl: "https://example.com/callback"
  }
})
```

After the transaction is created, the API response includes `payment_method.approval_url` and the `buyer_approval_pending` status.

```json theme={"system"}
{
  "type": "transaction",
  "id": "ea1efdd0-20f9-44d9-9b0b-0a3d71e9b625",
  "payment_method": {
    "type": "payment-method",
    "approval_url": "https://checkout.stripe.com/c/pay/cs_test_..."
  },
  "method": "stripe"
}
```

Send the buyer to the `approval_url` to complete the payment on Stripe's page. After they finish, Stripe returns them to the `redirect_url` you provided when creating the transaction and Gr4vy checks the payment intent behind the Checkout Session. Do not rely solely on the redirect - either poll the transaction or (recommended) rely on webhooks to detect the final status (for example `capture_succeeded` or failure states).

For mobile, use your app deep link for `redirect_url` (for example, `yourapp://`).

## Testing

Stripe has [instructions](https://docs.stripe.com/testing) on how to test payments, including the test cards to use on the Checkout page.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.