SPI  1.2111.4
Secured Payment Interface
SPI.h
Go to the documentation of this file.
1 
13 #ifndef __SPI__H_
14 #define __SPI__H_
15 
16 #include <vector>
17 #include <string>
18 #include <cstring>
19 
20 
21 #include "SPIDEF.h"
22 #include "Config.h"
23 #include "transaction.h"
24 #include "AshraitEMVTransaction.h"
25 #include "NayaxVendTransaction.h"
26 #include "NayaxEngineTransaction.h"
27 #include "Service.h"
28 #include "Device.h"
29 
30 using std::string;
31 using std::vector;
32 
36 namespace Modularity {
40  namespace SPI {
44  class SPI
45  {
46 
47  public:
48 
54  SPILIBRARY_API void Start();
55 
64  SPILIBRARY_API Service* AddService(string ServiceName, ServiceID Id ,Config & ServiceConfig);
65 
73  SPILIBRARY_API SPI_RET_VAL RemoveService(string ServiceName);
74 
83  SPILIBRARY_API Device* AddDevice(string DeviceName, DeviceId Id ,Config & DeviceConfig);
84 
92  SPILIBRARY_API SPI_RET_VAL RemoveDevice(string DeviceName);
93 
99  SPILIBRARY_API Service* GetServiceHandler(string ServiceName);
100 
105  SPILIBRARY_API void GetSPIVersion(string &Version);
106 
112  SPILIBRARY_API void SetLogDirectory(string Directory);
113 
118  SPILIBRARY_API void SetAndroidPackageName(string Name);
119 
126  SPILIBRARY_API void SetLogLevel(SPILogLevel LogLevel);
127 
132  SPILIBRARY_API DcsStatus GetDcsStatus();
133 
134 
142  SPILIBRARY_API SPI_RET_VAL DoDcsActivation(string PhoneNumber, DcsActivationMode ActivationMode);
143 
152  SPILIBRARY_API SPI_RET_VAL DoDcsActivation(string User, string Password, DcsActivationMode ActivationMode);
153 
159  SPILIBRARY_API void SetLynxEngineEndpoint(string LynxEndpoint,string EngineEndpoint);
160 
161 
165  SPILIBRARY_API void ClearDcsActivation();
166 
171  SPILIBRARY_API void EnableJNILogger();
172 
173 
174 
181  SPILIBRARY_API void SetHardwareId(string Manufacture, string Model, string Serial);
182 
187  SPILIBRARY_API SPI_RET_VAL KeepAlive();
188 
194  SPILIBRARY_API string GetStringDcsProperty(DcsProperty Property);
195 
201  SPILIBRARY_API ResultType GetIntDcsProperty(DcsProperty Property);
202 
206  SPILIBRARY_API SPI();
207 
211  SPILIBRARY_API ~SPI();
212 
217  SPILIBRARY_API string GetFingerprint();
218 
222  APIHandle GetSPIHandle() const;
223 
227  void SetWorkingDirectory(const std::string & Path) const;
228 
229  private:
230  APIHandle SPIHandle;
233  };
234  }
235 }
236 
237 #endif
SPILIBRARY_API SPI()
Default Constructor.
This file conatins all requiered methods to perform on remoted device. Important to notice that all m...
This namespace contains avilible API from Modularity Inc.
SPILIBRARY_API string GetStringDcsProperty(DcsProperty Property)
Get a property from DCS as string.
APIHandle GetSPIHandle() const
Reserved for internal useage.
SPILIBRARY_API SPI_RET_VAL KeepAlive()
Do keep alive to dcs.
This class contains all the methods to Config a Service or a device when attached to a Service...
Definition: Config.h:33
SPILIBRARY_API SPI_RET_VAL DoDcsActivation(string PhoneNumber, DcsActivationMode ActivationMode)
Blocking method to start activation of a user with phone number on DCS system. If error achieved use ...
SPILIBRARY_API string GetFingerprint()
Get SPI fingerprint. Reserved for internal usage.
SPILIBRARY_API ResultType GetIntDcsProperty(DcsProperty Property)
Get a property from DCS as string.
SPILIBRARY_API void Start()
Start using the SPI object. This method is mandatory start of version 1.0.0 Befre Start() is called ...
SPILIBRARY_API void SetHardwareId(string Manufacture, string Model, string Serial)
Set hardware id - Only for Android API.
SPILIBRARY_API Device * AddDevice(string DeviceName, DeviceId Id, Config &DeviceConfig)
Defines an active payment service and initilaizes it. Should be called before any operation is made w...
This file conatins all requiered methods to perform on a service. Important to notice that all method...
SPILIBRARY_API void SetLynxEngineEndpoint(string LynxEndpoint, string EngineEndpoint)
Set base endpoint to DCS enviorment.
SPILIBRARY_API DcsStatus GetDcsStatus()
Get the DCS status of this machine.
This class contains all the operations that Avilible for a Service. Since this class is abstract...
Definition: Device.h:30
SPILIBRARY_API ~SPI()
Default Destructor.
SPILIBRARY_API void SetAndroidPackageName(string Name)
Set package name that uses SPI in Android based systems.
SPILIBRARY_API void ClearDcsActivation()
Clear DCS Activation Data.
SPILIBRARY_API SPI_RET_VAL RemoveService(string ServiceName)
Remove active payment service from the interface.
sint ResultType
Definition: SPIDEF.h:56
This file conatins all requiered methods for Config. A Config instance must be used whenever adding a...
This class contains all the operations that Avilible for a Service. Since this class is abstract...
Definition: Service.h:36
This file conatins all requiered methods for Ashrait Transaction.
This file conatins all defenitions which are used in SPI API.
This file conatins all requiered methods for Ashrait Transaction.
SPILIBRARY_API void SetLogDirectory(string Directory)
Set the directory where SPI and it&#39;s services logs will be saved. If not called, default path will be...
SPILIBRARY_API SPI_RET_VAL RemoveDevice(string DeviceName)
Remove active payment service from the interface.
SPILIBRARY_API Service * AddService(string ServiceName, ServiceID Id, Config &ServiceConfig)
Defines an active payment service and initilaizes it. Should be called before any operation is made w...
SPILIBRARY_API void GetSPIVersion(string &Version)
Retrieve SPI version into string.
SPILIBRARY_API Service * GetServiceHandler(string ServiceName)
Retrieves handle of active payment service instance according its name.
void * APIHandle
Definition: SPIDEF.h:41
SPILIBRARY_API void SetLogLevel(SPILogLevel LogLevel)
Set the log level to be saved in log files SPI and service. Default is Info. Must be set before start...
This class contains all the operations of the Payment Interface, Creation and Services management...
Definition: SPI.h:44
void SetWorkingDirectory(const std::string &Path) const
Reserved for internal useage.
SPILIBRARY_API void EnableJNILogger()
Enable JNI internal logger This method is reserved for internal use only.
This file conatins all requiered methods for Ashrait Transaction.
This file conatins all requiered methods for abstract SPI Transaction.