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.26 2022-11-30
      • CreditcardService v1.5 removed
      • CreditcardService v1.6 removed
      • CreditcardService v1.6.1 removed
  • v1.25 2021-03-22
    • CHG: Adjustments for PHP compatibility: PHP 7.4, PHP 8.0
  • 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 v2.3 (NVP)

<?php
if (!defined('MCP__ACCESSKEY')) {
    
define('MCP__ACCESSKEY''ENTER YOUR ACCESSKEY HERE');
}

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/v2.3/nvp/');
}

if (!
defined('MCP__CREDITCARDSERVICE_INTERFACE')) {
    
define('MCP__CREDITCARDSERVICE_INTERFACE''IMcpCreditcardService_v2_3');
}


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 null// Optional
    
$customerId '5f48390a62c6af665a6e3b9cd04ce5dc'// this is just an example value

    // Possibility 1
    // all parameters must be passed in the order described in the interface, including those that have default values
    
$result $dispatcher->sessionList(MCP__ACCESSKEYMCP__TESTMODE$customerId);

    
// Possibility 2
    
$aParams = [];
    
$aParams['accessKey'] = MCP__ACCESSKEY;
    
//  $aParams['testMode']    = MCP__TESTMODE; // can be omitted
    
$aParams['customerId'] = $customerId;
    
$result $dispatcher->send('sessionList'$aParams);

    
print_r($result);

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