Web SDK - RTAF Mode
How to use the ReadyRemit Web SDK in Real Time Account Funding (RTAF) mode
Overview
Real Time Account Funding (RTAF) mode enables direct account-to-card funding through the ReadyRemit Web SDK. When RTAF mode is enabled, the SDK routes the user directly to the fund page, bypassing the standard remittance transfer flow.
RTAF mode is configured by adding the sdkRtaf property to the initialization payload alongside the standard sdkCore and sdkFeatures properties. For general Web SDK setup (iframe, snippet, core options, theming), see the Web SDK Integration Guide.
Initialization
To enable RTAF mode, include the sdkRtaf object in your initialization payload with rtafMode set to true.
SDKRtafOptions
| Property | Description | Type | Required |
|---|---|---|---|
| rtafMode | Enable RTAF flow (routes directly to fund page) | boolean | Yes (set to true) |
| rtafAccountCreated | Account creation status | boolean | No |
| rtafFundingAmount | Pre-set funding amount in cents (e.g. 10000 = $100.00) | number | No |
| rtafMinAmount | Minimum allowed funding amount in cents | number | No |
| rtafMaxAmount | Maximum allowed funding amount in cents | number | No |
| fundingAccount | Pre-selected funding source account | SourceAccount | No |
rtafFundingAmountandrtafMinAmount/rtafMaxAmountare mutually exclusive. Pass either a fixedrtafFundingAmountor artafMinAmount/rtafMaxAmountrange, but not both.
Account Passing: RTAF vs. Remittance
In Remittance mode, accounts are passed via virtualSenderAccounts. See the Web SDK Integration Guide for details.
In RTAF mode, the account is passed as a single pre-selected fundingAccount object inside sdkRtaf. The SDK uses this account directly for the funding flow — no dropdown selection is presented.
fundingAccount (SourceAccount)
| Property | Description | Type | Required |
|---|---|---|---|
| alias | A user-friendly name for the account (e.g., "Main Checking") | string | No |
| last4 | Last four digits of the account number | string | No |
| balance | Not used in RTAF mode | number | No |
| srcProviderId | Your internal reference for the account | string | Yes |
Code Example
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<script src="https://sandbox-sdk.readyremit.com/scripts/snippet.min.js"></script>
<title>ReadyRemit RTAF Example</title>
</head>
<body>
<iframe
id="readyremit-iframe"
src="https://sandbox-sdk.readyremit.com"
allow="clipboard-read; clipboard-write; camera"
width="100%"
height="100%"
style="display: none;"
title="Account Funding"
></iframe>
<script>
const customerId = "{'<this will be provided by ReadyRemit>'}";
const resources = "{'<encrypted resources, this should be generated in the customer backend>'}";
window.rremit.init(
{
sdkCore: {
customerId,
resources,
language: "en-US",
},
sdkFeatures: {
darkMode: false,
},
sdkRtaf: {
rtafMode: true,
rtafFundingAmount: 50000,
rtafMinAmount: 1000,
rtafMaxAmount: 100000,
fundingAccount: {
alias: "Main Checking",
last4: "1234",
balance: 100000,
srcProviderId: "your-internal-account-id"
}
}
},
async (eventPayload) => {
try {
// RTAF eventPayload.transfer shape:
// {
// quoteBy: "SEND_AMOUNT",
// amount: number, // Amount in cents
// sourceAccountId: string, // AFT source account id
// quoteId: string, // Quote history id
// nonce: string, // Idempotency nonce
// }
//
// Post to your backend → call POST /account-funding-transfers
// Example:
// let fundingResponse = postFundingToServer(eventPayload.transfer, resources);
// let transferId = fundingResponse.transferId;
window.rremit.completed(transferId);
} catch (error) {
window.rremit.failed(error);
}
}
);
// Listen for the funding-completed message when user clicks "Continue"
// on the Confirmation or Pending page
window.addEventListener("message", function (event) {
if (event.data?.type === "readyremit-funding-completed") {
const { transferId } = event.data.payload || {};
// Persist the result, update your UI, or close the iframe
}
});
</script>
</body>
</html>RTAF vs. Remittance eventPayload
The eventPayload received by the onCreateCallback has a different transfer shape in RTAF mode compared to standard Remittance mode. For the standard Remittance eventPayload structure, see the Web SDK Integration Guide.
RTAF eventPayload
{
language: string; // e.g. "en-US"
transfer: {
quoteBy: "SEND_AMOUNT"; // Fixed value for RTAF
amount: number; // Amount in cents (e.g. 10000 = $100.00)
sourceAccountId: string; // AFT source account id
quoteId: string; // Quote history id from SDK quote step
nonce: string; // Server-side nonce for idempotency
};
clientVersion: string;
}- Host calls POST
/account-funding-transfers(not/transfers) - No
recipientIdorrecipientAccountId - Uses
quoteId(notquoteHistoryId),amount,sourceAccountId, andnonce
Detecting RTAF payloadPresence of
quoteId,amount, andsourceAccountId, and absence ofrecipientId, indicates an RTAF (account-funding) request rather than a standard transfer.
RTAF Response Handling
After receiving the eventPayload and calling your backend, notify the SDK with one of three responses:
| Response | Method | Description |
|---|---|---|
| Success | rremit.completed(transferId) | Transfer created successfully. The SDK shows the Confirmation page. |
| Failure | rremit.failed(error) | Transfer creation failed. The SDK displays the error to the user. |
| Pending | rremit.pending(transferId) | Transfer authorized but not yet completed. The SDK shows the Pending page. |
The pending response is specific to RTAF and is used when the funding has been authorized but final settlement is not yet confirmed.
Funding Completed Message
When the user clicks Continue on the RTAF Confirmation or Pending page, the SDK sends a readyremit-funding-completed message to the host. This message contains the transfer result payload so the host can persist it or close the iframe.
ImportantThe ReadyRemit snippet does not automatically invoke a callback for
readyremit-funding-completed. You must subscribe to themessageevent and handle it directly, as shown in the code example above.
Payload:
{
transferId: string;
// Any additional fields your backend returned when posting
// transfer-completed are echoed here.
}Message Reference
| Type | Direction | Description |
|---|---|---|
readyremit-create-transfer | SDK → Host | User submitted the fund form. For RTAF, payload.transfer is the /account-funding-transfers body. |
readyremit-transfer-completed | Host → SDK | Transfer created successfully. Include payload.transferId. |
readyremit-transfer-failed | Host → SDK | Transfer creation failed. Include payload.error. |
readyremit-transfer-pending | Host → SDK | RTAF authorized but not yet completed. Include payload.transferId. |
readyremit-funding-completed | SDK → Host | User clicked Continue on RTAF Confirmation/Pending page. Payload contains the transfer result. |
Updated about 8 hours ago
