PHPackages                             paymill/paymill - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Payment Processing](/categories/payments)
4. /
5. paymill/paymill

ActiveLibrary[Payment Processing](/categories/payments)

paymill/paymill
===============

Paymill PHPLib

v4.4.2(9y ago)92354.6k↓32.8%47[11 issues](https://github.com/paymill/paymill-php/issues)[2 PRs](https://github.com/paymill/paymill-php/pulls)8MITPHP

Since Oct 23Pushed 7y ago42 watchersCompare

[ Source](https://github.com/paymill/paymill-php)[ Packagist](https://packagist.org/packages/paymill/paymill)[ Docs](https://www.paymill.de)[ RSS](/packages/paymill-paymill/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)DependenciesVersions (56)Used By (8)

PAYMILL-PHP
===========

[](#paymill-php)

[![Build Status](https://camo.githubusercontent.com/0f288b9f450d36ef65e873ef6887747ac8f1844c6a0fa4042992f0613d36db15/68747470733a2f2f7472617669732d63692e6f72672f7061796d696c6c2f7061796d696c6c2d7068702e706e67)](https://travis-ci.org/paymill/paymill-php)[![Latest Stable Version](https://camo.githubusercontent.com/af9fe5da926734f61f2e6ea30ed5486a56c1ab413f812b08ee0ee7dfac504cda/68747470733a2f2f706f7365722e707567782e6f72672f7061796d696c6c2f7061796d696c6c2f762f737461626c652e706e67)](https://packagist.org/packages/paymill/paymill)[![Total Downloads](https://camo.githubusercontent.com/eca4877263db2aac5b119221d0b2c03793b9d764065cd2148685bffa18559efb/68747470733a2f2f706f7365722e707567782e6f72672f7061796d696c6c2f7061796d696c6c2f646f776e6c6f6164732e706e67)](https://packagist.org/packages/paymill/paymill)

VERSIONING
----------

[](#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: .

How to test cards and errors
----------------------------

[](#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.

How to run unit and integration tests
-------------------------------------

[](#how-to-run-unit-and-integration-tests)

Just run:

```
ant test

```

Getting started with PAYMILL
----------------------------

[](#getting-started-with-paymill)

If you don't already use Composer, then you probably should read the installation guide .

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

```
{
  "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.

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**.

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:

```
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:

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

1. Instantiate the request class with the following parameters: $apiKey: First parameter is always your private API (test) Key

```
$request = new Paymill\Request($apiKey);
```

1. Instantiate the model class with the parameters described in the API-reference:

```
$payment = new \Paymill\Models\Request\Payment();
$payment->setToken("098f6bcd4621d373cade4e832627b4f6");
```

1. Use your desired function:

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

It recommend to wrap it into a "try/catch" to handle exceptions like this:

```
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
------------------

[](#receiving-response)

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

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
----------------------

[](#using-root-certificate)

If the error below occurres on your system please follow the steps below to configure curl.

```
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

1. Download  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)

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

Changelog
---------

[](#changelog)

#### 3.2.1

[](#321)

- bugfix: [\#92](https://github.com/paymill/paymill-php/pull/92) remove typecheck for http response code

#### 4.0.0

[](#400)

- Added shipping and billing address
- Added shopping cart (items)
- Added PayPal functionality
- Possible [BC break in ResponseHandler.php](https://github.com/paymill/paymill-php/pull/102#discussion_r32232137)

Documentation
-------------

[](#documentation)

For further information, please refer to our official PHP library reference:

###  Health Score

48

—

FairBetter than 95% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity50

Moderate usage in the ecosystem

Community39

Small or concentrated contributor base

Maturity77

Established project with proven stability

 Bus Factor4

4 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~48 days

Recently: every ~114 days

Total

36

Last Release

3253d ago

Major Versions

v2.4.0 → v3.0.02013-10-15

2.x-dev → v3.0.32014-07-03

v1.1.0 → v3.0.62014-08-07

v2.3.1 → v3.1.22014-08-25

v3.2.2.1 → v4.0.02015-06-15

### Community

Maintainers

![](https://www.gravatar.com/avatar/7b588bb5f00faa785e68c8a63bfb40ed379579dcd5ba7c3dbe8f80ac264124ed?d=identicon)[Paymill](/maintainers/Paymill)

---

Top Contributors

[![moritzdeissner](https://avatars.githubusercontent.com/u/7236975?v=4)](https://github.com/moritzdeissner "moritzdeissner (41 commits)")[![tschelabaumann](https://avatars.githubusercontent.com/u/2387044?v=4)](https://github.com/tschelabaumann "tschelabaumann (9 commits)")[![nikoloff](https://avatars.githubusercontent.com/u/913537?v=4)](https://github.com/nikoloff "nikoloff (9 commits)")[![mschindler83](https://avatars.githubusercontent.com/u/2979969?v=4)](https://github.com/mschindler83 "mschindler83 (8 commits)")[![stoilkov](https://avatars.githubusercontent.com/u/1336383?v=4)](https://github.com/stoilkov "stoilkov (7 commits)")[![cyrrill](https://avatars.githubusercontent.com/u/2376084?v=4)](https://github.com/cyrrill "cyrrill (7 commits)")[![pm-alexander-serbe](https://avatars.githubusercontent.com/u/14940660?v=4)](https://github.com/pm-alexander-serbe "pm-alexander-serbe (7 commits)")[![christian-kolb](https://avatars.githubusercontent.com/u/1033270?v=4)](https://github.com/christian-kolb "christian-kolb (6 commits)")[![PMTwen](https://avatars.githubusercontent.com/u/6231046?v=4)](https://github.com/PMTwen "PMTwen (4 commits)")[![andre-paymill](https://avatars.githubusercontent.com/u/6338287?v=4)](https://github.com/andre-paymill "andre-paymill (4 commits)")[![awhido](https://avatars.githubusercontent.com/u/2362279?v=4)](https://github.com/awhido "awhido (3 commits)")[![l0ck3](https://avatars.githubusercontent.com/u/551294?v=4)](https://github.com/l0ck3 "l0ck3 (3 commits)")[![extronics](https://avatars.githubusercontent.com/u/1537631?v=4)](https://github.com/extronics "extronics (3 commits)")[![Plato2013](https://avatars.githubusercontent.com/u/5553531?v=4)](https://github.com/Plato2013 "Plato2013 (2 commits)")[![Savaage](https://avatars.githubusercontent.com/u/16238053?v=4)](https://github.com/Savaage "Savaage (1 commits)")[![ScottEAdams](https://avatars.githubusercontent.com/u/624154?v=4)](https://github.com/ScottEAdams "ScottEAdams (1 commits)")[![teoiliev](https://avatars.githubusercontent.com/u/2583666?v=4)](https://github.com/teoiliev "teoiliev (1 commits)")[![topsitemakers](https://avatars.githubusercontent.com/u/2714932?v=4)](https://github.com/topsitemakers "topsitemakers (1 commits)")[![Nyholm](https://avatars.githubusercontent.com/u/1275206?v=4)](https://github.com/Nyholm "Nyholm (1 commits)")[![dynamicnet](https://avatars.githubusercontent.com/u/659594?v=4)](https://github.com/dynamicnet "dynamicnet (1 commits)")

---

Tags

providerpayment

### Embed Badge

![Health badge](/badges/paymill-paymill/health.svg)

```
[![Health](https://phpackages.com/badges/paymill-paymill/health.svg)](https://phpackages.com/packages/paymill-paymill)
```

###  Alternatives

[asci/omnipay-sofort

SOFORT Überweisung gateway for Omnipay payment processing library

20127.5k](/packages/asci-omnipay-sofort)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
