Paytrim

Integration checklist

The steps from choosing an integration to accepting your first live payment with Paytrim.

Use this checklist to plan your integration. Each step links to the page with the details.

Choose your integration

Your customers enter their payment details on the Paytrim hosted payment page, so card data never reaches your systems. Every payment method active in your project is available from day one.

With the hosted payment page, a payment goes like this:

  1. Your customer clicks Pay in your checkout.
  2. Your server creates an order through the API.
  3. The API returns a URL to the payment page.
  4. You redirect your customer to that URL.
  5. Your customer enters their payment details on the hosted page.
  6. The payment completes.
  7. Your customer is redirected back to your website.

Don't need a checkout at all? Send your customers a payment link.

Get your test API key

After onboarding, you get access to a project in test mode. Its API key authenticates your requests to the API. Find it in the merchant portal at https://merchant.pay.paytrim.com, under Settings > API Key.

Payments in test mode run against a sandbox: you can test every flow, but no money moves. Follow the quickstart to make your first test payment.

Keep your API key secret

Only use the API key from your server. Never put it in a browser, mobile app or public repository.

Build your integration

Make sure your integration covers these basics:

  • Create orders with an amount in the smallest currency unit and an ISO 4217 currency code.
  • Send a return_url, so your customer comes back to your website after paying.
  • Handle webhooks, and respond with a 2xx status within 4 seconds.
  • Retrieve the order from the API before you deliver. Never rely on the redirect alone. See order status.
  • Base your business logic on the order status, not on the transaction status.
  • Check the status of orders that aren't final after a while, in case a webhook is delayed or lost.
  • Handle declines and errors. See error reasons.

Add the flows your business needs, such as pre-authorizations, refunds or recurring payments.

Test every payment flow

Test each payment method you plan to offer, and each flow you've built, before you go live. Include unhappy paths: declined payments, cancelled payments, expired orders and a webhook that fails the first time.

Use the test data for card numbers and amounts that trigger specific results.

Go live

When your tests pass:

  1. Make sure your live project is active, with the payment methods you need.
  2. Replace the test API key with the API key of the live project in your production configuration.
  3. Check that the webhook URL of the live project points at your production server.
  4. Make a small real payment and refund it, to confirm the full flow works end to end.

Support

Check the FAQ for common questions and errors, and Error reasons for why a payment was declined.

On this page