<div id="integration-guide">

<div class="ig-section">
<div class="ig-section-header">
<div class="ig-section-icon hosted"><i class="fas fa-paint-brush"></i></div>
<h2>Customize Hosted Checkout</h2>
</div>
<p class="ig-section-desc">Configure the hosted checkout page to match your brand and business needs.</p>

<div class="ig-subsection">
<h3>Branding</h3>
<p>The hosted checkout page automatically displays your store branding as configured in the <a href="https://business.teya.com/settings" target="_blank" rel="noopener">Teya Business Portal</a>. This includes your store name and logo.</p>
</div>

<div class="ig-subsection">
<h3>Checkout &amp; receipt customisation</h3>
<p>The following options can be configured in the Teya Business Portal. These settings apply across all hosted checkout sessions for your store.</p>

<table class="ig-comparison">
<thead>
<tr><th>Setting</th><th>Description</th><th>Where it appears</th><th>Required</th></tr>
</thead>
<tbody>
<tr><td><strong>Message on checkout</strong></td><td>A custom message shown to the customer before they pay. Use this for order context, instructions, or any terms the customer should see.</td><td>Hosted checkout page</td><td>No</td></tr>
<tr><td><strong>Message on receipt</strong></td><td>A custom message shown after a successful payment. Use this for confirmation notes, next steps, or contact details.</td><td>Receipt page</td><td>No</td></tr>
<tr><td><strong>Privacy policy URL</strong></td><td>A link to your privacy policy. Customers can review how their data is handled before completing payment.</td><td>Hosted checkout page</td><td>No</td></tr>
<tr><td><strong>Terms &amp; conditions URL</strong></td><td>A link to your terms and conditions, displayed alongside the privacy policy link.</td><td>Hosted checkout page</td><td>No</td></tr>
</tbody>
</table>
</div>

<div class="ig-subsection">
<h3>Session options</h3>
<p>These parameters are set per session when calling the <a href="/apis/online-payments/apis">Create Session API</a>:</p>

<table class="ig-comparison">
<thead>
<tr><th>Parameter</th><th>Description</th><th>Required</th></tr>
</thead>
<tbody>
<tr><td><code>amount</code></td><td>Payment amount in minor units (e.g. 1000 = 10.00)</td><td>Yes</td></tr>
<tr><td><code>type</code></td><td>Transaction type - <code>SALE</code>, <code>PRE_AUTHORISATION</code>, or <code>ACCOUNT_VERIFICATION</code></td><td>Yes</td></tr>
<tr><td><code>save_payment_method</code></td><td>Tokenizes the card so you can charge it again later. See <a href="#saving-a-payment-method">Saving a payment method</a></td><td>No</td></tr>
<tr><td><code>success_url</code></td><td>URL to redirect after successful payment</td><td>No</td></tr>
<tr><td><code>cancel_url</code></td><td>URL to redirect if customer cancels</td><td>No</td></tr>
<tr><td><code>line_items</code></td><td>Array of order line items with description, quantity, and unit price</td><td>No</td></tr>
<tr><td><code>merchant_reference</code></td><td>Your internal order reference for reconciliation</td><td>No</td></tr>
<tr><td><code>metadata</code></td><td>Custom key-value pairs stored with the session</td><td>No</td></tr>
</tbody>
</table>
</div>

<div class="ig-subsection">
<h3>Amount field structure</h3>
<p>The <code>amount</code> object in the session request uses two fields:</p>

<table class="ig-comparison">
<thead>
<tr><th>Field</th><th>Type</th><th>Description</th><th>Example</th></tr>
</thead>
<tbody>
<tr><td><code>amount.value</code></td><td>Integer</td><td>Payment amount in the smallest currency unit</td><td><code>5000</code> = &euro;50.00</td></tr>
<tr><td><code>amount.currency</code></td><td>String</td><td>ISO 4217 currency code</td><td><code>"EUR"</code>, <code>"GBP"</code></td></tr>
</tbody>
</table>

```admonition
icon: fas fa-info-circle
title: Smallest currency unit
content: For currencies with two decimal places (EUR, GBP, USD), multiply the amount by 100. For example, &euro;50.00 is <code>5000</code> and &pound;9.99 is <code>999</code>.
```
</div>

<div class="ig-subsection">
<h3>Saving a payment method</h3>

```admonition
icon: fas fa-exclamation-triangle
title: Consent comes first
content: Before you store a card, you must obtain and record the customer's agreement to save it and charge it again. That agreement — often called a mandate — defines when, how often, and for how much you can charge the card. It is what makes the later merchant-initiated payments valid.
```

<p>Set <code>save_payment_method</code> to <code>true</code> when you create the session. The customer enters their card on the Teya-hosted page, so 3D Secure runs there and the card number never touches your systems.</p>

<p>Two fields work together on the session. <code>save_payment_method</code> is what mints the token; <code>type</code> decides what the customer sees on the hosted page:</p>

<table class="ig-comparison">
<thead>
<tr><th><code>type</code></th><th><code>amount.value</code></th><th>What the hosted page shows</th></tr>
</thead>
<tbody>
<tr><td><code>ACCOUNT_VERIFICATION</code></td><td><code>0</code></td><td>Saves the card without charging it. The pay button shows no price.</td></tr>
<tr><td><code>SALE</code></td><td>The real amount</td><td>Saves the card alongside a real payment.</td></tr>
</tbody>
</table>

<p>If you send <code>type: ACCOUNT_VERIFICATION</code> with <code>save_payment_method: false</code>, Teya verifies the card but saves nothing.</p>

```json
{
  "type": "ACCOUNT_VERIFICATION",
  "save_payment_method": true,
  "amount": { "value": 0, "currency": "EUR" },
  "success_url": "https://mywebsite.com/account/cards/saved",
  "cancel_url": "https://mywebsite.com/account/cards"
}
```

<p>The token arrives on the <code>payment.succeeded.v1</code> webhook as <code>data.token_response.token_id</code>. Store it alongside <code>data.payment_method.brand</code> and <code>last4</code> so you can render &ldquo;Mastercard &bull;&bull;&bull;&bull;4065&rdquo; in your UI.</p>

<p>See <a href="/partners/online-payments/saved-payments/overview">Card on File</a> for the consent rules and the wider flow, and <a href="/partners/online-payments/saved-payments/charge">Charge a Saved Payment Method</a> for charging the token.</p>
</div>

<div class="ig-subsection">
<h3>Full API reference</h3>
<p>For complete endpoint documentation including all request and response fields, see the <a href="/apis/online-payments/apis">Online Payments API Reference</a>.</p>
</div>

<div class="ig-subsection">
<h3>Session expiry</h3>
<p>Checkout sessions expire after 15 minutes. Once expired, the customer will see an error page if they try to access the checkout URL. Create a new session if needed.</p>
</div>

</div>
</div>
