TTS App Integration

App Definition

For your app to be recognized properly by the device, you should add the following meta-data to your AndroidManifest.xml file.

<meta-data android:name="app_name" android:value="TTS_1234_APPNAME" />
<meta-data
    android:name="app_model_type"
    android:value="1000TR" />
<meta-data
    android:name="app_version"
    android:value="1" />

Sale

Following code snippet is used by PaymentGateway in order to open payment application:

Amount : Integer: Ex: 1.25 TL is written 125

UUID: Transactions are kept with this value on Payment Gate Way and your application in case of a power cut. Payment Gate Way sends this value and waits for the return of the transaction result.

Plate: String: Ex: "34AA111"

FuelType

0

Kurşunsuz 95

1

Kurşunsuz 95-2

2

Kurşunsuz 98

3

Motorin

4

Motorin 2

5

Otogaz LPG

6

Gaz Yağı

7

Yakıt Nafta

8

LNG

9

Elektrik

10

CNG

11

ADBLUE

Manifest Modifications

To be able to get data from payment gateway, there should be intent filter like below in related class.

After the payment process, the payment application should return the result.

responseCode : Result of the payment process

amount : Integer. Amount that is charged by the payment application. If amount is less than the Broadcasted Amount by Payment Gateway, it means Partial Limit is applied.

batchNo : The current Batch No which includes current sale.

txnNo : The current Txn No of the sale in current Batch.

IsSlip: Indicates that if a payment slip will be printed or not. (true to print slip)

customerSlipData: Formatted String for card holder slip.

merchantSlipData: Formatted String for merchant slip.

Sample Code to Generate Formatted Slip String

You can receive the Z No and the Receipt No as;

Pos Settings

Following code snippet is used by PaymentGateway in order to open payment application:

Manifest Modifications

To be able to get data from payment gateway, there should be intent filter like below in related class.

After the pos settings process, the payment application should send the result.

responseCode : Return of the pos settings request.

Batch Close

Following code snippet is used by PaymentGateway in order to open payment application:

Manifest Modifications

To be able to get data from payment gateway, there should be intent filter like below in related class.

After the batch close process, the payment application should send the result.

responseCode : Return of the pos settings request.

Parameter

Following code snippet is used by PaymentGateway in order to open payment application:

Manifest Modifications

To be able to get data from payment gateway, there should be intent filter like below in related class.

After the parameter update process, the payment application should send the result.

responseCode : Return of the pos settings request.

Power Cut Inquiry

If there has been a power cut during a sale transaction, transaction is inquired after device reboot. In order to receive inquiry and return transaction information, a broadcast receiver must be registered in the Android manifest file with action "check_sale" like below:

When inquiry broadcast is received, in the broadcast receiver's onReceive() method, if transaction is successful, transaction info must be returned in a bundle like below.

If you are using SQLite database to store transactions, you should configure your database to insert record instantly when a transaction completed in case of a power cut scenario. https://www.sqlite.org/pragma.html#pragma_synchronous

To do this, in your SQLiteOpenHelper class, override onConfigure() method and add the following code:

Following code snippet is used by PaymentGateway in order to check the payment, if there is a power cut PaymentGateway checks for the last sale result then returns UUID to ask for the result of the last sale status.

Void / Refund Flow

Void/Refund transaction is started outside of your application. In order for this to work, your app must return Refund Info at the end of a successful sale transaction along with other sale data.

If your app does not have a refund feature, you can ingore this section.

RefundInfo is a string which could be in any format that your application could use later in case of a refund. Remember, this info will be used only by regarding application itself.

For your refund activity to be triggered by platform, register your activity with action named "Refund_Action".

In case your refund activity is triggered, the same RefundInfo string you returned with sale data will be delivered to you. In your activity, you could retrieve it this way:

Remote Activation

To be able to list your application in device, you need to support remote activation system as example given below. Let's say you have an activity to run activation process. For that activity or other ui element, you have to support given intent filter below to run activation process.

Inside intent bundle, you'll see parameters for use that are merchantID and terminalID as string. It's up to you to use this parameters as it totally depends your design. This will start your activation process remotely. When activation on your app is complete

and yourIntent should contain merchantID and terminalID as string if you're not using parameters coming from device.

If some error occured,

and your intent should contain field "message" to understand and log it.

Update Parameters on Active App

If your application on same fiscal id has changeable merchantID and terminalID, you have to support given intent filter below to run activation process. Let's say you have an activity to run activation process. For that activity or other ui element,

Inside intent bundle, you'll see parameters for use that are merchantID and terminalID as string. It's up to you to use this parameters as it totally depends your design. This will start your terminalID and merchantID update process remotely. When update on your app is complete

and yourIntent should contain merchantID and terminalID as string if you're not using parameters coming from device.

If some error occured,

and your intent should contain field "message" to understand and log it.

Manual App Activation

Let's say some operator needs to install your application manually and doesn't have a chance to send remote activation process. For that kind of situations, please use function setBankParams at

19KB
Open
DeviceInfo.zip

Important Note: If you don't implement this function, your application can't be activated and it can't seen in ATMS. Therefore you couldn't see your applications on POS transactions and sale menu! You can read Pos Settings on the Template Banking app for more information.

Our UIComponents library provides components such as ListMenuFragment, InfoDialog, InputListFragment and NumPadDialog which are explained here.

Last updated