<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 RPG</h2>
</div>
<p class="ig-section-desc">This guide is for <strong>partners and merchants</strong> who are currently integrated with <a href="https://test.borgun.is/rpgapi/" target="_blank" rel="noopener">RPG (Borgun Payment API)</a> and are moving to the new Teya ecommerce stack. It walks through the integration options available and maps each RPG capability to its replacement.</p>

```admonition
icon: fas fa-key
title: New credentials
content: Every integration below authenticates with new ecommerce credentials, created per store in the Business Portal — see <a href="/online-payments/authenticate">Authenticate</a>.
```

<div class="ig-subsection">
<h3>Choose your integration</h3>
<p>There are two ways to take payments on the new stack: <strong>Embedded Components</strong> and <strong>direct API integration</strong>. We highly recommend Embedded Components.</p>

<table class="ig-comparison">
<thead>
<tr><th></th><th>Embedded Components <strong>(highly recommended)</strong></th><th>Direct API</th></tr>
</thead>
<tbody>
<tr><td><strong>Integration effort</strong></td><td>Medium — drop pre-built UI components into your checkout page</td><td>High — you build the payment UI and orchestrate every call yourself</td></tr>
<tr><td><strong>Look and feel</strong></td><td>Seamlessly blends into your website, with customisable styling</td><td>Fully yours to build</td></tr>
<tr><td><strong>3D Secure</strong></td><td>Handled for you</td><td>Handled for you on the transaction flow</td></tr>
<tr><td><strong>Fraud protection</strong></td><td>Enhanced fraud protection built in — the components collect device and behaviour signals that strengthen risk decisions on every payment</td><td>Standard fraud checks only</td></tr>
</tbody>
</table>

<p>With Embedded Components you keep full control of your checkout page while the components handle card capture, 3D Secure and Apple Pay for you. See the <a href="/online-payments/embedded-components/overview">Embedded Components overview</a> to explore what they look like.</p>

<p>Use the direct API only where components have no equivalent, such as collecting merchant-initiated payments on stored cards.</p>
</div>

<div class="ig-subsection">
<h3>What replaces what</h3>
<p>The table below covers the RPG operations documented in the <a href="https://test.borgun.is/rpgapi/" target="_blank" rel="noopener">RPG API reference</a> and where each one lives on the new stack.</p>

<table class="ig-comparison">
<thead>
<tr><th>RPG capability</th><th>RPG endpoints</th><th>New integration</th></tr>
</thead>
<tbody>
<tr>
<td><strong>Authentication</strong></td>
<td>HTTP Basic with a private key</td>
<td><a href="/online-payments/authenticate">Authenticate</a> — OAuth client credentials, issued per store, exchanged for a bearer access token.</td>
</tr>
<tr>
<td><strong>Card payments</strong> (incl. 3D Secure)</td>
<td><code>POST /api/payment</code><br><code>POST /api/mpi/v2/enrollment</code><br><code>POST /api/mpi/v2/validation</code></td>
<td><a href="/online-payments/embedded-components/checkout/get-started">Embedded checkout</a> or <a href="/online-payments/embedded-components/card/get-started">card components</a> — 3D Secure is handled for you, with no separate enrollment or validation calls.</td>
</tr>
<tr>
<td><strong>Tokenisation</strong></td>
<td><code>POST /api/token/single</code><br><code>POST /api/token/multi</code></td>
<td><a href="/online-payments/saved-payments/overview">Card on File</a> — save a customer's payment method during a payment or with a zero-amount account verification.</td>
</tr>
<tr>
<td><strong>Apple Pay</strong></td>
<td><code>POST /api/payment</code> with a wallet token</td>
<td><a href="/online-payments/embedded-components/apple-pay/get-started">Embedded Apple Pay component</a> — Apple Pay support without hosting your own wallet integration.</td>
</tr>
<tr>
<td><strong>MIT / collection payments</strong></td>
<td><code>POST /api/payment</code> with a multi-use token</td>
<td><a href="/online-payments/saved-payments/charge">Charge a Saved Payment Method</a> — a merchant-initiated transaction on a stored card via the direct API.</td>
</tr>
<tr>
<td><strong>Refunds, captures &amp; cancellations</strong></td>
<td><code>PUT /api/payment/{id}/refund</code><br><code>PUT /api/payment/{id}/capture</code><br><code>PUT /api/payment/{id}/cancel</code></td>
<td><a href="/online-payments/payment-actions">Payment Actions</a> — capture with <code>POST /v1/transactions/{id}/capture</code> and refund with <code>POST /v3/refunds</code>. There is no separate cancel: a refund on an uncaptured payment reverses the authorisation, replacing the RPG cancel.</td>
</tr>
<tr>
<td><strong>Payment notifications</strong></td>
<td><code>GET /api/events/{eventId}</code></td>
<td><a href="/online-payments/webhooks">Webhooks</a> — signed notifications pushed to your platform in real time.</td>
</tr>
</tbody>
</table>

```admonition
icon: fas fa-id-card
title: RPG tokens: don't re-collect cards
content: Tokens minted on RPG cannot be charged on the new platform as they are — but your customers never need to re-enter a card. Teya imports your stored cards and each legacy token upgrades itself on its first charge. See <a href="/online-payments/migration/stored-cards">Migrating stored cards &amp; recurring payments</a>.
```
</div>

<!-- Next steps -->
<div class="ig-subsection">
<h3>Next steps</h3>
<ul>
<li><a href="/online-payments/migration/rpg-embedded-components">RPG → Embedded Components guide</a> - Step-by-step migration of a direct RPG integration</li>
<li><a href="/online-payments/migration/overview">Migration overview</a> - All migration paths and guides</li>

<li><a href="/online-payments/embedded-components/sdk-initialization">SDK initialization</a> - Set up the embedded components SDK</li>
<li><a href="/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>
