![]() |
SPI
1.2101.8
Secured Payment Interface
|
This class contains all the operations that Avilible for a Service. Since this class is abstract, Servuce object is invlaid and can't be constructed. A Service handle is created by SPI class interface. All data in this class is reachable through various methods which define the behaivor of the operation. More...
#include <Service.h>
Public Member Functions | |
| virtual SPILIBRARY_API SPI_RET_VAL | Init (string DeviceSerialNo)=0 |
| Initialize the payment service. | |
| virtual SPILIBRARY_API SPI_RET_VAL | DoEstablishment (string Retailer)=0 |
| Establishes the service and makes it ready for use, considering database, etc. Must be called once or in case unestablished indication is received as a result of GetServiceStatus(). | |
| virtual SPILIBRARY_API SPI_RET_VAL | AbortDoEstablishment ()=0 |
| Abort establishment process while occuring.Has to be called by another thread. | |
| virtual SPILIBRARY_API SPI_RET_VAL | AddPinpad (PPIDType PinPadID, Config &PinpadConfig, PP_Protocol Protocol, bool IsDirect)=0 |
| That method, called by an administrator as part of the system configuration, Adds and configure a single Pinpad device to the Pinpad list. Each device is identified by unique integer number. This method must be called before device can perfoem any transaction with the payment service and must be called at least once, as Pinpad map is empty at stage of service initialization. | |
| virtual SPILIBRARY_API SPI_RET_VAL | StartTransaction (Transaction *TransactionPtr)=0 |
| That non blocking method is called in order to start transaction with a well initiated transaction. The method returns right away. Each started transaction with this method must call at lwast once to PollTransaction() to know when to go to CloseTransaction(). | |
| virtual SPILIBRARY_API SPI_RET_VAL | PollTransaction (Transaction *TransactionPtr, TransactionStatus &Status)=0 |
| That non blocking method is called in order to poll the status of a transaction. The method returns right away. The status is returned via output parameter Status. Loyalty is supported through the method SetLoyaltyAmount(). If transaction is aborted using AbortTransaction(), still calling CloseTransaction is mandatory. | |
| virtual SPILIBRARY_API SPI_RET_VAL | CloseTransaction (Transaction *TransactionPtr)=0 |
| That non blocking method is called in order to end the transaction handeled by TransactionPtr. The method returns right away. This method is mandatory for each transaction started with StartTransaction(). If transaction is aborted using AbortTransaction(), calling CloseTransaction is still mandatory. | |
| virtual SPILIBRARY_API SPI_RET_VAL | DoTransaction (Transaction *TransactionPtr)=0 |
| That blocking method is called in order to perform the the whole process of transaction with a well initiated transaction. The method returns only when transaction is done weather successfuly or not. | |
| virtual SPILIBRARY_API SPI_RET_VAL | DoTransactionPhase1 (Transaction *TransactionPtr)=0 |
| That blocking method is called in order to perform the first phase of a well initiated transaction. The method returns only when first phase is terminated successfuly or not. Completing successfully that method, enables the caller to set a discounted sub total,using ChangeLoyaltyAmount(Amount), before completing the transaction. That event is known as "Loyalty" event considering the retail terminology. After calling that method,the user should call to DoTransactionPhase2 in order to complete the transaction. | |
| virtual SPILIBRARY_API SPI_RET_VAL | DoTransactionPhase2 (Transaction *TransactionPtr)=0 |
| Blocking method to perfoem the second phase of a transaction. Method returns only when transaction is completely done, Weather or not Transaction was succeded. This method does all the requiered calls to pinpads. | |
| virtual SPILIBRARY_API SPI_RET_VAL | AbortTransaction (Transaction *TransactionPtr)=0 |
| Abort an ongoing transaction. If executed via a blocking method, can be called from a another thread. Once called on handle that executed via blocking method, the call to AbortTransaction will cause the blocking method to return right away on the other thread. If called on a nonblocking API, all needed is go to close the transaction. | |
| virtual SPILIBRARY_API SPI_RET_VAL | RetrieveTransaction (Transaction *TransactionPtr, std::string UID)=0 |
| Get information about transaction given a UID. if UID is empty (aka UID=""), function will retreive last successfull transaction. | |
| virtual SPILIBRARY_API SPI_RET_VAL | StartEndOfDay (Report *ReportResult)=0 |
| That non blocking method is called in order to start end of day process. The method returns right away. Each started end of day call mest at least once go to PollEndOfDay() to know when to go to CloseEndOfDay(). | |
| virtual SPILIBRARY_API SPI_RET_VAL | PollEndOfDay (Report *ReportResult, EndOfDayStatus &Status)=0 |
| That non blocking method is called in order to poll end of day process. The method returns right away. with the status of the operaiton in Status output param. If operation aborted using AbortBlockingOperation() a call to CloseEndOfDay() is mandatory. | |
| virtual SPILIBRARY_API SPI_RET_VAL | CloseEndOfDay (Report *ReportResult)=0 |
| That non blocking method is called in order to close nonblocking end of day process. The method returns right away. If operation aborted using AbortBlockingOperation() a call to CloseEndOfDay() is mandatory. | |
| virtual SPILIBRARY_API SPI_RET_VAL | EndOfDay (Report *ReportResult)=0 |
| End of day function is batching all transactions to Service processor. This method is blocking and returns only when batching was ended. | |
| virtual SPILIBRARY_API SPI_RET_VAL | AbortEndOfDay ()=0 |
| Abort an ongoing EndOfDay. If executed via a blocking method, can be called from a another thread. Once called while executed via blocking method, the call to AbortEndOfDay will cause the blocking method to return right away on the other thread. If called on a nonblocking API, all needed is go to close the EndOfday. | |
| virtual SPILIBRARY_API ExtendedPeriodicStatus | GetExtendedPeriodicStatus (CounterType &BlockNumber, std::string &Text) const =0 |
| Get specific status of periodic (EndOfDay or Establishment) according to the comm states. | |
| virtual SPILIBRARY_API SPI_RET_VAL | DoReport (Report *ReportResult)=0 |
| Get a detailed Report from the Service. There are 2 kinds of reports: | |
| virtual SPILIBRARY_API SPI_RET_VAL | DoEraseDB ()=0 |
| Erase service database. All transactions in Service database must be batched via EndOfDay bedore operation. | |
| virtual SPILIBRARY_API SPI_RET_VAL | DisplayCustomerDisplay (PPIDType DeviceID, vector< string > Messages)=0 |
| Display up to 3 lines of text on specific Pinpad. Pinpad must be connected direct to service. (See AddPinpad(...) for more details) Each line will be element in std::vector and may not contain CR, LF or CRLF Each line will be up to 19 characters not including null terminator. | |
| virtual SPILIBRARY_API SPI_RET_VAL | ClearPinpadMap ()=0 |
| Delete all pinpads which added via AddPinpad() | |
| virtual SPILIBRARY_API SPI_RET_VAL | CheckPinpadConnection (PPIDType PinpadID)=0 |
| Check wheather a pinpad which added via AddPinpad() is responding and avilible to do operations. | |
| virtual SPILIBRARY_API void | GetServiceVersion (std::string &Version) const =0 |
| Get Service version by providing a buffuer std::string to write the result. | |
| virtual SPILIBRARY_API string | GetSerialID () const =0 |
| Get the serial number provided when service initiated. | |
| virtual SPILIBRARY_API string | GetRetailerID () const =0 |
| Get the Retailer number in use of current Service processor. | |
| virtual SPILIBRARY_API string | GetRetailerName () const =0 |
| Get the Retailer name in use of current Service processor as established. | |
| SPILIBRARY_API string | GetLastErrorMessage () const |
| Get last error message produced by the Service. Should be called when SPI_FAIL is returned from a Service method. | |
| virtual SPILIBRARY_API string | GetUIDbyVUID (std::string VUID) const =0 |
| Get transaction UID by VUID supplied to Transaction object. | |
| SPILIBRARY_API boolean | IsServiceAvailable () const |
| Get status of service communication regarding it's configuration provided in it's Config when Added to SPI. | |
| virtual SPILIBRARY_API boolean | IsReadyForTransaction () const |
| Use this method before performing a transaction. To get more details you may use GetServiceStatus() | |
| virtual SPILIBRARY_API SPI_STATUS | GetServiceStatus ()=0 |
| Get service status. | |
| SPILIBRARY_API string | GetName () const |
| Get service name asw defined while added to SPI. | |
| virtual SPILIBRARY_API string | GetProperty (ServiceProperty Property) const =0 |
| Get service property in string format. the follow properties are supported: | |
| Service (string, Config &) | |
| Constructor reserved for internal useage. | |
| virtual | ~Service () |
| destructor reserved for internal useage | |
| APIHandle | GetServiceHandle () const |
| Handle get - reserved for internal useage. | |
Protected Attributes | |
| APIHandle | ServiceHandle |
This class contains all the operations that Avilible for a Service. Since this class is abstract, Servuce object is invlaid and can't be constructed. A Service handle is created by SPI class interface. All data in this class is reachable through various methods which define the behaivor of the operation.
|
pure virtual |
Abort establishment process while occuring.Has to be called by another thread.
|
pure virtual |
Abort an ongoing EndOfDay. If executed via a blocking method, can be called from a another thread. Once called while executed via blocking method, the call to AbortEndOfDay will cause the blocking method to return right away on the other thread. If called on a nonblocking API, all needed is go to close the EndOfday.
|
pure virtual |
Abort an ongoing transaction. If executed via a blocking method, can be called from a another thread. Once called on handle that executed via blocking method, the call to AbortTransaction will cause the blocking method to return right away on the other thread. If called on a nonblocking API, all needed is go to close the transaction.
| [in,out] | TransactionPtr | is a pointer to Transaction handle constructed by a matching derived class. |
|
pure virtual |
That method, called by an administrator as part of the system configuration, Adds and configure a single Pinpad device to the Pinpad list. Each device is identified by unique integer number. This method must be called before device can perfoem any transaction with the payment service and must be called at least once, as Pinpad map is empty at stage of service initialization.
| [in] | PinPadID | is a unique number for device identification |
| [in] | PinpadConfig | is Config instance to set device location |
| [in] | Protocol | is Pinpad Protocol |
| [in] | IsDirect | is Pinpad connected direct to service (true) or unsupprted by the service (false) |
|
pure virtual |
Check wheather a pinpad which added via AddPinpad() is responding and avilible to do operations.
| [in] | PinpadID | is the Pinpad identification number attached to a device that added via AddPinpad() |
|
pure virtual |
Delete all pinpads which added via AddPinpad()
|
pure virtual |
That non blocking method is called in order to close nonblocking end of day process. The method returns right away. If operation aborted using AbortBlockingOperation() a call to CloseEndOfDay() is mandatory.
| [in,out] | ReportResult | is a pointer to Result handle constructed with Z_REPORT. |
|
pure virtual |
That non blocking method is called in order to end the transaction handeled by TransactionPtr. The method returns right away. This method is mandatory for each transaction started with StartTransaction(). If transaction is aborted using AbortTransaction(), calling CloseTransaction is still mandatory.
| [in,out] | TransactionPtr | is a pointer to Transaction handle constructed by a matching derived class. |
|
pure virtual |
Display up to 3 lines of text on specific Pinpad. Pinpad must be connected direct to service. (See AddPinpad(...) for more details) Each line will be element in std::vector and may not contain CR, LF or CRLF Each line will be up to 19 characters not including null terminator.
| [in] | DeviceID | is Pinpad Id to display messeges |
| [in] | Messages | is std::vector<std::string> - vector of strings as describes |
|
pure virtual |
Erase service database. All transactions in Service database must be batched via EndOfDay bedore operation.
|
pure virtual |
Establishes the service and makes it ready for use, considering database, etc. Must be called once or in case unestablished indication is received as a result of GetServiceStatus().
| [in] | Retailer | is Retailer number given by the service processor. |
|
pure virtual |
Get a detailed Report from the Service. There are 2 kinds of reports:
- X_REPORT to get the current status in the Service
- Z_REPORT to get last Report created during EndOfDay.
| [in,out] | ReportResult | is a pointer to Report object which constructed with the matching ReportType. |
|
pure virtual |
That blocking method is called in order to perform the the whole process of transaction with a well initiated transaction. The method returns only when transaction is done weather successfuly or not.
| [in,out] | TransactionPtr | is a pointer to Transaction handle constructed by a matching derived class. |
|
pure virtual |
That blocking method is called in order to perform the first phase of a well initiated transaction. The method returns only when first phase is terminated successfuly or not. Completing successfully that method, enables the caller to set a discounted sub total,using ChangeLoyaltyAmount(Amount), before completing the transaction. That event is known as "Loyalty" event considering the retail terminology. After calling that method,the user should call to DoTransactionPhase2 in order to complete the transaction.
| [in,out] | TransactionPtr | is a pointer to Transaction handle constructed by a matching derived class. |
|
pure virtual |
Blocking method to perfoem the second phase of a transaction. Method returns only when transaction is completely done, Weather or not Transaction was succeded. This method does all the requiered calls to pinpads.
| [in,out] | TransactionPtr | is a pointer to Transaction handle constructed by a matching derived class. |
|
pure virtual |
End of day function is batching all transactions to Service processor. This method is blocking and returns only when batching was ended.
| [in,out] | ReportResult | is a Report constructed with Z_REPORT. In order to receive the report created by the processor. |
|
pure virtual |
Get specific status of periodic (EndOfDay or Establishment) according to the comm states.
| [out] | BlockNumber | indicates block number in case of PeriodicStatus_RecvBlockedCardsResponseFull |
| [out] | Text | for display the curreny status in Hebrew UTF-8. Text changes every time the status is updated of the block number increase by 1. |
| SPILIBRARY_API string Modularity::SPI::Service::GetLastErrorMessage | ( | ) | const |
| SPILIBRARY_API string Modularity::SPI::Service::GetName | ( | ) | const |
Get service name asw defined while added to SPI.
|
pure virtual |
Get service property in string format. the follow properties are supported:
| Name | format | example |
|---|---|---|
| ServiceProperty_TransmitTime | epoch time_t | 1485869256 |
| [in] | PropertyName | to get. |
|
pure virtual |
Get the Retailer number in use of current Service processor.
|
pure virtual |
Get the Retailer name in use of current Service processor as established.
|
pure virtual |
Get the serial number provided when service initiated.
|
pure virtual |
Get service status.
|
pure virtual |
Get Service version by providing a buffuer std::string to write the result.
| [out] | Version | is the buffer where the result is written. |
|
pure virtual |
Get transaction UID by VUID supplied to Transaction object.
| [in] | VUID | to look for. |
|
pure virtual |
Initialize the payment service.
| [in] | DeviceSerialNo | - Device serial number.Considering AshraitEMV service, that runs over the user device such as library, that must be sent. |
|
virtual |
Use this method before performing a transaction. To get more details you may use GetServiceStatus()
| SPILIBRARY_API boolean Modularity::SPI::Service::IsServiceAvailable | ( | ) | const |
|
pure virtual |
That non blocking method is called in order to poll end of day process. The method returns right away. with the status of the operaiton in Status output param. If operation aborted using AbortBlockingOperation() a call to CloseEndOfDay() is mandatory.
| [in,out] | ReportResult | is a pointer to Result handle constructed with Z_REPORT. |
| [out] | Status | is the operation status
|
|
pure virtual |
That non blocking method is called in order to poll the status of a transaction. The method returns right away. The status is returned via output parameter Status. Loyalty is supported through the method SetLoyaltyAmount(). If transaction is aborted using AbortTransaction(), still calling CloseTransaction is mandatory.
| [in,out] | TransactionPtr | is a pointer to Transaction handle constructed by a matching derived class. |
| [out] | Status | is the status of the transaction which handeled by TransactionPtr.
|
|
pure virtual |
Get information about transaction given a UID. if UID is empty (aka UID=""), function will retreive last successfull transaction.
| [in,out] | TransactionPtr | is a pointer to Transaction handle constructed by a matching derived class with Matching VirtualReason. |
| [in] | UID | is the transaction identifer created by the service. |
|
pure virtual |
That non blocking method is called in order to start end of day process. The method returns right away. Each started end of day call mest at least once go to PollEndOfDay() to know when to go to CloseEndOfDay().
| [in,out] | ReportResult | is a pointer to Result handle constructed with Z_REPORT. |
|
pure virtual |
That non blocking method is called in order to start transaction with a well initiated transaction. The method returns right away. Each started transaction with this method must call at lwast once to PollTransaction() to know when to go to CloseTransaction().
| [in,out] | TransactionPtr | is a pointer to Transaction handle constructed by a matching derived class. |
|
protected |
1.8.2