PHPackages                             payengine/php\_sdk - 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. payengine/php\_sdk

ActiveLibrary[Payment Processing](/categories/payments)

payengine/php\_sdk
==================

PHP Library for Concardis PayEngine 3.0

1.1.1(8y ago)359.6k↓31.3%10[4 issues](https://github.com/concardis/PHP_SDK/issues)MITPHP

Since Sep 13Pushed 5y ago2 watchersCompare

[ Source](https://github.com/concardis/PHP_SDK)[ Packagist](https://packagist.org/packages/payengine/php_sdk)[ Docs](https://www.concardis.com/)[ RSS](/packages/payengine-php-sdk/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (3)Versions (4)Used By (0)

PHP SDK
=======

[](#php-sdk)

Prerequisites
-------------

[](#prerequisites)

### PHP

[](#php)

Get and install PHP for your system.

### Composer

[](#composer)

Get and install composer for your system.

### Get the PHP SDK

[](#get-the-php-sdk)

#### Via Packagist.org

[](#via-packagistorg)

```
composer require payengine/php_sdk
```

#### By cloning

[](#by-cloning)

```
git@github.com:concardis/PHP_SDK.git
```

#### As release zip

[](#as-release-zip)

[https://github.com/concardis/PHP\_SDK/releases](https://github.com/concardis/PHP_SDK/releases)

Installation
------------

[](#installation)

Uncompress the PHP SDK folder, change into the newly created folder and run

```
composer install
```

Move the PHP SDK folder into the vendor folder of your PHP project. Now you can create a php file to use the SDK with.

Initialize SDK
--------------

[](#initialize-sdk)

```
    include_once "./vendor/payengine/autoload.php";

    use \Concardis\Payengine\Lib\Payengine;
    use \Concardis\Payengine\Lib\Internal\Config\MerchantConfiguration;
    use \Concardis\Payengine\Lib\Models\Request\Customer as CustomerRequest;
    use \Concardis\Payengine\Lib\Models\Request\Customers\Persona as PersonaRequest;
    use \Concardis\Payengine\Lib\Models\Request\Customers\Address as AddressRequest;
    use \Concardis\Payengine\Lib\Models\Request\Orders\Payment\Payment;

    $config = new MerchantConfiguration();
    //TODO: Enter your API-Key
    $config->setApiKey('YOUR_API_KEY');
    // TODO: Enter your merchantId
    $config->setMerchantId('YOUR_MERCHANT_ID');
    $config->setIsLiveMode(false);

    $lib = new Payengine($config);
```

Basic Usage
-----------

[](#basic-usage)

### Create a customer

[](#create-a-customer)

```
    $customerRequest = new CustomerRequest();
    $customerRequest->setEmail('somebody@' . time() .'.org');

    $customerResponse = $lib->customer()->post($customerRequest);
```

### Create a persona

[](#create-a-persona)

```
    $personaRequest = new PersonaRequest();
    $personaRequest->setTitle("Dr.");
    $personaRequest->setGender(
        \Concardis\Payengine\Lib\Internal\Constants\Gender::MALE
    );
    $personaRequest->setFirstName("Max");
    $personaRequest->setLastName("Mustermann");
    $personaRequest->setBirthday(time());
    $personaRequest->setFax("0123456789");
    $personaRequest->setMobile("0123456789");
    $personaRequest->setPhone("0123456789");
```

### Create an address

[](#create-an-address)

```
    $addressRequest = new AddressRequest();
    $addressRequest->setFirstName("Maxim");
    $addressRequest->setLastName("Mustermann");
    $addressRequest->setZip("12345");
    $addressRequest->setStreet("Musterstrasse");
    $addressRequest->setHouseNumber("1a");
    $addressRequest->setCountry("DE");
    $addressRequest->setCity("Musterstadt");
    $addressRequest->setPhone("0123456789");
    $addressRequest->setMobile("0123456789");
    $addressRequest->setFax("0123456789");
    $addressRequest->setState("nrw");
    $addressRequest->setTitle("dr.");

    $addressResponse = $lib->customer(
    $customerResponse->getCustomerId())->addresses()->post($addressRequest);
```

### Create a preauthorization

[](#create-a-preauthorization)

```
    $payment = new Payment();
    //TODO Enter PaymentInstrumentId
    $payment->setPaymentInstrumentId('IDFromYourFrontend');

    $item = new \Concardis\Payengine\Lib\Models\Request\Orders\Item();
    $item->setQuantity(2);
    $item->setUnitPrice(5);
    $item->setUnitPriceWithTax(6);
    $item->setTotalPrice(10);
    $item->setTotalPriceWithTax(12);
    $item->setArticleNumber("test");
    $item->setName("testName");
    $item->setTax(19);

    $async = new \Concardis\Payengine\Lib\Models\Request\Orders\Async();
    $async->setSuccessUrl("http://google.de?q=success");
    $async->setCancelUrl("http://google.de?q=cancel");
    $async->setFailureUrl("http://google.de?q=failure");

    $authorizingTransaction = new \Concardis\Payengine\Lib\Models\Request\Orders\AuthorizingTransaction();
    $authorizingTransaction->setCustomer($customerResponse->getCustomerId());
    $authorizingTransaction->setPersona($personaResponse->getPersonaId());
    $authorizingTransaction->setBillingAddress(
        $addressResponse->getAddressId()
    );
    $authorizingTransaction->setShippingAddress(
        $addressResponse->getAddressId()
    );
    $authorizingTransaction->setCurrency("EUR");
    $authorizingTransaction->setPayment($payment);
    $authorizingTransaction->setBasket(array(
        $item
    ));
    $authorizingTransaction->setInitialAmount(12);
    $authorizingTransaction->setChannel('ECOM');
    $authorizingTransaction->setSource("basicUsage script");
    $authorizingTransaction->setTerms(time());
    $authorizingTransaction->setPrivacy(time());
    $authorizingTransaction->setAsync($async);
    $authorizingTransaction->setProduct(
        \Concardis\Payengine\Lib\Internal\Constants\Products::CREDITCARD
    );

    $transactionResponse = $lib->orders()->preauth()->post(
        $authorizingTransaction
    );
```

### Capture a preauthorization

[](#capture-a-preauthorization)

```
    $referencingTransaction = new \Concardis\Payengine\Lib\Models\Request\Orders\ReferencingTransaction();
    $referencingTransaction->setInitialAmount(12);
    $referencingTransaction->setCurrency("EUR");
    $referencingTransaction->setDescription("Capture everything");
    $referencingTransaction->setBasket(array(
        $item
    ));

    /* @var $preAuthTransaction \Concardis\Payengine\Lib\Models\Response\Orders\Transaction */
    $preAuthTransaction = $transactionResponse->getTransactions()[0];
    $preAuthId = $preAuthTransaction->getTransactionId();

    $captureResponse = $lib->orders(
        $transactionResponse->getOrderId()
    )->transactions($preAuthId)->capture()->post($referencingTransaction);
```

### Cancel a preauthorization

[](#cancel-a-preauthorization)

```
    $referencingTransaction = new \Concardis\Payengine\Lib\Models\Request\Orders\ReferencingTransaction();
    $referencingTransaction->setInitialAmount(12);
    $referencingTransaction->setCurrency("EUR");
    $referencingTransaction->setDescription("Capture everything");
    $referencingTransaction->setBasket(array(
        $item
    ));

    /* @var $preAuthTransaction \Concardis\Payengine\Lib\Models\Response\Orders\Transaction */
    $preAuthTransaction = $transactionResponse->getTransactions()[0];
    $preAuthId = $preAuthTransaction->getTransactionId();

    $cancelResponse = $lib->orders(
        $transactionResponse->getOrderId()
    )->transactions($preAuthId)->cancel()->post($referencingTransaction);
```

### Refund a capture or debit transaction

[](#refund-a-capture-or-debit-transaction)

```
    $referencingTransaction = new \Concardis\Payengine\Lib\Models\Request\Orders\ReferencingTransaction();
    $referencingTransaction->setInitialAmount(12);
    $referencingTransaction->setCurrency("EUR");
    $referencingTransaction->setDescription("Refund everything");
    $referencingTransaction->setBasket(array(
        $item
    ));

    $refundResponse = $lib->orders(
        $transactionResponse->getOrderId()
    )->transactions(
        $captureResponse->getTransactionId()
    )->refund()->post($referencingTransaction);
```

### GET transaction status

[](#get-transaction-status)

```
    $transactionGetResponse = $lib->orders(
        $transactionResponse->getOrderId()
    )->transactions($captureResponse->getTransactionId())->get();
```

### GET order

[](#get-order)

```
    $orderGetResponse = $lib->orders(
        $transactionResponse->getOrderId()
    )->get();
```

Tests
-----

[](#tests)

To run the tests without the integration tests call phpunit with the exclude group option.

```
phpunit tests --exclude-group integrationtests
```

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

[](#documentation)

For further information, please refer to the Payengine documentation:

Licence
-------

[](#licence)

[MIT](../master/LICENSE)

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity36

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor2

2 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 ~41 days

Total

3

Last Release

3087d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2c2f5ac24b0079b383fec5fbc7c3d61fd3be15f57948643a28aa676830cc3423?d=identicon)[ConcardisECCC](/maintainers/ConcardisECCC)

---

Top Contributors

[![kazemek](https://avatars.githubusercontent.com/u/3263821?v=4)](https://github.com/kazemek "kazemek (6 commits)")[![ocean90](https://avatars.githubusercontent.com/u/617637?v=4)](https://github.com/ocean90 "ocean90 (5 commits)")[![naskor-sh](https://avatars.githubusercontent.com/u/25475005?v=4)](https://github.com/naskor-sh "naskor-sh (2 commits)")[![AndiF](https://avatars.githubusercontent.com/u/527341?v=4)](https://github.com/AndiF "AndiF (1 commits)")

---

Tags

serviceproviderpaymentecommerceconcardispayengine

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/payengine-php-sdk/health.svg)

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

###  Alternatives

[authorizenet/authorizenet

Official PHP SDK for Authorize.Net

4729.6M46](/packages/authorizenet-authorizenet)[paymill/paymill

Paymill PHPLib

92354.6k8](/packages/paymill-paymill)[cybersource/rest-client-php

Client SDK for CyberSource REST APIs

39881.3k6](/packages/cybersource-rest-client-php)[sumup/sumup-ecom-php-sdk

SumUp PHP SDK

51277.1k1](/packages/sumup-sumup-ecom-php-sdk)[silvershop/core

Provides an ecommerce product catalog, shopping cart, and order management system

11340.0k42](/packages/silvershop-core)[commerceguys/authnet

PHP SDK for Authorize.Net API, using Guzzle.

20462.4k](/packages/commerceguys-authnet)

PHPackages © 2026

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