2017 © Pedro Peláez
 

library paymill

Paymill PHPLib

image

paymill/paymill

Paymill PHPLib

  • Tuesday, September 26, 2017
  • by Paymill
  • Repository
  • 48 Watchers
  • 101 Stars
  • 193,441 Installations
  • PHP
  • 12 Dependents
  • 0 Suggesters
  • 53 Forks
  • 14 Open issues
  • 56 Versions
  • 4 % Grown

The README.md

PAYMILL-PHP

Build StatusLatest Stable VersionTotal Downloads, (*1)

VERSIONING

This wrapper is using the api v2.1 launched in June 2014. If you wish to use the old api v2.0 please use the wrapper in branch v2: https://github.com/paymill/paymill-php/tree/v2., (*2)

How to test cards and errors

There are different credit card numbers, frontend and backend error codes, which can be used for testing. For more information, please read our testing reference. https://www.paymill.com/en-gb/documentation-3/reference/testing/, (*3)

How to run unit and integration tests

Just run:, (*4)

ant test

Getting started with PAYMILL

If you don't already use Composer, then you probably should read the installation guide http://getcomposer.org/download/., (*5)

Please include this library via Composer in your composer.json and execute composer update to refresh the autoload.php., (*6)

{
  "repositories": [
    {
      "type": "vcs",
      "url": "https://github.com/paymill/paymill-php"
    }
  ],
  "require": {
    "paymill/paymill": "dev-master"
  }
}

If you don't want to use composer, paymill-php library provides its own autoload script. You have to include the autoload script in all files, in which you are going to use the PAYMILL library., (*7)

Lets say you have two files, which are going to use the PAYMILL lib. First one is located in the project root, the other one is in the app folder. You have downloaded the PAYMILL library in your project root folder under the name paymill-php., (*8)

To load the PAYMILL library from the file, which is located in your project root folder, you need to require PAYMILL's autoload script like this:, (*9)

require './paymill-php/autoload.php';

To load the PAYMILL library from the file, which is located in the app folder, you need to require PAYMILL's autoload script like this:, (*10)

require '../paymill-php/autoload.php';
  1. Instantiate the request class with the following parameters: $apiKey: First parameter is always your private API (test) Key, (*11)

    $request = new Paymill\Request($apiKey);
    
  2. Instantiate the model class with the parameters described in the API-reference:, (*12)

    $payment = new \Paymill\Models\Request\Payment();
    $payment->setToken("098f6bcd4621d373cade4e832627b4f6");
    
  3. Use your desired function:, (*13)

    $response  = $request->create($payment);
    $paymentId = $response->getId();
    

It recommend to wrap it into a "try/catch" to handle exceptions like this:, (*14)

try {
  $response  = $request->create($payment);
  $paymentId = $response->getId();
} catch(\Paymill\Services\PaymillException $e){
  //Do something with the error informations below
  $e->getResponseCode();
  $e->getStatusCode();
  $e->getErrorMessage();
  $e->getRawError();
}

Receiving Response

This section shows diffrent ways how to receive a response. The followings examples show how to get the Id for a transaction., (*15)

  1. The default response is one of the response-models.
$response  = $request->create($payment);
$response->getId();
  1. getLastResponse() returns the unconverted response from the API.
$request->create($payment);
$response = $request->getLastResponse();
$response['body']['data']['id'];
  1. getJSONObject returns the response as stdClass-Object.
$request->create($payment);
$response = $request->getJSONObject();
$response->data->id;

Using Root certificate

If the error below occurres on your system please follow the steps below to configure curl., (*16)

Paymill\Services\PaymillException: SSL certificate problem, verify that the CA cert is OK. Details:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed

Windows / OS X / Linux, (*17)

  1. Download http://curl.haxx.se/ca/cacert.pem and save it on your server.
  2. Open php.ini with an editor and add the line curl.cainfo=PathToYourCACertFile
  3. Restart your Webserver

Update Root certificate on Linux(ubuntu), (*18)

  1. Run sudo update-ca-certificates
  2. Restart your Webserver

Changelog

3.2.1

  • bugfix: #92 remove typecheck for http response code

4.0.0

Documentation

For further information, please refer to our official PHP library reference: https://developers.paymill.com/API/index, (*19)

The Versions

26/09 2017

dev-master

9999999-dev https://www.paymill.de

Paymill PHPLib

  Sources   Download

MIT

payment provider

21/06 2017

v4.5.0.x-dev

4.5.0.9999999-dev https://www.paymill.de

Paymill PHPLib

  Sources   Download

MIT

payment provider

26/05 2017

dev-v2.4.0-ssl-hotfix

dev-v2.4.0-ssl-hotfix https://www.paymill.de

  Sources   Download

MIT

payment provider

10/02 2017

v4.4.2

4.4.2.0 https://www.paymill.de

Paymill PHPLib

  Sources   Download

MIT

payment provider

23/12 2016

dev-trx-init-patch-1

dev-trx-init-patch-1 https://www.paymill.de

Paymill PHPLib

  Sources   Download

MIT

payment provider

25/04 2016

v4.4.1

4.4.1.0 https://www.paymill.de

Paymill PHPLib

  Sources   Download

MIT

payment provider

29/03 2016

v4.4.0

4.4.0.0 https://www.paymill.de

Paymill PHPLib

  Sources   Download

MIT

payment provider

22/03 2016

v4.3.0

4.3.0.0 https://www.paymill.de

Paymill PHPLib

  Sources   Download

MIT

payment provider

22/03 2016

v4.2.0

4.2.0.0 https://www.paymill.de

Paymill PHPLib

  Sources   Download

MIT

payment provider

21/03 2016

v4.1.1

4.1.1.0 https://www.paymill.de

Paymill PHPLib

  Sources   Download

MIT

payment provider

01/03 2016

v4.1.0

4.1.0.0 https://www.paymill.de

Paymill PHPLib

  Sources   Download

MIT

payment provider

01/12 2015

dev-add-ClientId-To-Checksum

dev-add-ClientId-To-Checksum https://www.paymill.de

Paymill PHPLib

  Sources   Download

MIT

payment provider

24/09 2015

dev-correct_csv_http_header

dev-correct_csv_http_header https://www.paymill.de

Paymill PHPLib

  Sources   Download

MIT

payment provider

10/08 2015

dev-curl_opt_merge_fix

dev-curl_opt_merge_fix https://www.paymill.de

Paymill PHPLib

  Sources   Download

MIT

payment provider

15/06 2015

v4.0.0

4.0.0.0 https://www.paymill.de

Paymill PHPLib

  Sources   Download

MIT

payment provider

04/06 2015

dev-nebula

dev-nebula https://www.paymill.de

Paymill PHPLib

  Sources   Download

MIT

payment provider

04/06 2015

v3.2.2.1

3.2.2.1 https://www.paymill.de

Paymill PHPLib

  Sources   Download

MIT

payment provider

24/04 2015

dev-add_webhook_verification

dev-add_webhook_verification https://www.paymill.de

Paymill PHPLib

  Sources   Download

MIT

payment provider

24/04 2015

dev-add-webhook-verification

dev-add-webhook-verification https://www.paymill.de

Paymill PHPLib

  Sources   Download

MIT

payment provider

03/03 2015

v3.2.2

3.2.2.0 https://www.paymill.de

Paymill PHPLib

  Sources   Download

MIT

payment provider

07/01 2015

dev-sepa

dev-sepa https://www.paymill.de

Paymill PHPLib

  Sources   Download

MIT

payment provider

07/01 2015

v3.2.1

3.2.1.0 https://www.paymill.de

Paymill PHPLib

  Sources   Download

MIT

payment provider

17/11 2014

v3.2.0

3.2.0.0 https://www.paymill.de

Paymill PHPLib

  Sources   Download

MIT

payment provider

17/11 2014

dev-issues/issue87

dev-issues/issue87 https://www.paymill.de

Paymill PHPLib

  Sources   Download

MIT

payment provider

16/11 2014

dev-autoloader

dev-autoloader https://www.paymill.de

Paymill PHPLib

  Sources   Download

MIT

payment provider

25/08 2014

dev-develop

dev-develop https://www.paymill.de

Paymill PHPLib

  Sources   Download

MIT

payment provider

25/08 2014

v3.1.2

3.1.2.0 https://www.paymill.de

Paymill PHPLib

  Sources   Download

MIT

payment provider

25/08 2014

dev-php5.2

dev-php5.2 https://www.paymill.de

  Sources   Download

MIT

payment provider

25/08 2014

v2.3.1

2.3.1.0 https://www.paymill.de

  Sources   Download

MIT

payment provider

19/08 2014

dev-add_source_to-transaction

dev-add_source_to-transaction https://www.paymill.de

Paymill PHPLib

  Sources   Download

MIT

payment provider

13/08 2014

v3.1.1

3.1.1.0 https://www.paymill.de

Paymill PHPLib

  Sources   Download

MIT

payment provider

12/08 2014

v3.1.0

3.1.0.0 https://www.paymill.de

Paymill PHPLib

  Sources   Download

MIT

payment provider

12/08 2014

v3.0.7

3.0.7.0 https://www.paymill.de

Paymill PHPLib

  Sources   Download

MIT

payment provider

07/08 2014

dev-transaction_source

dev-transaction_source https://www.paymill.de

Paymill PHPLib

  Sources   Download

MIT

payment provider

07/08 2014

v3.0.6

3.0.6.0 https://www.paymill.de

Paymill PHPLib

  Sources   Download

MIT

payment provider

06/08 2014

v1.1.0

1.1.0.0 https://www.paymill.de

  Sources   Download

MIT

payment provider

23/07 2014

v3.0.4

3.0.4.0 https://www.paymill.de

Paymill PHPLib

  Sources   Download

MIT

payment provider

21/07 2014

dev-checksum

dev-checksum https://www.paymill.de

Paymill PHPLib

  Sources   Download

MIT

payment provider

03/07 2014

v3.0.3

3.0.3.0 https://www.paymill.de

Paymill PHPLib

  Sources   Download

MIT

payment provider

09/05 2014

2.x-dev

2.9999999.9999999.9999999-dev https://www.paymill.de

Paymill PHPLib

  Sources   Download

MIT

payment provider

09/05 2014

dev-descForPreauth

dev-descForPreauth https://www.paymill.de

Paymill PHPLib

  Sources   Download

MIT

payment provider

12/03 2014

dev-mc20

dev-mc20 https://www.paymill.de

Paymill PHPLib

  Sources   Download

MIT

payment provider

17/11 2013

v3.0.2

3.0.2.0 https://www.paymill.de

Paymill PHPLib

  Sources   Download

MIT

payment provider

11/11 2013

v3.0.1

3.0.1.0 https://www.paymill.de

Paymill PHPLib

  Sources   Download

MIT

payment provider

15/10 2013

v3.0.0

3.0.0.0 https://www.paymill.de

Paymill PHPLib

  Sources   Download

MIT

payment provider

07/08 2013

v2.4.0

2.4.0.0 https://www.paymill.de

  Sources   Download

MIT

payment provider

16/07 2013

v2.3.0

2.3.0.0 https://www.paymill.de

  Sources   Download

MIT

payment provider

27/06 2013

v2.2.3

2.2.3.0 https://www.paymill.de

  Sources   Download

MIT

payment provider

08/06 2013

v2.2.2

2.2.2.0 https://www.paymill.de

  Sources   Download

MIT

payment provider

30/05 2013

v2.2.1

2.2.1.0 https://www.paymill.de

  Sources   Download

MIT

payment provider

02/05 2013

dev-CURLOPT_SSLVERSION

dev-CURLOPT_SSLVERSION https://www.paymill.de

  Sources   Download

MIT

payment provider

28/03 2013

v2.2.0

2.2.0.0 https://www.paymill.de

  Sources   Download

MIT

payment provider

24/01 2013

v2.1.1

2.1.1.0 https://www.paymill.de

  Sources   Download

MIT

payment provider

28/11 2012

v2.1.0

2.1.0.0 https://www.paymill.de

  Sources   Download

MIT

payment provider

14/11 2012

v2.0.0

2.0.0.0 https://www.paymill.de

  Sources   Download

MIT

payment provider

23/10 2012

v1.0.0

1.0.0.0 https://www.paymill.de

  Sources   Download

MIT

payment provider