Skip to main content
Onelink renders the Stripe Payment Element on a Gr4vy-hosted page, so buyers can pay by card or with 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 before configuring Onelink. After setting up your Stripe account, make sure card payments and Stripe Link are enabled in Stripe. For shared APM credentials and payment IDs, see Stripe APM credentials.

Capabilities

Supported countries

Supported currencies

Webhooks

Onelink confirms the payment client-side, 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. The Onelink 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

Integration

The default integration for Onelink uses a redirect to a payments page hosted by Gr4vy. The same surface also supports a direct integration, where you render the Payment Element on your own web, iOS, or Android page. Billing details (name, email, phone, and address) sent on the transaction pre-fill the Payment Element and let Stripe Link recognize a returning buyer by email.

Redirect integration

Start by creating a new transaction with the following required fields.
var transaction = await client.Transactions.CreateAsync(
	transactionCreate: new TransactionCreate()
	{
		Amount = 1299,
		Currency = "USD",
		Country = "US",
		PaymentMethod =
			TransactionCreatePaymentMethod.CreateRedirectPaymentMethodCreate(
				new RedirectPaymentMethodCreate()
				{
					Method = "onelink",
					Country = "US",
					Currency = "USD",
					RedirectUrl = "https://example.com/callback",
				}
			),
	}
);
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": "onelink"
}
Redirect the buyer to the approval_url (open in a browser or web view), 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.
var transaction = await client.Transactions.CreateAsync(
	transactionCreate: new TransactionCreate()
	{
		Amount = 1299,
		Currency = "USD",
		Country = "US",
		IntegrationClient = "ios",
		PaymentMethod =
			TransactionCreatePaymentMethod.CreateRedirectPaymentMethodCreate(
				new RedirectPaymentMethodCreate()
				{
					Method = "onelink",
					Country = "US",
					Currency = "USD",
					RedirectUrl = "myapp://callback",
				}
			),
	}
);
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 that mounts the Stripe Payment Element.
POST /transactions/:transaction_id/session?token=:session_token

{
  "session_data": {
    "publishableKey": "some_key",
    "clientSecret": "client_secret",
    "returnUrl": "url_to_return_after_payment_completed",
    "stripeAccount": "acct_1OcAyNGbm1cKE2pL",
    "billingDetails": {
      "name": "Jane Doe",
      "email": "jane@example.com"
    }
  },
  "default_completion_url": "https://example.com/callback",
  "integration_client": "ios"
}
Initialize Stripe.js with the publishableKey (and stripeAccount when using Stripe Connect), mount the Payment Element from the clientSecret, and confirm the payment client-side. The billingDetails pre-fill the element when present.

Mobile redirect integration completion

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