This guide explains how to test real-time funding (RTF) in the <<glossary:CV>> environment using the Program API. Do not follow this procedure to test in <<glossary:Production>>.
Along with this guide you might want to read these:
<a href="doc:about-real-time-funding" target="_blank">**About Real-Time Funding**</a> — Explanation of what real-time funding is, with use cases.
<a href="doc:creating-real-time-funding-accounts" target="_blank">**Creating Real-Time Funding Accounts**</a> — Properties of RTF accounts and how to set them up.
<a href="page:real-time-funding-transaction-examples" target="_blank">**Real-Time Funding Transaction Examples**</a> — How various RTF transaction types look in the ledger.
In this scenario you will:
Create an RTF funding account
Move funds into it
Create one or more RTF spending accounts
Simulate a card authorization and settlement
View the authorization/settlement as well as the funding transactions
Remember that the CV environment runs on <a href="ref:galileo-system-time" target="_blank">Galileo system time</a>.
As desired, download Galileo's Postman collection from the <a href="doc:postman-setup" target="_blank">Postman Setup</a> page by clicking the **Run in Postman** button.
## Set up the products
Work with Galileo to set up your RTF funding and RTF spending products in CV. Galileo recommends that you configure all of the settings that you intend to use in Production.
#### RTF funding product
At minimum, the funding product should have these characteristics:
Product otype 0
Product category 30
#### RTF spending product
At minimum, the spending product should have this characteristic:
Product category 31
## Create the accounts
Follow these steps to create an RTF funding and an RTF spending account.
### Create the RTF funding account
Call <a href="ref:post_createaccount" target="_blank">Create Account</a> with these parameters:
Parameter | Value |
`firstName ` | `RTF Funding ` |
`lastName ` | `Account1 ` |
`prodId ` | RTF funding product ID |
`businessName ` | _Required_ if `prodId ` is a business product. |
In the response, capture the `
pmt_ref_no
` (PRN) for future use.
### Activate the RTF funding account
Check the status of the RTF funding account by calling <a href="ref:post_verifyaccount" target="_blank">Verify Account</a> with this parameter:
`
accountNo:
` PRN of the RTF funding account
If the `
account_status
` is not `N
`, activate the RTF funding account by calling <a href="ref:post_modifystatus" target="_blank">Modify Status</a> with these parameters:
Parameter | Value |
`accountNo ` | `pmt_ref_no ` of the RTF funding account |
`type ` | `1 ` |
### Move funds into the RTF funding account
To move funds into the RTF funding account, call <a href="ref:post_createpayment" target="_blank">Create Payment</a> with these parameters:
Parameter | Value |
`accountNo ` | `pmt_ref_no ` of the RTF funding account |
`amount ` | `1000 ` |
`type ` | `RL ` |
### Create an RTF spending account
Call <a href="ref:post_createaccount" target="_blank">Create Account</a> with these parameters.
Parameter | Value |
`firstName ` | `Juan ` |
`lastName ` | `Garcia ` |
`prodId ` | RTF spending product ID |
`businessName ` | _Required_ if `prodId ` is a business product. |
`fundingAccountNo ` | `pmt_ref_no ` of the RTF funding account |
Capture the these values from the response:
`
pmt_ref_no
``
card_id
` (CAD)last four digits of `
card_number
`
As desired, create a second RTF spending account, such as a card with a different RTF spending account product ID.
### Activate the spending card
After creating the RTF spending card, wait 15–20 minutes before performing this step to allow the emboss process to run. Skip this step if the RTF spending product has `N
` in the third position of the XAACT parameter, such as with a <a href="doc:choose-a-card-strategy#digital-first-cards" target="_blank">Digital First</a> card or a virtual card.
Call <a href="ref:post_getcard" target="_blank">Get Card</a> with the `
pmt_ref_no
` or CAD of the RTF spending card as the `accountNo
`.Verify that the `
embossed_cards
` object is populated. If it is not, wait 5 more minutes and try again.Inside the `
embossed_cards
` object, capture the values of `expiry_date
` and `card_security_code
`.Call <a href="ref:post_activatecard" target="_blank">Activate Card</a> with these parameters:
Parameter | Value |
`accountNo ` | PRN or CAD of the RTF spending account |
`cardExpiryDate ` | `expiry_date ` as `YYYY-MM ` |
`cardSecurityCode ` | `card_security_code ` (In CV it is always 123) |
`cardNumberLastFour ` | _Optional_. Last four digits of _card_number_. If there is more than one card associated with the PRN, you must populate this parameter. |
To verify that the card has been activated, call <a href="ref:post_getcard" target="_blank">Get Card</a> with the PRN or CAD of the card for `
accountNo
`. Inside the `embossed_cards
` object you should see `status: N
`.
### View account relationship
To see the relationship between the RTF funding and RTF spending accounts, call <a href="ref:post_getrtfaccountrelationship" target="_blank">Get RTF Account Relationship</a> with this parameter:
`
accountNo:
` PRN of the RTF funding account, which returns all of the spending accounts that are associated with it.
## Perform transactions
To simulate a simple card transaction in CV, call the <a href="ref:post_createsimulatedcardauthorization" target="_blank">Create Simulated Card Authorization</a> endpoint with these parameters:
Parameter | Value |
`accountNo ` | PAN or PRN of the RTF spending card |
`amount ` | `10 ` |
`association ` | `mc_auth ` |
`merchantName ` | `Central Market ` |
`currencyCode ` | Populate this parameter only when the currency of the program is not `840 ` (U.S. dollar): `124 ` (Canada), `484 ` (Mexico), or `170 ` (Colombia). |
Capture the `
auth_id
` for future use.Settle the transaction by calling the <a href="ref:post_createsimulatedcardsettlement" target="_blank">Create Simulated Card Settlement</a> endpoint with these parameters:
Parameter | Value |
`accountNo ` | PAN or PRN of the RTF spending card |
`authId ` | The `auth_id ` from the previous endpoint response. |
`association ` | `mc_auth ` |
`amount ` | `10 ` or _blank_ |
### View the RTF transactions
To see the transactions that were created, call <a href="ref:post_getalltranshistory" target="_blank">Get All Transaction History</a> twice:
`
accountNo
` — PRN of the RTF funding account`
accountNo
` — PRN of the RTF spending account
For the RTF spending account you should see four transactions. The `auth_id
` and `source_id
` are example values only.
`trans_code ` | `amt ` | `auth_id ` | `source_id ` | `calculated_balance ` |
ADSY | 10 | 2222 | 4445 | 10 |
AUA | -10 | 2222 | 2222 | 0 |
BO5 | 10 | None | 2222 | 10 |
SE5 | -10 | 2222 | 2222 | 0 |
For the RTF funding account, you should see two transactions.
`trans_code ` | `amt ` | `auth_id ` | `source_id ` | `calculated_balance ` |
PMRL | 1000 | null | 4440 | 1000 |
ADFY | -10 | 2222 | 4444 | 990 |
#### Simulate a Visa transaction
To simulate a Visa transaction instead of the Mastercard transaction shown above, pass `association: visa
`. In the response to Get All Transaction History, the transaction codes will be:
**VIA** — Authorization
**BVA** — Backout
**VSA** — Settlement
To see details of how an RTF purchase appears across Galileo systems, see <a href="page:scenario-18-real-time-funding" target="_blank">Scenario 18: Real-Time Funding</a>.
Note
For other types of transactions, see the <a href="doc:simulating-card-transactions" target="_blank">Simulating Card Transactions</a> guide. Consult <a href="page:real-time-funding-transaction-examples" target="_blank">Real-Time-Funding Transaction Examples</a> to see how RTF transactions appear in the ledger.