MPay24Shop

Extends \Transaction

The abstract MPay24Shop class provides abstract functions, which are used from the other functions in order to make a payment or a request to mPAY24

TYPE: PARAMETER - VALUE(s), description

  • STRING: STATUS - OK, ERROR
  • STRING: OPERATION - CONFIRMATION
  • STRING: TID - length <= 32
  • STRING: TRANSACTION_STATUS - RESERVED, BILLED, REVERSED, CREDITED, ERROR
  • INT: PRICE - length = 11 (e. g. "10" = "0,10")
  • STRING: CURRENCY - length = 3 (ISO currency code, e. g. "EUR")
  • STRING: P_TYPE - CC, ELV, EPS, GIROPAY, MAESTRO, PB, PSC, QUICK, etc
  • STRING: BRAND - AMEX, DINERS, JCB, MASTERCARD, VISA, ATOS, HOBEX-AT, HOBEX-DE, etc
  • INT: MPAYTID - length = 11
  • STRING: USER_FIELD
  • STRING: ORDERDESC
  • STRING: CUSTOMER
  • STRING: CUSTOMER_EMAIL
  • STRING: LANGUAGE - length = 2
  • STRING: CUSTOMER_ID - length = 11
  • STRING: PROFILE_STATUS - IGNORED, USED, ERROR, CREATED, UPDATED, DELETED
  • STRING: FILTER_STATUS
  • STRING: APPR_CODE
author mPAY24 GmbH <support@mpay24.com>
version $Id: MPay24Shop.php 5522 2013-06-24 13:08:35Z anna $
filesource MPay24Shop.php
license http://ec.europa.eu/idabc/eupl.html EUPL, Version 1.1

Methods

The constructor, which sets all the initial values, in order to be able making transactions

MPay24Shop(int $merchantID, string $soapPassword, bool $test, string $proxyHost = null, int $proxyPort = null, bool $debug = false) 
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)

$debug

bool

TRUE - when you want to write log files, FALSE - when you don't want write log files

Create a transaction and save/return this (in a data base or file system (for example XML))

createTransaction() 
inherited

Actualize the transaction, which has a transaction ID = $tid with the values from $args in your shop and return it

updateTransaction(string $tid, array $args, bool $shippingConfirmed) 
inherited

Arguments

$tid

string

The transaction ID you want to update with the confirmation

$args

array

Arrguments with them the transaction is to be updated

$shippingConfirmed

bool

TRUE if the shipping address is confirmed, FALSE - otherwise (in case of PayPal Express Checkout)

Give the transaction object back, for a transaction which has a transaction ID = $tid

getTransaction(string $tid) 
inherited

Arguments

$tid

string

The transaction ID of the transaction you want get

Using the ORDER object from order.php, create a MDXI-XML, which is needed for a transaction to be started

createMDXI(\Transaction $transaction) 
inherited

Arguments

$transaction

\Transaction

The transaction you want to make a MDXI XML file for

Using the ORDER object from order.php, create a order-xml, which is needed for a transaction with profiles to be started

createProfileOrder(string $tid) 
inherited

Arguments

$tid

string

The transaction ID of the transaction you want to make an order transaction XML file for

Using the ORDER object from order.php, create a order-xml, which is needed for a transaction with PayPal Express Checkout to be started

createExpressCheckoutOrder(string $tid) 
inherited

Arguments

$tid

string

The transaction ID of the transaction you want to make an order transaction XML file for

Using the ORDER object from order.php, create a order-xml, which is needed for a transaction with PayPal Express Checkout to be finished

createFinishExpressCheckoutOrder(string $tid, string $shippingCosts, string $amount, bool $cancel) 
inherited

Arguments

$tid

string

The transaction ID of the transaction you want to make an order transaction XML file for

$shippingCosts

string

The shipping costs amount for the transaction, provided by PayPal, after changing the shipping address

$amount

string

The new amount for the transaction, provided by PayPal, after changing the shipping address

$cancel

bool

TRUE if the a cancelation is wanted after renewing the amounts and FALSE otherwise

Write a log into a file, file system, data base

write_log(string $operation, string $info_to_log) 
inherited

Arguments

$operation

string

The operation, which is to log: GetPaymentMethods, Pay, PayWithProfile, Confirmation, UpdateTransactionStatus, ClearAmount, CreditAmount, CancelTransaction, etc.

$info_to_log

string

The information, which is to log: request, response, etc.

This is an optional function, but it's strongly recomended that you implement it - see details.

createSecret(string $tid, string $amount, string $currency, string $timeStamp) 
inherited

It should build a hash from the transaction ID of your shop, the amount of the transaction, the currency and the timeStamp of the transaction. The mPAY24 confirmation interface will be called with this hash (parameter name 'token'), so you would be able to check whether the confirmation is really coming from mPAY24 or not. The hash should be then saved in the transaction object, so that every transaction has an unique secret token.

Arguments

$tid

string

The transaction ID you want to make a secret key for

$amount

string

The amount, reserved for this transaction

$currency

string

The timeStamp at the moment the transaction is created

$timeStamp

string

The timeStamp at the moment the transaction is created

Get the secret (hashed) token for a transaction

getSecret(string $tid) 
inherited

Arguments

$tid

string

The transaction ID you want to get the secret key for

Get a list which includes all the payment methods (activated by mPAY24) for your mechant ID

getPaymentMethods() 
inherited

Return a redirect URL to start a payment

pay() 
inherited

Start a payment with customer profile

payWithProfile() 
inherited

Start a payment with PayPal Express Checkout

payWithExpressCheckout() 
inherited

Finish the payment, started with PayPal Express Checkout - reserve, bill or cancel it: Whether are you going to reserve or bill a payment is setted at the beginning of the payment. With the 'cancel' parameter you are able also to cancel the transaction

finishExpressCheckoutPayment(string $tid, int $shippingCosts, int $amount, string $cancel) 
inherited

Arguments

$tid

string

The transaction ID in the shop

$shippingCosts

int

The shippingcosts for the transaction multiply by 100

$amount

int

The amount you want to reserve/bill multiply by 100

$cancel

string

ALLOWED: "true" or "false" - in case of 'true' the transaction will be canceled, otherwise reserved/billed

Proceed the confirmation call

confirm(string $tid, array $args) 
inherited

Arguments

$tid

string

The transaction ID in the shop

$args

array

A list with the arguments, provided with the confirmation

Get the transaction's current information - see details

updateTransactionStatus(string $tid) 
inherited

An array with all the data (by mPAY24) for this transaction (STATUS, CURRENCY, PRICE, APPR_CODE, etc) will be returned. Possible values for the STATUS attribute:

  • RESERVED - in case the authorization was successful but not cleared yet
  • BILLED - in case the authorization was successful and amount was cleared
  • CREDITED - in case amount was credited
  • REVERSED - in case the transaction was canceled
  • SUSPENDED - in case the transaction is not fully compleated yet
  • NOT FOUND - in case there is not such a transaction in the mPAY24 database
  • ERROR - in case the transaction was not successful

Arguments

$tid

string

The transaction ID (in your shop), for the transaction you are asking for

Clear an amount of an authorized transaction

clearAmount(string $tid, int $amount) 
inherited

Arguments

$tid

string

The transaction ID, for the transaction you want to clear

$amount

int

The amount you want to clear multiply by 100

Credit an amount of a billed transaction

creditAmount(string $tid, int $amount) 
inherited

Arguments

$tid

string

The transaction ID, for the transaction you want to credit

$amount

int

The amount you want to credit multiply by 100

Cancel a authorized transaction

cancelTransaction(string $tid) 
inherited

Arguments

$tid

string

The transaction ID, for the transaction you want to cancel

Check if the a transaction is created, whether the object is from type Transaction and whether the mandatory settings (TID and PRICE) of a transaction are setted

checkTransaction($transaction) 
inherited

Arguments

$transaction

Properties

The mPAY24API Object, with you are going to work

mPay24Api