How Heartland payments work
Rex integrates with Heartland through the Global Payments (Portico) API. When a guest completes checkout, the card is charged directly through your Heartland merchant account.
How checkout payments work
The guest enters their credit card details on the Rex checkout page.
Rex tokenizes the card using your [Payment key] (public key). The raw card number never reaches Rex servers.
Rex sends the token, postal code, charge amount, and currency to the Heartland gateway using your [Payment secret] and [Payment URL].
Heartland processes the charge and returns a response code.
If the response code is `00` (approved), Rex creates a transaction record and confirms the reservation. Any other response code results in a payment error shown to the guest.
How refunds work
When you cancel or modify a reservation that was paid via Heartland:
Rex looks up the original Heartland transaction ID from the stored transaction record.
Rex sends a refund request to Heartland for the specified amount using the same gateway credentials.
Heartland processes the refund and Rex creates a refund transaction record.
Partial refunds are supported. Rex tracks the remaining balance on each transaction and only refunds up to what was originally charged on that transaction.
Sandbox vs. production
| Field | Description |
|---|---|
| Environment | Purpose |
| Sandbox | Testing. No real charges. Rex auto-fills test credentials when sandbox mode is on. |
| Production | Live payments. Funds are deposited to your linked bank account. |
Notes
Heartland charges are immediate β there is no separate capture step. The full amount is charged at checkout.
Rex uses the `globalpayments-api` SDK to communicate with Heartland.
If the `FAKE_PAYMENT` environment variable is set, Rex skips the Heartland API call entirely and creates a fake transaction. This is only used in development environments.
Transaction records include the Heartland transaction ID, auth code, and reference number for reconciliation.
Updated May 12, 2026
Was this helpful?