public class PaymentManager extends EMDKBase
EMDKResults results = EMDKManager.getEMDKManager(getApplicationContext(), this); //After EMDK opened paymentManager = (PaymentManager)this.emdkManager.getInstance(FEATURE_TYPE.PAYMENT); PaymentDevice paymentDevice = paymentManager.getDevice(DeviceIdentifer.DEFAULT); paymentDevice.addDataListener(this); paymentDevice.enable(); paymentDevice.readCardData(); paymentDevice.disable(); EMDKManager.release(FEATURE_TYPE.PAYMENT);
Modifier and Type | Class and Description |
---|---|
static class |
PaymentManager.ConnectionState
Connection states of a payment device.
|
static class |
PaymentManager.DeviceIdentifier
Defines specific payment devices of each type.
|
static interface |
PaymentManager.PaymentConnectionListener
An interface for notifying client applications when the external payment device
is connected or disconnected to the mobile device.
|
Modifier and Type | Method and Description |
---|---|
void |
addConnectionListener(PaymentManager.PaymentConnectionListener connectionListener,
PaymentManager.DeviceIdentifier deviceIdentifier)
Add PaymentConnectionListener to receive remote payment device connection changes via
callback.
|
PaymentDevice |
getDevice(DeviceInfo deviceInfo)
This method returns the PaymentDevice object if the Device info specified is valid
and Device info object can obtain from the PaymentManager.getSupportedDevicesInfo().
|
PaymentDevice |
getDevice(PaymentManager.DeviceIdentifier deviceIdentifier)
This method returns the PaymentDevice object based on device identifier specified.
|
PaymentDevice |
getDevice(String deviceName,
boolean isMacAddress)
The getDevice method gets payment object which can be used to enable and communicate with payment device.
|
ArrayList<DeviceInfo> |
getPairedDevicesInfo(DeviceInfo.DeviceType deviceType)
This method gets the list of payment devices paired with Mobile Device based on the deviceType.
|
ArrayList<DeviceInfo> |
getSupportedDevicesInfo()
Returns list of supported payment devices information.
|
String |
isPaymentDeviceInUse(DeviceInfo.DeviceType deviceType)
This method checks whether the payment device is in use and which POS application is using the payment device
The input parameter is payment device type.
|
void |
removeConnectionListener(PaymentManager.PaymentConnectionListener connectionListener)
Remove PaymentConnectionListener to receive payment device connection changes
via callback.
|
public ArrayList<DeviceInfo> getSupportedDevicesInfo()
public PaymentDevice getDevice(PaymentManager.DeviceIdentifier deviceIdentifier)
deviceIdentifier
- The device identifier specifies which payment device the application wants.PaymentDevice
object if the device identifier specified is valid on the device. Otherwise null is returned.public PaymentDevice getDevice(DeviceInfo deviceInfo)
deviceInfo
- provides information on DeviceInfo class.PaymentDevice
object if the deviceInfo specified is valid on the device. Otherwise null is returned.public PaymentDevice getDevice(String deviceName, boolean isMacAddress)
deviceName
- provides information like deviceName or macaddress of the devices.isMacAddress
- decides if deviceName is macaddress or the name of the device.PaymentDevice
object if the PaymentDevice specified.Otherwise null is returned.public void addConnectionListener(PaymentManager.PaymentConnectionListener connectionListener, PaymentManager.DeviceIdentifier deviceIdentifier)
connectionListener
- deviceIdentifier
- - Type of device connections to notify. Not supported in this version..public void removeConnectionListener(PaymentManager.PaymentConnectionListener connectionListener)
connectionListener
- public ArrayList<DeviceInfo> getPairedDevicesInfo(DeviceInfo.DeviceType deviceType) throws PaymentException
deviceType
- PaymentException
public String isPaymentDeviceInUse(DeviceInfo.DeviceType deviceType)
deviceType
-