\SofortLibAbstract
Synopsis
class SofortLibAbstract
{
- // constants
- const GATEWAY_URL = "https://api.sofort.com/api/xml";
- // members
- public bool $enableLogging = false;
- public array $errors = ;
- public array $warnings = ;
- protected string $_apiVersion = '1.0';
- protected string $_apiKey = '';
- protected string $_configKey = '';
- protected $_DataHandler = NULL;
- protected $_Logger = NULL;
- protected array $_parameters = ;
- protected array $_products = ;
- protected string $_projectId = '';
- protected $_request;
- protected $_response;
- protected string $_rootTag = '';
- protected string $_userId = '';
- protected bool $_validateOnly = false;
- // methods
- public void __construct()
- public string getConfigKey()
- public array getData()
- public object|null getDataHandler()
- public string getError()
- public array getErrors()
- public AbstractLoggerHandler getLogger()
- public mixed getParameters()
- public mixed getRawRequest()
- public mixed getRawResponse()
- public mixed getRequest()
- public array getResponse()
- public array getWarnings()
- public array handleErrors()
- public bool isError()
- public bool isWarning()
- public void log()
- public void logError()
- public void logWarning()
- public void sendRequest()
- public SofortLibAbstract setAbortUrl()
- public SofortLibAbstract setConfigKey()
- public SofortLibAbstract setCurrencyCode()
- public SofortLibAbstract setDataHandler()
- public void setError()
- public SofortLibAbstract setLogDisabled()
- public SofortLibAbstract setLogEnabled()
- public SofortLibAbstract setLogger()
- public SofortLibAbstract setNotificationEmail()
- public SofortLibAbstract setNotificationUrl()
- public SofortLibAbstract setParameters()
- public SofortLibAbstract setSuccessLinkRedirect()
- public SofortLibAbstract setSuccessUrl()
- public SofortLibAbstract setTimeoutUrl()
- protected array _getErrorBlock()
- protected void _handleErrors()
- protected void _parse()
- protected SofortLibAbstract _setNotification()
- private bool _getPaymentMethodAllPmGlobal()
- private bool _getPaymentSpecificError()
- private bool _isErrorWarning()
- private array _prepareRootTag()
Constants
Name | Value |
---|---|
GATEWAY_URL | "https://api.sofort.com/api/xml" |
Members
protected
- $_DataHandler
—
Object for the Data Handler (usually XML-Data Handler) - $_Logger
—
Object for the logger - $_apiKey
—
string
Api Key as provided in User Account on sofort.com - $_apiVersion
- $_configKey
—
string
Complete Config Key as provided in User Account on sofort.com - $_parameters
—
array
Array, that contains data and structure which will be send to the API (normally as XML) - $_products
—
array
Contains the allowed products - $_projectId
—
string
Project ID from sofort.com - $_request
—
array
Contains the request Data, that has been sent to the API - $_response
—
array
Provides the parsed response. - $_rootTag
—
string
Defines the used part of the API - $_userId
—
string
User ID from sofort.com - $_validateOnly — bool
public
- $enableLogging
—
bool
Define if logging is en/disabled - $errors
—
array
Array for the errors that occurred - $warnings
—
array
Array for the warnings that occurred
Methods
private
- _getPaymentMethodAllPmGlobal() — Helper function to compare given and supported Payment Method
- _getPaymentSpecificError() — checks (response)- for payment-specific error
- _isErrorWarning() — Helper to iterate through an array of error or warning messages to find out whether an error/warning occurred or not.
- _prepareRootTag() — Prepare the root tag
protected
- _getErrorBlock() — Getter for error block
- _handleErrors() — Handle Errors and Warnings occurred
- _parse() — Parse data received or being sent
- _setNotification() — Set the type of notification and the address where it should be sent to being sent to.
public
- __construct()
- getConfigKey() — Getter for ConfigKey
- getData() — Preparing array for request
- getDataHandler() — Getter for the DataHandler
- getError() — Returns one error message
- getErrors() — Getter for errors
- getLogger() — Getter for LogHandler
- getParameters() — Getter for parameter-array
- getRawRequest() — Getter for the raw Request Data
- getRawResponse() — Getter for the raw Response Data
- getRequest() — Getter for the Request Data
- getResponse() — Getter for the Response
- getWarnings() — Getter for warnings
- handleErrors() — Alter error array and set error message and error code together as one
- isError() — checks (response)-array for error
- isWarning() — Checks (response)-array for warnings
- log() — Log the given string into log.txt use $this->enableLog(); to enable logging before!
- logError() — Log the given string into error_log.txt use $this->enableLog(); to enable logging before!
- logWarning() — Log the given string into warning_log.txt use $this->enableLog(); to enable logging before!
- sendRequest() — SendRequest sends Request (array) to the DataHandler and gets Response (array)
- setAbortUrl() — The customer will be redirected to this url if he uses the abort link on the payment form, should redirect him back to his cart or to the payment selection page
- setConfigKey() — Setter for ConfigKey and parsing ConfigKey into userId, projectId, apiKey
- setCurrencyCode() — Setter for Currency eg. EUR
- setDataHandler() — Setter for the DataHandler
- setError() — Set Errors later use getError(), getErrors() or isError() to retrieve them
- setLogDisabled() — Set logging disabled
- setLogEnabled() — Set logging enable
- setLogger() — Setter for LogHandler
- setNotificationEmail() — Sets the notification Email-address and it's attributes
- setNotificationUrl() — Sets the notification URL and it's attributes
- setParameters() — Setter for Parameter Array
- setSuccessLinkRedirect() — Setter for redirecting the success link automatically
- setSuccessUrl() — The customer will be redirected to this url after a successful transaction, this should be a page where a short confirmation is displayed
- setTimeoutUrl() — If the customer takes too much time or if your timeout is set too short he will be redirected to this page