MPay24Api

The MPay24Api class provides the communication functioanallity. It hold's all the sensitive data (merchant ID, SOAP password, etc) and build the SOAP request, sent to mPAY24

author mPAY24 GmbH <support@mpay24.com>
version $Id: MPay24Api.php 5522 2013-06-24 13:08:35Z anna $
filesource MPay24Api.php
license http://ec.europa.eu/idabc/eupl.html EUPL, Version 1.1

Methods

Set the basic (mandatory) settings for the requests

configure(int $merchantID, string $soapPassword, bool $test, string $proxyHost, int $proxyPort) 
inherited

Arguments

$merchantID

int

5-digit account number, supported by mPAY24 TEST accounts - starting with 9 LIVE account - starting with 7

$soapPassword

string

The webservice's password, supported by mPAY24

$test

bool

TRUE - when you want to use the TEST system FALSE - when you want to use the LIVE system

$proxyHost

string

The host name in case you are behind a proxy server ("" when not)

$proxyPort

int

4-digit port number in case you are behind a proxy server ("" when not)

Get the merchant ID, which was set by the function configure($merchantID, $soapPassword, $test, $proxyHost, $proxyPort)

getMerchantID() 
inherited

Get the SPID, which was set by the function configureFlexLINK($spid, $password, $test)

getSPID() 
inherited

Get the system, which should be used for flexLINK (test -> 'test' or live -> 'www')

getFlexLINKSystem() 
inherited

Get the url, where requests are going to be posted

getEtpURL() 
inherited

Get the request, which was sent to mPAY24 (in XML form)

getRequest() 
inherited

Get the response from mPAY24 (in XML form)

getResponse() 
inherited

Check whether a proxy is used

proxyUsed() 
inherited

Set debug modus (FALSE by default)

setDebug(bool $debug) 
inherited

Arguments

$debug

bool

TRUE if is turned on, otherwise FALSE

Check whether the debug modus is turned on or off

getDebug() 
inherited

In case the test system is used, show die with the real error message, otherwise, show the difined constant error LIVE_ERROR_MSG

dieWithMsg(string $msg) 
inherited

Arguments

$msg

string

The message, which is shown to the user

In case the test system is used, show print the real error message, otherwise, show the difined constant error LIVE_ERROR_MSG

printMsg(string $msg) 
inherited

Arguments

$msg

string

The message, which is shown to the user

Die with an error message, which show the path in case of read/write permission errors

permissionError() 
inherited

Get all the payment methods, that are available for the merchant by mPAY24

ListPaymentMethods() 
inherited

Start a secure payment through the mPAY24 payment window - the sensible data (credit card numbers, bank account numbers etc) is (will be) not saved in the shop

SelectPayment(\ORDER $mdxi) 
inherited

Arguments

$mdxi

\ORDER

The mdxi xml, which contains the shopping cart

Start a secure payment using a PROFILE (mPAY24 proSAFE), supported by mPAY24 - a customer profile (you have already created) will be used for the payment.

ProfilePayment(\ORDER $requestString) 
inherited

The payment window will not be called, the payment source (for example credit card), which was used from the customer by the last payment will be used for the transaction.

Arguments

$requestString

\ORDER

The order xml, which contains the shopping cart

Start a secure payment using a PayPal Express Checkout, supported by mPAY24 - the customer doesn't need to be logged in in the shop or to give any data (addresses or payment information), but will be redirected to the PayPal site, and all the information from PayPal will be taken for the payment.

ExpressCheckoutPayment(\ORDER $requestString) 
inherited

Arguments

$requestString

\ORDER

The order xml, which contains the shopping cart

Initialize a manual callback to mPAY24 in order to check the information provided by PayPal

CallbackPaypal(string $requestString) 
inherited

Arguments

$requestString

string

The callback request to mPAY24

Clear a transaction with an amount

ManualClear(int $mPAYTid, int $amount, string $currency) 
inherited

Arguments

$mPAYTid

int

The mPAY24 transaction ID

$amount

int

The amount to be cleared multiplay by 100

$currency

string

3-digit ISO currency code: EUR, USD, etc

Credit a transaction with an amount

ManualCredit(int $mPAYTid, int $amount, string $currency, string $customer) 
inherited

Arguments

$mPAYTid

int

The mPAY24 transaction ID

$amount

int

The amount to be credited multiplay by 100

$currency

string

3-digit ISO currency code: EUR, USD, etc

$customer

string

The name of the customer, who has paid

Cancel a transaction

ManualReverse(int $mPAYTid) 
inherited

Arguments

$mPAYTid

int

The mPAY24 transaction ID for the transaction you want to cancel

Get all the information for a transaction, supported by mPAY24

TransactionStatus(int $mPAYTid = null, string $tid = null) 
inherited

Arguments

$mPAYTid

int

The mPAY24 transaction ID

$tid

string

The transaction ID from your shop

Set the merchant ID (without 'u')

setMerchantID(string $merchantID = null) 
inherited

Arguments

$merchantID

string

The merchant ID

Set the SPID

setSPID(string $spid) 
inherited

Arguments

$spid

string

The SPID of your account, supported by mPAY24

Set the Web-Services/SOAP password

setSoapPassword(string $pass = null) 
inherited

Arguments

$pass

string

The SOAP password, provided by mPAY24

Set the flexLINK password

setPassword(string $pass) 
inherited

Arguments

$pass

string

The flexLINK password, provided by mPAY24

Set whether the tets system (true) or the live system (false) will be used for the SOAP requests Set the POST url

setSystem(bool $test = null) 
inherited

("https://test.mpay24.com/app/bin/etpproxy_v14" or

"https://www.mpay24.com/app/bin/etpproxy_v14")

Arguments

$test

bool

TRUE for TEST system and FALSE for LIVE system.

Set whether the tets system (true) or the live system (false) will be used for the flexLINK requests

setFlexLINKSystem(bool $test = null) 
inherited

Arguments

$test

bool

TRUE for TEST system and FALSE for LIVE system.

Set the used proxy host and proxy port in case proxy is used

setProxySettings(string $proxy_host = "", string $proxy_port = "") 
inherited

Arguments

$proxy_host

string

Proxy host

$proxy_port

string

Proxy port

Create a DOMDocument and prepare it for SOAP request: set Envelope, NameSpaces, create empty Body

buildEnvelope() 
inherited

Create a curl request and send the cretaed SOAP XML

send() 
inherited

Encode data (AES256-CBC) using a password

ssl_encrypt(string $pass, string $data) 
inherited

Arguments

$pass

string

The password, used for the encoding

$data

string

The data, that should be encoded

Properties

TRUE, when you want to use the test system, and FALSE otherwise

test

'test', when you want to use the test system, and 'www' otherwise

flexLINKSystem

The link where the requests should be sent to

etp_url

DEFAULT : https://test.mpay24.com/app/bin/etpproxy_v14 (TEST SYSTEM)

The merchant ID (supported from mPAY24). 5-digit number. Begin with 9 for test system, begin with 7 for the live system.

merchantid

SPID (supported from mPAY24).

spid

The SOAP password (supproted from mPAY24)

soappass

The flexLINK password (supproted from mPAY24)

pass

The fix (envelope) part of the soap xml, which is to be sent to mPAY24

soap_xml

The host name, in case you are using proxy

proxy_host

4-digit port number, in case you are using proxy

proxy_port

The whole soap-xml (envelope and body), which is to be sent to mPAY24 as request

request

The response from mPAY24

response

TRUE if log files are to be written, by default - FALSE

debug