<div id="integration-guide">

<div class="ig-section" id="migration-overview">
<div class="ig-section-header">
<div class="ig-section-icon" style="background:#eff6ff;color:#2563eb;"><i class="fas fa-exchange-alt"></i></div>
<h2>Migrating from RPG &amp; SecurePay</h2>
</div>
<p class="ig-section-desc">This section is for <strong>partners and platforms</strong> that take payments on behalf of merchants through Teya's legacy online payments platform — RPG (Borgun Payment API), SecurePay, B-Gateway or the Ticket API — and need to move those merchants to the new platform. It explains what is changing, the order to do things in, and which guide applies to each of your integrations.</p>

```admonition
icon: fas fa-store
title: Migrating your own business, not other merchants?
content: If you built the integration for your own website, the Businesses section has the same guides written for a single store.
link: /online-payments/migration/overview
```

<!-- What is changing -->
<div class="ig-subsection">
<h3>What is changing</h3>
<p>Teya's legacy online payment systems — SecurePay, the RPG payment API, the B-Gateway web service and the Ticket API — continue to work as normal today. Onboarding new merchants to them will stop soon, and they will be <strong>retired in early 2027</strong>. Every integration still on them needs to be moved to the new Teya online payments platform before then.</p>
<p>The new platform is live and processing payments across Teya's markets. It replaces per-request signatures with OAuth credentials, browser-side confirmations with signed webhooks, and self-built 3D Secure with authentication that is handled for you. Everything you build for one merchant works for all of them — only the credentials differ.</p>
</div>

<!-- Sequence -->
<div class="ig-subsection">
<h3>The migration in three stages</h3>
<p>Migrating a merchant base is not one switch. Do it in this order, and each stage de-risks the next.</p>

<div class="ig-flow-steps">
<div class="ig-flow-step"><span class="ig-flow-step-num">1</span> Build and test a fresh integration</div>
<span class="ig-flow-arrow"><i class="fas fa-arrow-right"></i></span>
<div class="ig-flow-step"><span class="ig-flow-step-num">2</span> Verify it with one merchant</div>
<span class="ig-flow-arrow"><i class="fas fa-arrow-right"></i></span>
<div class="ig-flow-step"><span class="ig-flow-step-num">3</span> Migrate existing merchants and stored cards</div>
</div>

<h4>1. Build and test a fresh integration</h4>
<p>Integrate with the new platform as if you were a new partner, using a staging partner account and development stores from your Teya partner contact. Nothing on the legacy platform changes while you do this, and you need no merchant credentials yet. Cover every flow your merchants use today — checkout, refunds, payment status, and stored-card charging if you offer it — and test each with <a href="/partners/online-payments/testing">test cards in staging</a>.</p>
<ul>
<li>Start from the <a href="/partners/online-payments/overview">partner overview</a> to choose the integration: <a href="/partners/online-payments/embedded-components/overview">Embedded Components</a> for most RPG and B-Gateway integrations, <a href="/partners/online-payments/hosted-checkout/get-started">Hosted Checkout</a> for redirect-style SecurePay flows, <a href="/partners/online-payments/pay-by-link/api">Pay By Link</a> for Ticket API flows.</li>
<li>Use the migration guides below for the <em>differences</em> — what replaces what, and the traps a legacy integration falls into.</li>
</ul>

<h4>2. Verify it with one merchant</h4>
<p>Before touching your existing base, prove the integration end to end in production with a single store: either <a href="/partners/online-payments/register-merchants">onboard a new merchant</a> through the registration flow, or migrate one existing merchant using the credentials route below. Run real payments, a refund, and confirm the webhook arrives and verifies. Keep that merchant's legacy integration available for a day or two in case you need to roll back.</p>

<h4>3. Migrate existing merchants and stored cards</h4>
<p>With one merchant live, the rest is repetition: obtain credentials for each store, switch its traffic, verify, and retire its legacy credentials. Stored cards and recurring payments are migrated last, on their own track, once every merchant's new-card flow is already on the new platform — see the <a href="/partners/online-payments/migration/stored-cards">stored cards and recurring guide</a>.</p>
</div>

```admonition
icon: fas fa-robot
title: Building with an AI coding assistant?
content: <a href="/partners/online-payments/migration/ai-assistant">Migrate with an AI assistant</a> has ready-made prompts for stage 1 (inventory your legacy integration and build the new one), the per-store credentials step, stored cards, and raising questions with Teya — plus a single downloadable file containing this whole section for the assistant to read. Worth a look before you start; it can save your team a lot of time.
```

<!-- Credentials -->
<div class="ig-subsection">
<h3>Credentials for existing merchants</h3>
<p>On the new platform every store has its own OAuth client credentials, issued to you when the merchant is registered on your platform. For merchants you already serve, you don't want to ask each one to re-onboard:</p>

<div style="overflow-x:auto;">
<table class="ig-comparison">
<thead>
<tr><th>Your merchants today use</th><th>How you get their new credentials</th></tr>
</thead>
<tbody>
<tr><td><strong>RPG</strong> (you hold each merchant's private key)</td><td><a href="/partners/online-payments/migration/rpg-credentials">Exchange the RPG key</a> for a Client ID and Client Secret, one call per store. No merchant involvement.</td></tr>
<tr><td><strong>SecurePay</strong> (you post to SecurePay with each merchant's gateway ID)</td><td>Register each merchant through the <a href="/partners/online-payments/register-merchants">registration flow</a> — the merchant approves once from their Teya account. To migrate a large merchant base, talk to your Teya partner contact about the approach.</td></tr>
<tr><td><strong>B-Gateway</strong> (you hold a username, password and <code>MerchantID</code> per merchant)</td><td>Register each merchant through the <a href="/partners/online-payments/register-merchants">registration flow</a>. If you hold B-Gateway credentials for many merchants, talk to your Teya partner contact about the approach.</td></tr>
<tr><td><strong>Your own Teya credentials only</strong> (a single legacy merchant account)</td><td>You are a merchant for this purpose — see <a href="/online-payments/migration/overview">the Businesses migration section</a>.</td></tr>
</tbody>
</table>
</div>

```admonition
icon: fas fa-key
title: One set of credentials per store
content: Credentials are never shared across merchants. Store each merchant's <code>client_id</code>, <code>client_secret</code>, <code>store_id</code> and webhook public key against that merchant, exactly as you do for merchants registered through the standard flow.
```
</div>

<!-- Which guide -->
<div class="ig-subsection">
<h3>Which guide applies to you</h3>
<p>Most platforms have more than one legacy integration. Take each row that applies and follow its guide; they share the same structure and the same credentials.</p>

<div style="overflow-x:auto;">
<table class="ig-comparison">
<thead>
<tr><th>Legacy integration</th><th>Typical signs in your code</th><th>Migrate to</th><th>Guide</th></tr>
</thead>
<tbody>
<tr><td><strong>RPG payment API</strong></td><td>Calls to <code>/api/payment</code>, <code>/api/mpi/v2/…</code>; a private key per merchant; your own 3D Secure handling</td><td>Embedded Components (or the direct API where components have no equivalent)</td><td><a href="/partners/online-payments/migration/rpg-embedded-components">RPG → Embedded Components</a></td></tr>
<tr><td><strong>B-Gateway web service</strong></td><td>SOAP/XML requests such as <code>getAuthorization</code> to <code>gateway01.borgun.is</code>; a username, password and <code>MerchantID</code> per merchant; card numbers reach your servers</td><td>Embedded Components (Hosted Checkout as an alternative)</td><td><a href="/partners/online-payments/migration/bgateway-checkout">B-Gateway → Embedded Components</a></td></tr>
<tr><td><strong>SecurePay redirect</strong></td><td>A form posted to <code>securepay.borgun.is</code> with a <code>checkhash</code>; customers pay on a Teya-hosted page</td><td>Hosted Checkout</td><td><a href="/partners/online-payments/migration/securepay-hosted-checkout">SecurePay → Hosted Checkout</a></td></tr>
<tr><td><strong>SecurePay embedded</strong></td><td><code>displaymode=iframe</code>; the payment form sits inside your checkout page</td><td>Embedded Components</td><td><a href="/partners/online-payments/migration/securepay-embedded-components">SecurePay → Embedded Components</a></td></tr>
<tr><td><strong>Ticket API</strong></td><td>Payment URLs created in advance and sent to customers</td><td>Pay By Link</td><td><a href="/partners/online-payments/migration/ticket-api-payment-links">Ticket API → Payment Links</a></td></tr>
<tr><td><strong>Stored cards / recurring</strong></td><td>Multi-use tokens (<code>tm_…</code>) or virtual card numbers (<code>991001…</code>) charged without the customer present</td><td>Card on File</td><td><a href="/partners/online-payments/migration/stored-cards">Stored cards &amp; recurring</a></td></tr>
</tbody>
</table>
</div>

```admonition
icon: fas fa-plug
title: Do you maintain a plugin for an ecommerce platform?
content: If your merchants install your plugin (WooCommerce, OpenCart, Magento, PrestaShop …) rather than integrating with you as a service, the same guides apply to the plugin's code, and each merchant's credentials arrive through the <a href="/partners/online-payments/register-merchants">registration flow</a> when they connect. Tell your Teya partner contact which platform you build for so a <code>plugin_type</code> can be assigned.
```
</div>

<!-- Guides -->
<div class="ig-subsection">
<h3>Migration guides</h3>
<p>Each guide starts with a short, non-technical summary you can forward to a merchant or a product owner, followed by the developer guide: how it works before and after, a table of what replaces what, and the migration steps with the one request you need at each.</p>

<div class="ig-nav-cards">
<a href="/partners/online-payments/migration/rpg-embedded-components" class="ig-nav-card">
<div class="ig-nav-card-icon" style="background:#fef7f0;color:#ea580c;"><i class="fas fa-puzzle-piece"></i></div>
<div class="ig-nav-card-content">
<h4>RPG → Embedded Components</h4>
<p class="ig-card-subtitle">For direct RPG API integrations</p>
<p>Replace <code>/api/payment</code> and your MPI calls with a checkout session and a component; 3D Secure and Apple Pay are handled for you.</p>
</div>
</a>

<a href="/partners/online-payments/migration/bgateway-checkout" class="ig-nav-card">
<div class="ig-nav-card-icon" style="background:#fef7f0;color:#ea580c;"><i class="fas fa-server"></i></div>
<div class="ig-nav-card-content">
<h4>B-Gateway → Embedded Components</h4>
<p class="ig-card-subtitle">For SOAP/XML B-Gateway integrations</p>
<p>Replace <code>getAuthorization</code>, your card form and any 3D Secure flow with a checkout session and the Checkout component; save cards for subscriptions and charge them by API.</p>
</div>
</a>

<a href="/partners/online-payments/migration/securepay-hosted-checkout" class="ig-nav-card">
<div class="ig-nav-card-icon" style="background:#f0f7ff;color:#008BB9;"><i class="fas fa-external-link-alt"></i></div>
<div class="ig-nav-card-content">
<h4>SecurePay → Hosted Checkout</h4>
<p class="ig-card-subtitle">For redirect-style SecurePay integrations</p>
<p>The like-for-like path: one server-side call replaces the signed form post, and the customer still pays on a Teya page.</p>
</div>
</a>

<a href="/partners/online-payments/migration/securepay-embedded-components" class="ig-nav-card">
<div class="ig-nav-card-icon" style="background:#fef7f0;color:#ea580c;"><i class="fas fa-window-maximize"></i></div>
<div class="ig-nav-card-content">
<h4>SecurePay → Embedded Components</h4>
<p class="ig-card-subtitle">For iframe integrations, or to upgrade the checkout</p>
<p>Keep the payment form on your page. Includes a comparison to help you choose between Hosted Checkout and Embedded Components.</p>
</div>
</a>

<a href="/partners/online-payments/migration/ticket-api-payment-links" class="ig-nav-card">
<div class="ig-nav-card-icon" style="background:#fef3c7;color:#d97706;"><i class="fas fa-link"></i></div>
<div class="ig-nav-card-content">
<h4>Ticket API → Payment Links</h4>
<p class="ig-card-subtitle">For pre-created payment URLs</p>
<p>Create links by API or in the Business Portal, get paid by webhook.</p>
</div>
</a>

<a href="/partners/online-payments/migration/stored-cards" class="ig-nav-card">
<div class="ig-nav-card-icon" style="background:#f0faf0;color:#16a34a;"><i class="fas fa-id-card"></i></div>
<div class="ig-nav-card-content">
<h4>Stored cards &amp; recurring</h4>
<p class="ig-card-subtitle">Cross-path: do this last</p>
<p>Stop creating legacy tokens, run both platforms side by side, then let each legacy token convert itself on first use. No customer re-enters a card.</p>
</div>
</a>
</div>
</div>

<!-- Reference -->
<div class="ig-subsection">
<h3>Reference: what replaces what</h3>
<ul>
<li><a href="/partners/online-payments/migration/rpg">Migrating from RPG</a> - Every RPG endpoint and its replacement on the new platform</li>
<li><a href="/partners/online-payments/migration/securepay">Migrating from SecurePay</a> - Every SecurePay form parameter and its replacement</li>
<li><a href="/partners/online-payments/migration/bgateway">Migrating from B-Gateway</a> - Every B-Gateway operation and field and its replacement</li>
<li><a href="/partners/online-payments/migration/rpg-credentials">RPG Credentials Migration</a> - The credential exchange API</li>
</ul>
</div>

<!-- Ground rules -->
<div class="ig-subsection">
<h3>Whichever path you take</h3>
<div class="ig-features">
<div class="ig-feature"><i class="fas fa-check"></i> <span><strong>Test first.</strong> Every guide rehearses the full flow in staging with test cards before any real traffic moves.</span></div>
<div class="ig-feature"><i class="fas fa-check"></i> <span><strong>Nothing switches until you switch it.</strong> Legacy integrations keep working in parallel while you build, and for a safety window after each merchant moves.</span></div>
<div class="ig-feature"><i class="fas fa-check"></i> <span><strong>Migrate one-off payments before stored cards.</strong> The stored-card migration assumes each merchant's new-card flow is already on the new platform.</span></div>
<div class="ig-feature"><i class="fas fa-check"></i> <span><strong>Start early.</strong> The work is the same in early 2027 as it is now; doing it now means doing it calmly, with support.</span></div>
</div>

```admonition
icon: fas fa-life-ring
title: Need help?
content: Your Teya partner contact can provision staging accounts and development stores, agree the credentials route for your merchant base, and plan the stored-card import. For integration questions, see <a href="/support">Support</a>.
```
</div>

<!-- Next steps -->
<div class="ig-subsection">
<h3>Next steps</h3>
<ul>
<li><a href="/partners/online-payments/overview">Partner overview</a> - Choose your integration and set up your partner account</li>
<li><a href="/partners/online-payments/register-merchants">Register Your Merchants</a> - The registration flow and credential model</li>
<li><a href="/partners/online-payments/migration/rpg-credentials">RPG Credentials Migration</a> - Exchange RPG keys for new credentials</li>
<li><a href="/partners/online-payments/testing">Testing</a> - Test cards and integration checklist</li>
<li><a href="/partners/online-payments/migration/ai-assistant">Migrate with an AI assistant</a> - Prompts and a downloadable pack for LLM-assisted migrations</li>
<li><a href="/partners/online-payments/migration/faq">Migration FAQ</a> - Timelines, merchant-base questions, what is different</li>
<li><a href="/apis/online-payments/apis">API Reference</a> - Full API endpoint documentation</li>
</ul>
</div>

</div>
</div>
