# Build a payment app

Connect a payment provider to Tringify checkout without sharing merchant credentials.

A payment app connects Tringify checkout to a merchant's payment-provider account. Your app creates the provider payment and returns the provider-owned payment experience. Tringify then asks your app for the outcome, which your app reads live from the provider each time; your app keeps no payment results of its own and never reports them. When your provider notifies your app, it only asks Tringify to check now.

## Before you begin

You need a Tringify app, an HTTPS service, a development store, and provider test credentials when the provider offers a sandbox. A Standard app is normally the right choice unless the integration also creates a sales channel. Keep all provider credentials in your app; do not place them in Tringify settings or return them from an endpoint.

## Permissions and lifecycle delivery

The payment contract requires `read_payment_sessions`, `write_payment_sessions`. Use **Add and save required permissions** in the provider editor so the scopes become part of the app draft. Configure the app's signed lifecycle webhook before testing: Tringify delivers each installation's scoped token there and uses the same endpoint for later scope rotations. Merchants see new permissions before installing or accepting an update.

## Build the integration

- Implement the connection-readiness endpoint so each connected merchant account reports its verified identity, test or live mode, health, and enabled currencies.
- Implement all five operations: charge, status, cancel, refund (full and partial) and refund status (see [Describe your payment app](/apps/providers/payment/declaration#https-endpoints)).
- Verify every Tringify signature against the exact raw request body before parsing it, reject stale requests, and make retries idempotent.
- Return one documented provider-owned browser handoff for each accepted payment attempt.
- Answer status and refund status from the provider's live state. When the provider notifies your app, verify the notification and send Tringify an empty wake for that attempt or refund; see [Payment results and refunds](/apps/providers/payment/results).
- Exercise successful, failed, pending, repeated, expired, full-refund, and partial-refund flows on a development store.
- Run provider checks, submit a higher app release for review, and explicitly publish it after approval. Existing merchants accept any required permission update before using the new revision.

> If your provider offers a sandbox, declare support for test accounts and complete your first checkout with a test connection. A test connection cannot be mistaken for a live one.

