Skip to main content

Sign up

Stripe provides self-service sign up for sandbox accounts. To sign up for an account, visit the sign up page.

Credentials

When setting up the via Stripe connection in the dashboard, the following credentials can be configured:

Secret key

A Stripe Secret key can be found in the Stripe Dashboard within Developer Settings under API keys.

Webhook secret

A Stripe Webhook Secret can be found in the Stripe Dashboard within Developer Settings under Webhooks once webhooks have been configured (see Webhooks below).

Stripe connected account (when applicable)

If using Stripe Connect, you can set the Stripe Account ID of the connected account that you intend to use for all transactions through the connection.

Publishable key

A Stripe Publishable key is used to initialize the Gr4vy hosted web page on a redirect.

Payment IDs

When creating the transaction, the payment_service_transaction_id is the client secret, and in the extra_xids field you can find the payment intent ID as payment_id. After the transaction is approved by the user, the payment_service_transaction_id will be updated to the payment intent ID.

Webhooks

payments and refunds can be completed asynchronously, so webhooks must be configured to update the status of transactions. Webhooks are configured in the Stripe Dashboard within Developer Settings under Webhooks. The connector relies on the following Stripe webhooks:
  • charge.expired
  • charge.refund.updated
  • charge.refunded
  • payment_intent.succeeded
  • payment_intent.amount_capturable_updated
  • payment_intent.payment_failed
  • payment_intent.partially_funded
  • payment_intent.canceled
  • checkout.session.async_payment_succeeded

Integration

The default integration for via Stripe uses a redirect to a payments page hosted by Gr4vy.

Redirect integration

{
  "amount": 100,
  "currency": "USD",
  "country": "US",
  "intent": "capture",
  "payment_method": {
    "method": "{method}",
    "redirect_url": "https://example.com/callback",
    "country": "US",
    "currency": "USD"
  }
}
After the transaction is created, the API response includes a payment_method.approval_url and the status is set to buyer_approval_pending.
{
  "type": "transaction",
  "id": "ea1efdd0-20f9-44d9-9b0b-0a3d71e9b625",
  "payment_method": {
    "type": "payment-method",
    "approval_url": "https://cdn.gr4vy.com/connectors/..."
  },
  "method": "{method}"
}
Redirect the buyer to the approval_url (open in a browser or Webview), where they can complete the payment. Once the buyer completes the payment, the transaction progresses to an authorization_succeeded or capture_succeeded state.

Direct integration

If you intend to use your own hosted page, you can include an integration_client parameter set to web, ios or android when creating a new transaction.
POST /transactions

{
    "amount": 100,
    "currency": "USD",
    "country": "US",
    "intent": "capture",
    "integration_client": "web",
    "payment_method": {
    "method": "{method}",
    "redirect_url": "https://example.com/callback",
    "country": "US",
    "currency": "USD"
    }
}
After the transaction is created, the API response includes a session_token. You use this token with the session endpoint to retrieve the session data for the transaction and build a custom page.
POST /transactions/:transaction_id/session?token=:session_token

{
    "session_data": {
        "publishableKey": "some_key",
        "clientSecret": "client_secret",
        "returnUrl": "url_to_return_after_payment_completed"
    },
    "default_completion_url": "https://example.com/callback",
    "integration_client": "web"
}

Mobile redirect integration completion

On Mobile integrations you should send a GET request to the default_completion_url provided in the session response.