micropayment Service Client

Description

This client library provides easy access to the (compatible) payment services offered by micropayment, and helps you to get the most out of our services!
With this library you can use our services like a normal class.
There's no need to concern yourself with details such as correct encoding, the querying of services, and the analysis of responses.

Hint: The error codes/ -messages that are returned by the web service are automatically converted to PHP exception by the service client.

Contents of the Library

Downloads

Changelog

  • v1.24 2020-01-22
    • CreditcardService v2.3 added
  • v1.23 2017-11-29
    • CHG: Explicit setting stream context SSL option crypto_method to "STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT | STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT | STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT" for TLS and "STREAM_CRYPTO_METHOD_ANY_CLIENT" as fallback
  • v1.22 2017-06-12
    • DebitService v2.3 added
  • v1.21 2017-01-18
    • FIX: Line-Break-Style in building HTTP-Request
    • FIX: Remove extra Line-Break after HTTP-Message-Body on POST (RFC7230/RFC 2616)
    • CHG: use stream_socket_client instead of fsockopen in HTTP-Client (Control of SSL options)
  • v1.20 2016-12-07
    • CreditcardService v2.0 added
    • CreditcardService v1.6.1 added
    • CreditcardService v1.6 added
  • v1.19 2016-04-18
    • FIX: Fatal error: Switch statements may only contain one default clause in TDispatchRequestAdapter.php
  • v1.18 2016-02-12
    • DebitService v2.1 added
    • PrepayService v1.1 added
    • CreditcardService < removed
    • DebitService < v2.1 removed
    • PrepayService < v1.1 removed
  • v1.17 2014-06-25
    • FIX: TSimpleHttpBase::isHeader() correct missing return
  • v1.16 2012-09-06
    • QUICKFIX: for Bug#62715 in PHP 5.3.16 causing
      Fatal error: Uncaught exception 'ReflectionException' with message 'Parameter is not optional'
  • v1.15 2012-05-08
    • Change: TSimpleHttpClient::request() force HTTP/1.0 (chuncked-encoding issue)
  • v1.14 2011-12-30
    • PrepayService v1.0 Bugfix: ServiceInterface `transactionGet`
  • v1.13 2011-10-12
    • CreditcardService v1.5 added
    • CreditcardService all versionen updated (DocComments)
  • v1.12 2011-06-29
    • PrepayService v1.0 added
  • v1.11 2011-05-17
    • CreditcardService v1.4.2 added
  • v1.10 2011-05-06
    • CreditcardService v1.4.1 added
  • v1.9 2011-04-05
    • CreditcardService v1.4 added
  • v1.8 2011-02-22
    • DebitService v1.4 added
    • DebitService v1.3 added
    • DebitService v1.2 added
    • DebitService v1.1 added
    • DebitService v1.0 added
  • v1.7 2011-01-18
    • CreditcardService v1.3 added
  • v1.6 2010-12-10
    • CreditcardService v1.2.1 added
  • v1.5 2010-09-09
    • CreditcardService v1.2 added
  • v1.4 2009-08-11
    • Bugfix: THttpParamsDispatchRequestAdapter in case the "php.ini" value for "arg_separator.output" any other value is configured as "&"
  • v1.3 2009-07-16
    • Bugfix: CreditcardService::customerGet (v1.0, v1.1) Return Values were defined as mandatory, although they are optional in "customerCreate"
  • v1.2 2009-04-28
    • CreditcardService v1.1 added
  • v1.1 2008-09-08
    • CreditCardService::sessionList does not return any results list – [HotFix] TDispatchResponseAdapter::formatDataWithReflection())

General Example for Use Based on CreditcardService v1.2 (NVP)

<?php
    
if(!defined('MCP__ACCESSKEY'))
        
define('MCP__ACCESSKEY''HIER IHREN ACCESSKEY EINTRAGEN');

    if(!
defined('MCP__TESTMODE'))
        
define('MCP__TESTMODE'1);

    if(!
defined('MCP__CREDITCARDSERVICE_NVP_URL'))
        
define('MCP__CREDITCARDSERVICE_NVP_URL''https://sipg.micropayment.de/public/creditcard/v1.2/nvp/');

    if(!
defined('MCP__CREDITCARDSERVICE_INTERFACE'))
        
define('MCP__CREDITCARDSERVICE_INTERFACE''IMcpCreditcardService_v1_2');


    require_once( 
'path/to/micropayment/lib/init.php' );
    require_once( 
'path/to/micropayment/services/' MCP__CREDITCARDSERVICE_INTERFACE '.php' );
    require_once( 
MCP__SERVICELIB_DISPATCHER 'TNvpServiceDispatcher.php');

    try {
        
$dispatcher = new TNvpServiceDispatcher(MCP__CREDITCARDSERVICE_INTERFACEMCP__CREDITCARDSERVICE_NVP_URL);

        
$customerId    '5f48390a62c6af665a6e3b9cd04ce5dc'// es handelt sich hierbei nur um einen Beispielwert

    // M�glichkeit 1
    // dabei m�ssen alle Parameter in der Reihenfolge wie im Interface beschrieben, ï¿½bergeben werden, auch jene die Standardwerte haben
        
$result $dispatcher -> sessionList(MCP__ACCESSKEYMCP__TESTMODE$customerId);

    
// M�glichkeit 2
        
$aParams = array();
        
$aParams['accessKey']    = MCP__ACCESSKEY;
    
//  $aParams['testMode']    = MCP__TESTMODE; // kann weggelassen werden
        
$aParams['customerId'] = $customerId;
        
$result $dispatcher -> send('sessionList'$aParams);

        
print_r($result);

    }
    catch(
Exception $e) {
        echo 
'Exception[' $e -> getCode() . '] ' $e -> getMessage();
    }

?>