To call the PayFacto DataCandy application, a developer needs to create an Android intent.
JavaScript
Intent intent = new Intent("com.payfacto.payfactodatacandy.DATACANDY_ACTIVITY");
Additional data are required to complete the intent:
Extra String Label | Description | Possible Values | Value Description |
|---|
API
| Mandatory unique value to be passed on each intent | API
| Unique value to be set for this label |
TRANSACTION
| Transaction type to be processed | red
act
inc
emp
bal
ccl
pcl
| Redemption Activation Increment Empty Card Balance Complete Cancel Partial Cancel |
AMOUNT
| Amount of the transaction | 0
100
| When using a 001 transaction type Any positive value without decimal sign |
INVOICE
| Invoice number used for transaction processing | 123456
| Max length of 19, alphanumerical |
CLERK
| Operator ID used for the transaction | 001
| Max length 3, numerical value |
MERCHLANG
| Merchant language to be used | F
E
| For French For English |
TCR
| Number to use for complete and partial cancel. Correspond to the transaction confirmation number (TCN) of the transaction to cancel | 12345
| String value |
TRACK
| Track data of the gift card, If send the transaction will be process with that card number without asking for a card | 6360879999991856935
| String value |
If one the the field above is missing or invalid, a response will be receive in the result data intent as the TERMINALERRORCODE extra data as a Int.
You must call the intent with the startActivityForResult function. For example: startActivityForResult(intent, 0);
Code Example
JavaScript
intent = new Intent("com.payfacto.payfactodatacandy.DATACANDY_ACTIVITY");
switch ((int)spinnerDataCandy.getSelectedItemId()){
case 0:
intent.putExtra("TRANSACTION", "red");
break;
case 1:
intent.putExtra("TRANSACTION", "act");
break;
case 2:
intent.putExtra("TRANSACTION", "inc");
break;
case 3:
intent.putExtra("TRANSACTION", "emp");
break;
case 4:
intent.putExtra("TRANSACTION", "bal");
break;
case 5:
intent.putExtra("TRANSACTION", "ccl");
break;
case 6:
intent.putExtra("TRANSACTION", "pcl");
break;
default:
intent.putExtra("TRANSACTION", "red");
}
switch ((int)spinnerLanguage.getSelectedItemId()) {
case 0:
intent.putExtra("MERCHLANG", "E");
break;
case 1:
intent.putExtra("MERCHLANG", "F");
break;
}
intent.putExtra("AMOUNT", etAmount.getText().toString());
intent.putExtra("INVOICE", etInvoice.getText().toString());
intent.putExtra("CLERK", etClerk.getText().toString());
intent.putExtra("TCR", etTCR.getText().toString());