# Hosted funding

Hosted funding covers both enrollment and top-up. ADGT hosts the Play+ screens and they run inside your app or website: new customers enroll in your branded Play+ program, including identity verification, and existing customers top up their Play+ account with the funding methods enabled for the program. At enrollment, the new Play+ account is linked to the customer's member number on your platform.

## Launch

1. **From your server, call GetToken** with your ClientId and EntryCode and `returnType: 3`. Use `securityToken.tokenValue` from the response as the `IdentityToken` field. The token is valid for 15 minutes, so request it just before the launch. Never request a token from the customer's browser.
2. **In the customer's browser, post an HTML form** to `https://adgtpay.com/hostedfunding/`, with the form's target set to the frame or web view that shows the pages. Submit it as soon as the page loads.
3. **Handle the result** at your `ReturnURL`.


```html
<form method="post" action="https://adgtpay.com/hostedfunding/" target="adgt">
  <input type="hidden" name="IdentityToken" value="<token from GetToken>">
  <input type="hidden" name="MerchantID" value="ADGTDemo">
  <input type="hidden" name="MerchantApplication" value="DEM01">
  <input type="hidden" name="MemberNumber" value="DemoTest1">
  <input type="hidden" name="MerchantTransactionID" value="20261102081500001">
  <input type="hidden" name="MerchantName" value="ADGT Demo">
  <input type="hidden" name="FirstName" value="Test">
  <input type="hidden" name="LastName" value="Customer">
  <input type="hidden" name="DOB" value="1990-01-01">
  <input type="hidden" name="Email" value="customer@example.com">
  <input type="hidden" name="PhoneNumber" value="501234567">
  <input type="hidden" name="ReturnURL" value="https://www.example.com/play-plus-complete">
</form>
<iframe name="adgt" width="375" height="667"></iframe>
<script>document.forms[0].submit();</script>
```

All fields are described under **Hosted funding → Launch hosted funding** in the [API reference](/openapi). Required: `IdentityToken`, `MemberNumber`, `MerchantID`, `MerchantApplication`, `MerchantTransactionID` (new for every launch) and `ReturnURL`. The customer's details are optional; they pre-fill enrollment, and the customer enters anything you leave out.

If the customer already has a Play+ account, the same launch opens funding instead of enrollment.

## Transaction types

| `TransactionType` | Use |
|  --- | --- |
| `CL` (default) | Enrollment and Play+ funding. Also used if the value is not recognized. |
| `WITHDRAWFROMWAGERING` | Enrollment only, offered at cash out. ADGT does not ask the customer to fund; your platform sends **Deposit** with the winnings after enrollment. |


## Page size

Hosted funding needs a window at least **350 px wide and 600 px high**. The layout adapts to the available space and works best in a **375 × 667 px** mobile viewport.

## Return URL

When the customer finishes or cancels, ADGT redirects to your `ReturnURL` and adds:

| Parameter | Value |
|  --- | --- |
| `result` | `success`, `error` or `cancel` (the customer closed the pages before a transaction) |
| `message` | A readable error code, when `result` is `error` |
| `transactionId` | The ADGT transaction ID, when one exists (not on cancel) |


`ReturnURL` must be a complete URL: `https://www.example.com` works, `www.example.com` does not. When the pages run in a frame, ADGT can configure the redirect to stay inside the frame or to navigate the whole page; tell ADGT which you need.

## What the customer sees

1. **Loading** – the pages load inside your app or site.
2. **Terms and conditions** – an introduction to Play+ and the terms; the customer accepts to begin.
3. **Enrollment** – the customer confirms the details you passed and completes the rest, such as date of birth and Emirates ID or passport.
4. **Identity verification** – the customer photographs their Emirates ID or passport and takes a selfie; ADGT checks the document, liveness and face match.
5. **Funding source** – one of the methods enabled for the program.
6. **Amount** – entered or selected.
7. **Confirmation** – amount and fees; a saved or new funding method.
8. **Result** – the new Play+ balance, or guidance after a failure.
9. **Transfer to wagering** (optional) – if enabled, the customer moves funds straight to your Gaming Wager Account.


## Tiered fees

To charge different fees to different customer groups, give ADGT the details of each fee tier, then send the matching `TierCode` in the launch. An unknown `TierCode` makes the pages show a general load error, because the fee cannot be determined.

| Field | Description | Type | Required |
|  --- | --- | --- | --- |
| `TierCode` | Short tier identifier | String(25) | Y |
| `MerchantCode` | Your ADGT merchant code; with `TierCode`, identifies the tier | String(50) | Y |
| `ProgramCode` | The Play+ program the tier applies to | String(50) | Y |
| `FixedFee` | Fixed fee added to every transaction | Decimal(6,2) | N |
| `PercentageFee` | Percentage of the transaction amount | Decimal(6,2) | N |
| `MaximumFee` | Fee cap, whatever the amount | Decimal(6,2) | N |
| `TransactionType` | `CL` (card load) | String | Y |


## Branding

Colors, themes and custom CSS are described in [Theming](/theming).