Ubipay is a payment application designed to pay your fuel sales with a private label card.
Ubipay consists of the following components:
| Mobile Application |
User will download a mobile application that will be used to register his card, locate sites and authorize transactions. |
| Payment FEP |
The payment FEP will manage the transactions, communicating the mobile application, site system and vault to ensure correct transaction processing. |
| Vault |
The vault will store the cards running separately from the FEP to enhance card data protection. The vault will connect to the card processor to authorize transactions, never sharing with the FEP and card information. |
| Card Processor |
The card processor application will be responsible for authorizing each transaction and manage cardholder credit. |
| Site application |
The site application shall receive pump authorization requests from the payment FEP and will communicate with the pumps to authorize transactions and collect sales information. |
| Use Case | Description |
|---|---|
| Application Startup and User Login |
When the application starts, it verifies that the version is current and if it requires an upgrade by sending the apiKey. |
| User Login |
The mobile application will check if the session keep alive flag is set and if the session parameters are stored. If so, then it will connect to the application to verify that the session parameters are still valid. To do this it will perform |
| Register New User |
If the mobile application need to register a new user, then the application will request a new user, by sending new user Email, Full name, Password, device ID, device platform, device name and if the user wants to keep connected when application is closed. |
| User Forgot Password |
In case the user forgets his/her password, then the mobile application will request the user email and connect to the FEP requiring a password reset to the following endpoint: |
| Register a New Card |
If the mobile application need to register a new card, then the application will request a new encryption key, by calling. |
| Delete Existing Card |
When the mobile user decides to delete a card, it will select the card token to be deleted. |
| Find Sites |
If the user wants to find sites, the mobile application shall open google maps with a radius of the application. |
| Sell Fuel |
When the user selects Sell Fuel, the application will request current location and its information. |
| View Receipts |
When the user enters the view last receipts, the application will request the FEP the last “n” receipts. |
| Configure User |
USE CASE PENDING DEVELOPMENT |
When the application starts, it verifies that the version is current and if it requires an upgrade by sending the apiKey
| API | Description |
|---|---|
| GET api/v100/Apps |
Get application status information. |
Each apiKey is unique for each application release. The application can be:
| Current |
The application is the last version available and is compatible with the current FEP release. |
| NonCurrent |
The application is NOT the last version available but it is compatible with the current FEP release. The mobile app will remind the user to upgrade the application to the latest release, but will continue to operate. |
| Obsolete |
The application is NOT the last version and is NOT compatible with the current FEP release, so it cannot proceed operation until upgraded. |
If the application is compatible, then it will request a list of available Issuers for that App. If more than one issuer is available, then the application will request the user to select the issuer from the list of available issuers.
| API | Description |
|---|---|
| GET api/v100/issuers?latitude={latitude}&longitude={longitude} |
Get the list of issuers available for the current application. |
The selected Issuer will be stored in the configuration settings to avoid asking the same question again, but enabling the user to change it if necessary. An example of this is if the user goes to another island, as each island will run its own cards, merchants, and currency.
Once the application loads, if the application has a stored session token it will send the userID and Session Token to the FEP by calling
| API | Description |
|---|---|
| GET api/v100/Users/{UserGuid} |
Get the information of the selected user. In the header, the session token must be sent. |
If the session token is valid, then the application will continue.
If the FEP rejects the session token, then the mobile application will request the user to insert credentials or create a new user.
The mobile application will check if the session keep alive flag is set and if the session parameters are stored. If so, then it will connect to the application to verify that the session parameters are still valid. To do this it will perform.
| API | Description |
|---|---|
| GET api/v100/Users/{Userguid} |
Get a previously registered user. |
Sending the session information header (see below).
If user information is returned successfully, then the application shall continue processing and the user is logged into the application.
If the request return failure (ERROR XXXX Invalid Session Token), then the application will request the user its email and login password to stablish a new session. The mobile application will connect to the FEP sending credentials to obtain a token.
| API | Description |
|---|---|
| POST api/v100/DeviceSessions |
Get a new Session Token for the user. |
The FEP will reply the session token that will be used in subsequent calls.
Subsequent calls shall include the following header:
{
"UserGUID":"sdfsdgdsfdsfs",
"SessionTK":"sdlknwlkclkdnlkndlkvdlkndv",
}
If KeepAlive is true, then the mobile application shall store the returned data between application restarts. The FEP will maintain the session alive.
FEP shall perform session garbage collection following the following rules:
| 1. |
The Keep Alive flag is false, every time a new activity is done by the user, the token expiration date time (xxx minutes) is updated accordingly. If the session has reached the expiration date time, it will be deleted. |
| 2. |
If Keep alive flag is true, the FEP will store the last application activity. After a certain time of inactivity (xxx Days), the session tokens will be deleted. |
Once successfully logged, the user shall update its tokens information by requesting the Token List:
| API | Description |
|---|---|
| GET api/v100/tokens |
Get the list of available tokens for the user. |
If the mobile application need to register a new user, then the application will request a new user, by sending new user Email, Full name, Password, device ID, device platform, device name and if the user wants to keep connected when application is closed.
| API | Description |
|---|---|
| POST api/v100/Users |
Request the creation of a new user. |
The FEP confirms the creation of the new user that will be pending until confirmed by responding to the sent email. The mobile application will store selected user id and the flag if the user wants to maintain session in the user configuration section.
The FEP application will create the new user but it will be pending activation. It will also generate a new user request record and send an email with a link to the user request item to confirm. The request will hold information related to the request and if the page is accessed the request will be executed and the user enabled.
Once the user responds to the mail, the user will be enabled for login. The Email will contain the following link:
In case the user forgets his/her password, then the mobile application will request the user email and connect to the FEP requiring a password reset to the following endpoint:
| API | Description |
|---|---|
| PUT api/v100/Users |
Change user information, including Password and PIN reset. |
The FEP application will NOT perform an immediate password reset but generate a new user request and send an email with a link to the user request item to confirm. The request will hold information related to the request and if the page is accessed the request will be executed and the password changed.
If the mobile application need to register a new card, then the application will request a new encryption key, by calling:
| API | Description |
|---|---|
| GET api/v100/appgroup/{FKAppGroup}/cardTypes |
Request a list of card types and icons. |
The FEP shall respond a list of available card types for the current issuer in use. The list will include a URL to retrieve a card information picture to be displayed at the mobile application.
Once the user selects the card type and types the card PAN to be registered, the mobile application will request an encryption token.
| API | Description |
|---|---|
| POST api/v100/cardTypes/{cardTypeID}/encryptionKeys |
Request a new encryption key to encrypt the card information to be sent to the vault. |
With the card data encrypted using the returned key and encryption method, the mobile application shall post the card information to create a new token. Two encryption Types are available:
| Encryption type 0 |
NO Encryption. A dummy key is returned but it should be ignored. Used for debugging. |
| Encryption type 1 |
RSA 1024. The application shall encrypt the data using this format and padding the resulting string using PKCS1 Padding Method. |
Notes: The host decides what encryption method will use. The application should be designed to implement new encryption methods in the future. We can implement a different encryption method at the host if the mobile development environment does not support RSA 1024 and has a library that supports another asymmetric encryption method.
| API | Description |
|---|---|
| POST api/v100/tokens |
Request a new token for the encrypted card information posted. |
The FEP will respond with a token to represent the card, and additional non-confidential information. It may also return the card balance if available from the acquirer. The mobile application shall accommodate the display of the card balance if available.
When the mobile user decides to delete a card, it will select the card token to be deleted.
The mobile application will check card balance, by sending card token information request. To obtain the card credit, the mobile application will request:
| API | Description |
|---|---|
| GET api/v100/token/{tokenFake} |
Request card information for a single Token. |
The FEP will respond with the card token information, including the card balance if available from the acquirer. The mobile application shall accommodate the display of the card balance if available.
If the Card balance is not 0 or null, the mobile application will display the remaining credit and indicate the user of the remaining credit, and that it can be consumed by using the physical card.
If confirmed, the mobile application will then connect to the FEP to request the token deletion
| API | Description |
|---|---|
| DELETE api/v100/tokens/{tokenFake} |
Deletes an existing token from the vault. |
If the user wants to find sites, the mobile application shall open google maps with a radius of the application. To obtain the site list within this area, the mobile application shall request site information by calling:
| API | Description |
|---|---|
| GET api/v100/stores?distance={distance}&storeID={storeID}&latitude={latitude}&longitude={longitude}&limit={limit} |
Get a list of sites around the user. |
The mobile application will then open a map with the sites in place. If the user changes zoom level, the request will be executed again with the distance value updated. The application pins should allow seeing information of the site, and route to destination.
The list of services will be reported by a string for which each letter will represent:
| Key | Description |
|---|---|
| G |
Gasoline. |
| D |
Diesel. |
| L |
Lubricants. |
| S |
Shop. |
| R |
Restaurant. |
| A |
Mechanical Assistance. |
| M |
Mechanical Assistance. |
| C |
Compressed Natural Gas. |
| L |
Liquified Natural Gas. |
| P |
Liquified Petroleum Gases. |
| P |
Electric Charger. |
Other services may be added to the list.
When the user selects Sell Fuel, the application will request current location and its information. For this purpose, the application will send the FEP a find sites request with current location and distance = 0, using the same entry point used to locate sites:
| API | Description |
|---|---|
| GET api/v100/stores?distance={distance}&storeID={storeID}&latitude={latitude}&longitude={longitude}&limit={limit} |
Get a list of sites around the user. |
Distance Parameter may be omitted and will be considered as 0 value.
The FEP will return a LIST of sites containing a single site if the user is within the site geo fence, and null is the user is not at the site.
If no site is returned, then the application will allow the user to manually select a site using the find sites component. Once selected, the application will request the user to confirm fuelling at this site as he is away from the location.
Once site is selected, the user will have to select PumpID (a value within 1 and the QtyPumps reported by the FEP), amount to fuel (with a default value contained in FullTankAmount configuration parameter) and payment Token (not required if user has a single token).
The application will call pumps authorize request to start sale.
| API | Description |
|---|---|
| POST api/v100/stores/{storeID}/pumps/{pumpID}/authorize |
Authorizes a new fuel transaction. The FEP will coordinate authorization with card processor and return success code. |
Possible Response Codes:
| Response Code | Description |
|---|---|
| 000 |
No Error. |
| 1xx |
Pump In Use. |
| 2xx |
Transaction Declined by Host. |
| 3xx |
Token Not Approved. |
| 4xx |
Site Communication Error. |
If 000 - No Error, Pump is authorized and ready to start fueling. At this point, the application will poll every 5 second for pump status. User may cancel the transaction until user starts fueling.
To poll pump status, the following command is sent to the FEP:
| API | Description |
|---|---|
| GET api/v100/stores/{storeID}/pumps/{pumpID} |
Obtain current Pump Transaction Status. |
Possible Pump Status
| Pump Status | Description |
|---|---|
| 9 |
Not Available. |
| 0 |
Available. |
| 1 |
Reserved. |
| 2 |
Ready to Fuel (Successfully Authorized). |
| 3 |
Fueling. |
| 4 |
Preparing Receipt. |
A successfully authorized transaction may only be cancelled if the transaction is in either Reserved or Authorized status. To cancel the transaction, the following command must be sent to the FEP:
| API | Description |
|---|---|
| DELETE api/v100/transactions/{transactionID} |
Cancel a pump authorization if fuel dispatch has not started. Cancel an Authorized Transaction. |
Possible Response Codes:
| Response Code | Description |
|---|---|
| 000 |
No Error. Transaction successfully cancelled. |
| 1xx |
Pump In Use. FEP was unable to cancel transaction. |
Once the user finishes fueling, the FEP will prepare the receipt and make it available to the user. Once the pump is back to available status 0, the mobile app may request the receipt through the receipt ID.
The mobile application shall offer the user the possibility to view the transaction receipt, depending on the value of the DisplayReceipt user configuration parameter (never, always, ask).
| API | Description |
|---|---|
| GET api/v100/transactionReceipts/{transactionID} |
Get the receipt for the selected transactionID. |
If the FEP returns card balance for the token used during the transaction (card balance is not null), then the application must request the new card balance by requesting the token info to the FEP:
| API | Description |
|---|---|
| GET api/v100/token/{tokenFake} |
Get the current token information. |
When the user enters the view last receipts, the application will request the FEP the last “n” receipts.
Note: The amount of receipts that the application will request will be configurable by the user.
To obtain the last receipts, the user will request:
| API | Description |
|---|---|
| GET api/v100/transactionReceipts?FKAppGroup={FKAppGroup}&limit={limit}&page={page} |
Get a list of N receipts for the current user. |
Limit will identify the quantity of receipts required (amount of receipts per page) and Page will define the initial receipt to be returned.
So initially, the request will be: Limit=10 and Page=0 (or no page parameter), and the FEP will reply the last 10 receipts. If the user selects to see more, then the mobile application will request Limit=10, page=1, and the FEP will return the receipts 11 to 20 ordered by last date. Receipts will only include those performed by the mobile application user.
USE CASE PENDING DEVELOPMENT
Parameters to be updated (Draft – Under development)
| Parameter | Description |
|---|---|
| FullTankAmount |
Will be initially set to the value reported by the selected Issuer (see Issuers request). Used for the user to select maximum amount to fuel. |
| ReceiptEmail |
List of users that will receive each transaction receipt. |
| ReceiptPageSize |
Qty of receipts presented per page. Default value should depend on the mobile application screen size. |
| DisplayReceipt |
Displays or not the receipt in case after each transaction. Possible values: Never, Always, Ask. |
| Password |
Reset Password. |
| PIN |
Reset PIN. |
| UserName |
Display name of the user. |