Setup the SDK using the initialize
command.
There are 2 ways to use this method.
CoreAPIListener
interface. (the this
in the code sample)register*Listener
to register callbacks in different locations depending on the structure of your application. CoreAPIListener
this will lead to duplicate callbacks firing.
initWithConfiguration
call will authenticate with the %CompanyName gateway and retrieve settings required for operation.
The onSettingsRetrieved
callback will fire on success. At this point we know that we have successful credentials and the SDK is ready to connect a device.
AndroidTerminal.getInstance().initialize(this);
AndroidTerminal.getInstance().setMode(CoreMode.TEST);
AndroidTerminal.getInstance().initWithConfiguration(MainActivity.this, TERMINAL_ID, SECRET);
[[WTPSTerminal singleton] init:self];
[[WTPSTerminal singleton] setMode:TEST];
[[WTPSTerminal singleton] initWithConfiguration:TERMINAL_ID withSecret:SECRET];
You can now initialize the device. Use this code and wait for the device to connect. Change the device name and connection method to match your needs.
The onDeviceConnected
callback will fire on success. Once this fires the SDK and device are ready to use!
AndroidTerminal.getInstance().initDevice(DeviceEnum.IDTECH, DeviceConnectionType.USB, null);
[[WTPSTerminal singleton] initDevice:BBPOSDEVICE withConnectionType:BLUETOOTH withBluetoothAddress:nil];
Once the device is connected send the amount required via a ProcessSale
call and the device should prompt for a card. Presenting a valid card should result in an online authentication being sent to the bank and the SDK processes the response.
The onSaleResponse
callback will fire on success. Here is where you can display receipts or do any other post transaction processing.
CoreSale sale = new CoreSale(BigDecimal.valueOf(Double.parseDouble(2.22)));
AndroidTerminal.getInstance().processSale(sale);
CoreSale *sale =[[CoreSale alloc] init];
sale.amount = [NSNumber numberWithDouble: 2.22];
[[WTPSTerminal singleton] processSale:sale];
The purpose of this document is to provide a high level description of the changes made to the %CompanyName System. The SDK is required to handle the situation where a reversal is performed on a transaction with a certain OrderID that may have been used in more than one transaction attempt. Transactions with the same OrderID are not guaranteed to be unique, and are therefore impossible to single out for a reversal on its own. In the event of performing a reversal using the OrderID field, the proposed solution is to include a new field in the request to identify what time the transaction occurred in the merchant’s timezone. This document reflects the changes made to the Gateway (server side) and the Mobile SDK.
For the instances where the UniqueRef is not returned, the refund functionality is updated to allow refunds using OrderId + PreviousTransactionDateTime.