<div id="integration-guide">

<div class="ig-section">
<div class="ig-section-header">
<div class="ig-section-icon" style="background:#eff6ff;color:#2563eb;"><i class="fas fa-map-signs"></i></div>
<h2>Migrating from SecurePay</h2>
</div>

<p class="ig-section-desc">This page is for <strong>partners and merchants</strong> who post payments to <strong>SecurePay</strong>, Teya's legacy hosted payment page, and are moving to the new online payments platform. It walks through the integration options and maps every SecurePay parameter to its replacement.</p>

```admonition
icon: fas fa-key
title: Taking payments on behalf of merchants?
content: Every integration below authenticates with new ecommerce credentials, issued per store. Register each merchant through the <a href="/partners/online-payments/register-merchants">registration flow</a>; for larger merchant bases, agree a batch approach with your Teya partner contact. See the <a href="/partners/online-payments/migration/overview">migration overview</a>.
```

<div class="ig-subsection">
<h3>Choose your integration</h3>
<p>SecurePay was used in two ways, and each has a natural successor on the new platform:</p>

<div style="overflow-x:auto;">
<table class="ig-comparison">
<thead>
<tr><th></th><th>Hosted Checkout</th><th>Embedded Components</th></tr>
</thead>
<tbody>
<tr><td><strong>Best for</strong></td><td>SecurePay <em>redirect</em> integrations — the like-for-like path</td><td>SecurePay <em>iframe</em> integrations (<code>displaymode=iframe</code>), or anyone who wants checkout to stay on their site</td></tr>
<tr><td><strong>Customer experience</strong></td><td>Redirected to a Teya-hosted page, then back to your site — as today</td><td>Pays without leaving your site; the components render inside your checkout</td></tr>
<tr><td><strong>Integration effort</strong></td><td>Low — one server-side call and a redirect</td><td>Medium — a server-side call plus a small frontend component</td></tr>
<tr><td><strong>3D Secure, Apple Pay, DCC</strong></td><td>Handled for you</td><td>Handled for you</td></tr>
<tr><td><strong>PCI scope</strong></td><td>SAQ A</td><td>SAQ A (components are hosted in iframes)</td></tr>
<tr><td><strong>Guide</strong></td><td><a href="/partners/online-payments/migration/securepay-hosted-checkout">SecurePay → Hosted Checkout</a></td><td><a href="/partners/online-payments/migration/securepay-embedded-components">SecurePay → Embedded Components</a></td></tr>
</tbody>
</table>
</div>

<p>Two related legacy services have their own successors: pre-created payment URLs (the <strong>Ticket API</strong>) become <a href="/partners/online-payments/migration/ticket-api-payment-links">Payment Links</a>, and stored cards or recurring payments follow the <a href="/partners/online-payments/migration/stored-cards">stored cards &amp; recurring guide</a>.</p>
</div>

<div class="ig-subsection">
<h3>What replaces what</h3>
<p>The biggest change: SecurePay let your site talk to Teya straight from the customer's browser with a signed form. On the new platform your <strong>server</strong> makes one API call first — creating a checkout session — and everything you used to put in the form goes in that call's JSON body. The table covers the SecurePay form parameters and where each one lives now.</p>

<div style="overflow-x:auto;">
<table class="ig-comparison">
<thead>
<tr><th>SecurePay</th><th>New platform</th><th>What it means for you</th></tr>
</thead>
<tbody>
<tr><td><strong>Authentication</strong><br><code>merchantid</code> + <code>paymentgatewayid</code>; secret key + HMAC <code>checkhash</code> on every request</td><td><code>store_id</code> (one UUID) + OAuth <code>client_id</code>/<code>client_secret</code> exchanged for a short-lived bearer token</td><td>No per-request signing. Mint a token, cache it for its <code>expires_in</code>, refresh on expiry. See <a href="/online-payments/authenticate">Authenticate</a>.</td></tr>
<tr><td><strong>Starting a payment</strong><br>HTML form posted from the browser to the SecurePay URL</td><td><code>POST /v2/checkout/sessions</code> from your server, then redirect to <code>session_url</code> (Hosted Checkout) or mount a component with <code>session_token</code> (Embedded Components)</td><td>Requires a backend. See <a href="/partners/online-payments/hosted-checkout/get-started">Hosted Checkout</a> or <a href="/partners/online-payments/embedded-components/checkout/get-started">Embedded checkout</a>.</td></tr>
<tr><td><code>amount</code> as a decimal string, e.g. <code>54,43</code></td><td><code>amount.value</code> as an <strong>integer in minor units</strong>, e.g. <code>5443</code></td><td>Multiply by 100 for EUR, GBP, CZK, HUF; ISK has no decimals — 100 ISK is <code>100</code>.</td></tr>
<tr><td><code>currency</code></td><td><code>amount.currency</code></td><td>Same ISO 4217 alphabetic codes.</td></tr>
<tr><td><code>orderid</code> (12 characters), <code>reference</code></td><td><code>merchant_reference</code> (free-form) + <code>metadata</code> (key/value)</td><td>Keep writing your legacy order ID into <code>metadata</code> during the transition if it helps reconciliation.</td></tr>
<tr><td><code>language</code></td><td><code>language</code> (BCP 47, e.g. <code>is-IS</code>, <code>cs-CZ</code>)</td><td>Optional — auto-detected from the customer's browser.</td></tr>
<tr><td><code>buyername</code>, <code>buyeremail</code></td><td><code>customer.name</code>, <code>customer.email</code>, <code>customer.phone_number</code></td><td>Prefills the checkout form.</td></tr>
<tr><td><code>pagetype=1</code> (collect address/phone/email)</td><td><code>required_customer_fields</code>, e.g. <code>["SHIPPING_ADDRESS", "PHONE", "EMAIL"]</code></td><td>Explicit per field; returned in the session lookup.</td></tr>
<tr><td><code>itemdescription_n</code>, <code>itemcount_n</code>, <code>itemunitamount_n</code></td><td><code>line_items[].description</code>, <code>.quantity</code>, <code>.unit_price</code></td><td>A JSON array; unit price in minor units; shown to the customer.</td></tr>
<tr><td><code>returnurlsuccess</code></td><td><code>success_url</code></td><td>A browser redirect after payment — a UX affordance, never payment confirmation.</td></tr>
<tr><td><code>returnurlcancel</code></td><td><code>cancel_url</code></td><td>Rendered as a "Back" option on the checkout.</td></tr>
<tr><td><code>returnurlerror</code></td><td><code>failure_url</code> (terminal errors only)</td><td>Declined cards stay on the checkout so the customer can retry with another card.</td></tr>
<tr><td><strong>Payment confirmation</strong><br><code>returnurlsuccessserver</code> POST with <code>orderhash</code></td><td><a href="/partners/online-payments/webhooks">Webhook</a> <code>payment.succeeded.v1</code>, RSA-signed, or <code>GET /v2/checkout/sessions/{session_id}</code></td><td>Same purpose, verified with a public key instead of a shared-secret hash. Never trust the browser redirect to confirm success.</td></tr>
<tr><td><code>skipreceiptpage=1</code></td><td><code>post_success_payment: "REDIRECT"</code></td><td>Go straight to your own success page instead of Teya's receipt page.</td></tr>
<tr><td><code>merchantlogo</code>, page texts</td><td>Business Portal settings (logo, checkout and receipt messages, legal URLs)</td><td>Configured once per store, not sent per payment. See <a href="/partners/online-payments/hosted-checkout/customize">Customize</a>.</td></tr>
<tr><td><code>displaymode=iframe</code></td><td><a href="/partners/online-payments/embedded-components/overview">Embedded Components</a></td><td>Hosted Checkout does not support iframe embedding.</td></tr>
<tr><td>Verified by Visa / Mastercard SecureCode setup</td><td>Automatic 3D Secure</td><td>No code, no configuration.</td></tr>
<tr><td>Dynamic Currency Conversion</td><td>Automatic</td><td>Offered when the card currency differs from the transaction currency.</td></tr>
<tr><td><em>(no equivalent)</em></td><td>Pre-authorisation and capture: <code>type: "PRE_AUTHORISATION"</code>, then <code>POST /v1/transactions/{id}/capture</code></td><td>New capability. See <a href="/partners/online-payments/payment-actions">Payment Actions</a>.</td></tr>
<tr><td>Refunds via portal or manual process</td><td><code>POST /v3/refunds</code>, or the Business Portal with no code</td><td>Partial and multiple refunds; a refund on an uncaptured payment reverses it. See <a href="/partners/online-payments/payment-actions">Payment Actions</a>.</td></tr>
<tr><td>Ticket API (pre-created payment URLs)</td><td><a href="/partners/online-payments/pay-by-link/api">Payment Links</a></td><td>See <a href="/partners/online-payments/migration/ticket-api-payment-links">Ticket API → Payment Links</a>.</td></tr>
<tr><td>SecurePay tokenisation / recurring</td><td><a href="/partners/online-payments/saved-payments/overview">Card on File</a></td><td>See <a href="/partners/online-payments/migration/stored-cards">Migrating stored cards &amp; recurring payments</a>.</td></tr>
</tbody>
</table>
</div>

```admonition
icon: fas fa-search
title: Finding the SecurePay code in your codebase
content: Search for <code>borgun.is</code>, <code>securepay</code>, <code>checkhash</code>, <code>orderhash</code>, <code>merchantid</code>, <code>paymentgatewayid</code>, <code>returnurlsuccess</code>, <code>returnurlsuccessserver</code>, <code>itemdescription_</code>, <code>skipreceiptpage</code>, <code>displaymode</code>. Each hit is a line on your migration to-do list — and <code>displaymode=iframe</code> tells you which guide to follow.
```
</div>

<!-- Next steps -->
<div class="ig-subsection">
<h3>Next steps</h3>
<ul>
<li><a href="/partners/online-payments/migration/securepay-hosted-checkout">SecurePay → Hosted Checkout</a> - The like-for-like migration, step by step</li>
<li><a href="/partners/online-payments/migration/securepay-embedded-components">SecurePay → Embedded Components</a> - Keep the checkout on your site</li>
<li><a href="/partners/online-payments/migration/overview">Migration overview</a> - All migration paths and guides</li>
<li><a href="/partners/online-payments/testing">Testing</a> - Test cards and integration checklist</li>
<li><a href="/apis/online-payments/apis">API Reference</a> - Full API endpoint documentation</li>
</ul>
</div>

</div>
</div>
