\SofortLibTransactionData
This class is for retrieving information about transactions, you can search by transaction-id or by date
eg: $SofortLibTransactionData = new SofortLibTransactionData('yourapikey');
$SofortLibTransactionData->setTransaction('1234-456-789654-31321')->sendRequest();
echo $SofortLibTransactionData->getStatus();
- Author: SOFORT AG (integration@sofort.com)
- Copyright: 2010-2014 SOFORT AG
- License: Released under the GNU LESSER GENERAL PUBLIC LICENSE (Version 3)
Synopsis
class SofortLibTransactionData
extends SofortLibAbstract
{
- // Inherited constants from SofortLibAbstract
- const GATEWAY_URL = "https://api.sofort.com/api/xml";
- // Inherited members from SofortLibAbstract
- public bool $enableLogging;
- public array $errors;
- public array $warnings;
- protected string $_apiVersion;
- protected string $_apiKey;
- protected string $_configKey;
- protected $_DataHandler;
- protected $_Logger;
- protected array $_parameters;
- protected array $_products;
- protected string $_projectId;
- protected $_request;
- protected $_response;
- protected string $_rootTag;
- protected string $_userId;
- protected bool $_validateOnly;
- // methods
- public SofortLibTransactionData addTransaction()
- public double getAmount()
- public double getAmountRefunded()
- public string getBillcode()
- public bool getConsumerProtection()
- public string getCostsCurrencyCode()
- public double getCostsExchangeRate()
- public double getCostsFees()
- public int getCount()
- public string getCurrency()
- public string getEmailCustomer()
- public string getExchangeRate()
- public string getLanguageCode()
- public string getPaycode()
- public string getPaymentMethod()
- public string getPhoneNumberCustomer()
- public int getProjectId()
- public string getReason()
- public string getRecipientAccountNumber()
- public string getRecipientBankCode()
- public string getRecipientBankName()
- public string getRecipientBic()
- public string getRecipientCountryCode()
- public string getRecipientHolder()
- public string getRecipientIban()
- public string getSenderAccountNumber()
- public string getSenderBankCode()
- public string getSenderBankName()
- public string getSenderBic()
- public string getSenderCountryCode()
- public string getSenderHolder()
- public string getSenderIban()
- public string getStatus()
- public mixed|bool getStatusHistoryItem()
- public string getStatusModifiedTime()
- public string getStatusReason()
- public string getTime()
- public string getTransaction()
- public string getUserVariable()
- public bool isTest()
- public SofortTransactionData setCount()
- public SofortLibTransactionData setNumber()
- public SofortTransactionData setStatus()
- public SofortTransactionData setStatusModifiedTime()
- public SofortTransactionData setStatusReason()
- public SofortLibTransactionData setTime()
- protected void _parse()
- private bool _extractValue()
- private bool _extractValueGroupedData()
- private bool _extractValueGroupedDataNumbered()
- private bool _extractValueSimpleTag()
- private mixed|bool _extractValueStatusHistoryItem()
- // Inherited methods from SofortLibAbstract
- 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()
Hierarchy
Extends
Constants
Name | Value |
---|---|
GATEWAY_URL | "https://api.sofort.com/api/xml" |
Members
private
- $_count
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
- $_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
- _extractValue() — Checks whether given index ($i) is within the returned boundaries and if the key and its data exists.
- _extractValueGroupedData() — Checks for Grouped Data within the response array, Returns Data on Success, else false.
- _extractValueGroupedDataNumbered() — Checks for Elements that can have n Elements, Returns the "nth" Element
- _extractValueSimpleTag() — Returns the Data of the given tag
- _extractValueStatusHistoryItem() — Returns the nth Array of the Status History item
protected
- _parse() — Parse the XML (override)
public
- addTransaction() — Use this function if you want to request detailed information about several transactions at once
- getAmount() — Returns the total amount of a transaction
- getAmountRefunded() — Refund, if a transaction was refunded. amount = amountRefunded if everything was refunded
- getBillcode() — Returns the transactions billcode
- getConsumerProtection() — Returns the state of consumer_protection if set
- getCostsCurrencyCode() — Returns the transactions costs Currency
- getCostsExchangeRate() — Returns the transactions exchange rate
- getCostsFees() — Returns the transactions Fees (Part of Costs)
- getCount() — Getter for count, the number of transaction returned by the response
- getCurrency() — Returns the currency of a transaction
- getEmailCustomer() — Returns the transaction customer's email-address
- getExchangeRate() — Returns the transactions exchange rate
- getLanguageCode() — Returns the language code of a transaction
- getPaycode() — Returns the transactions paycode
- getPaymentMethod() — Returns the payment method of a transaction
- getPhoneNumberCustomer() — Returns the transaction customer phone-number
- getProjectId() — Returns the project id of a transaction
- getReason() — Returns an array containing reason of a transaction
- getRecipientAccountNumber() — Returns the account number of the receiving account
- getRecipientBankCode() — Returns the bank code of the receiving account
- getRecipientBankName() — Returns the bank name of the receiving account
- getRecipientBic() — Returns the BIC of the receiving account
- getRecipientCountryCode() — Returns the country code of the receiving account
- getRecipientHolder() — Returns the holder of the receiving account
- getRecipientIban() — Returns the IBAN of the receiving account
- getSenderAccountNumber() — Returns the account number of the sending account
- getSenderBankCode() — Returns the bank code of the sending account
- getSenderBankName() — Returns the bank name of the sending account
- getSenderBic() — Returns the BIC of the sending account
- getSenderCountryCode() — Returns the country code of the sending account
- getSenderHolder() — Returns the holder of the sending account
- getSenderIban() — Returns the IBAN of the sending account
- getStatus() — Returns the status of a transaction
- getStatusHistoryItem() — Returns an array with an status_history_item (status (code), status_reason and time)
- getStatusModifiedTime() — Returns the time of the last status-change so you can check if sth. changed
- getStatusReason() — Returns the detailed status description of a transaction
- getTime() — Returns the time of a transaction
- getTransaction() — Returns the transaction id of a transaction
- getUserVariable() — Returns the user variable of a transaction
- isTest() — Checks if the transaction was a test
- setCount() — Setter for transaction-counter
- setNumber() — You can limit the number of results
- setStatus() — Request for transactions with certain status
- setStatusModifiedTime() — Request for transactions with their status changed within a certain time
- setStatusReason() — Request for transactions with certain status reason
- setTime() — You can request all transactions of a certain time period
Inherited from SofortLibAbstract
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
- 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