PHPackages                             girosolution/girocheckout-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. girosolution/girocheckout-sdk

ActiveLibrary[Payment Processing](/categories/payments)

girosolution/girocheckout-sdk
=============================

PHP development SDK for connections to GiroCheckout Payment Gateway

2.6.11(3w ago)6105.7k↓30%3[5 issues](https://github.com/girosolution/girocheckout_sdk/issues)1OSL-3.0PHPPHP ^5.2 || ^7.0 || ^7.1 || ^7.2 || ^7.3 || ^7.4 || ^8.0 || ^8.1

Since Sep 11Pushed 3w ago1 watchersCompare

[ Source](https://github.com/girosolution/girocheckout_sdk)[ Packagist](https://packagist.org/packages/girosolution/girocheckout-sdk)[ RSS](/packages/girosolution-girocheckout-sdk/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (1)DependenciesVersions (78)Used By (1)

GiroCheckout SDK
================

[](#girocheckout-sdk)

PHP development SDK for connections to GiroCheckout Payment Gateway

The GiroCockpit SDK allows a simple implementation of the GiroCheckout API. The SDK includes all API calls provided by GiroCheckout. For every API there is an example script in the examples section.

**Requirements**
----------------

[](#requirements)

- The SDK uses the cURL extension for server communication.
- All data must be given in UTF-8. The SDK does not take care of the conversion.
- PHP &gt;= 5.2

**Download**
------------

[](#download)

GiroCheckout SDK is available both in composer compatible form and as a standalone library.

Download the current standalone GiroCheckout PHP SDK [here](http://api.girocheckout.de/en:phpsdk:start).

Find the instructions for the composer version below.

Installation through composer
-----------------------------

[](#installation-through-composer)

In order for this to work, you need to install composer. Please follow the instructions on the [Composer website](https://getcomposer.org/doc/00-intro.md) for this, but in a nutshell it's this (in a Linux or iOS environment):

```
# Install Composer
curl -sS https://getcomposer.org/installer | php
```

You should then make it available globally:

```
mv composer.phar /usr/local/bin/composer
```

Remember to give the file execution permissions.

Now, simply include GiroCheckout in your PHP project:

```
composer clear-cache
composer require girosolution/girocheckout-sdk
```

This will create a composer.json file in your project (if you don't already have one), add the lines necessary to include GiroCheckout and then download and install it in the vendor folder.

Update through composer
-----------------------

[](#update-through-composer)

If you already have a previous composer-based version of the SDK installed, you may update to the latest published version like this:

```
composer update
```

**Important note regarding notify and redirect**
------------------------------------------------

[](#important-note-regarding-notify-and-redirect)

GiroCheckout uses two parallel channels for the communication between the GiroCheckout server and the Shop: The notification (or notify for short) and the redirect. The notify is a server to server call in the background, whereas the redirect runs over the customer's browser, showing him the transaction result at the end. Both paths must function separately and independently from each other, in case one of them doesn't reach its destination. This way, the transaction is also successful if the notification happens to not arrive at the shop for whatever reason (so only the redirect could be successful) or if the customer interrupts the redirection to the shop site (so only the notify gets through). But of course a check is required on both sides whether the order has already been processed in the shop, in order to avoid a duplicate processing.

Please also see [API Basics](http://api.girocheckout.de/en:girocheckout:general:start).

Folders
-------

[](#folders)

The folder "examples" includes example scripts for all supported payment methods and API calls. The folder "logos" contains the current logo images for all payment methods.

[![](https://github.com/girosolution/girocheckout_sdk/raw/documentation/docfiles/SDK_git_folders.png)](https://github.com/girosolution/girocheckout_sdk/blob/documentation/docfiles/SDK_git_folders.png)

List of all request types (Request &amp; Notify)
------------------------------------------------

[](#list-of-all-request-types-request--notify)

API documentationRequest typeObject name**credit card**credit card paymentcreditCardTransactionGiroCheckout\_SDK\_CreditCardTransaction()get PKNcreditCardGetPKNGiroCheckout\_SDK\_CreditCardGetPKN()recurring credit card paymentcreditCardRecurringTransactionGiroCheckout\_SDK\_CreditCardRecurringTransaction()credit card voidcreditCardVoidGiroCheckout\_SDK\_CreditCardVoid()**direct debit**direct debit without payment pagedirectDebitTransactionGiroCheckout\_SDK\_DirectDebitTransaction()direct debit payment pagedirectDebitTransactionWithPaymentPageGiroCheckout\_SDK\_DirectDebitTransactionWithPaymentPage()direct debit voiddirectDebitVoidGiroCheckout\_SDK\_DirectDebitVoid()**Payment Page Transaktion**Payment through Payment PagepaypageTransactionGiroCheckout\_SDK\_PaypageTransaction()Project requestpaypageProjectsGiroCheckout\_SDK\_PaypageProjects()**PayPal**PayPal transactionpaypalTransactionGiroCheckout\_SDK\_PaypalTransaction()**Direktüberweisung**Direktüberweisung transactiondirektubwTransactionGiroCheckout\_SDK\_DirektubwTransaction()**Apple Pay**Apple Pay Form payment or preauthorizationapplePayTransactionGiroCheckout\_SDK\_ApplePayTransaction()Apple Pay captureapplePayCaptureGiroCheckout\_SDK\_ApplePayCapture()Apple Pay refundapplePayRefundGiroCheckout\_SDK\_ApplePayRefund()Apple Pay reversal/voidapplePayVoidGiroCheckout\_SDK\_ApplePayVoid()**Google Pay**Google Pay payment or preauthorizationgooglePayTransactionGiroCheckout\_SDK\_GooglePayTransaction()Google Pay capturegooglePayCaptureGiroCheckout\_SDK\_GooglePayCapture()Google Pay refundgooglePayRefundGiroCheckout\_SDK\_GooglePayRefund()Google Pay reversal/voidgooglePayVoidGiroCheckout\_SDK\_GooglePayVoid()**WERO**WERO transactionweroTransactionGiroCheckout\_SDK\_WeroTransaction()**Tools**get transaction informationgetTransactionToolGiroCheckout\_SDK\_Tools\_GetTransaction()Implementation of an API call
-----------------------------

[](#implementation-of-an-api-call)

This implementation example is based on the "examples/creditcard/creditcardTransaction.php" file.

### Load SDK

[](#load-sdk)

```
require '../vendor/autoload.php';
use girosolution\GiroCheckout_SDK\GiroCheckout_SDK_Request;
```

The file "autload.php" has to be included in an appropriate place, to use API functionalities. It is located inside the vendor folder created by composer. So make sure the path to it is correct.

You may also want to add a "use" statement for every GiroCheckout class you use. GiroCheckout\_SDK\_Request will always be used at least.

### Configure data for authentication

[](#configure-data-for-authentication)

```
$merchantID = xxx;
$projectID = xxx;
$projectPassword = xxx;
```

This data is provided in the [GiroCockpit](https://www.girocockpit.de "wikilink"). Ensure that the used project ID is correct and belongs to an API call. For example you can only use a giropay project ID for a "giropayTransaction" request.

### API call

[](#api-call)

```
$request = new GiroCheckout_SDK_Request('creditcardTransaction');
$request->setSecret($projectPassword);
$request->addParam('merchantId',$merchantID)
	->addParam('projectId',$projectID)
	->addParam('merchantTxId',1234567890)
	->addParam('amount',100)
	->addParam('currency','EUR')
	->addParam('purpose','Beispieltransaktion')
	->addParam('urlRedirect','https://www.my-domain.de/girocheckout/redirect')
	->addParam('urlNotify','https://www.my-domain.de/girocheckout/notify')
	//the hash field is auto generated by the SDK
	->submit();
```

To perform a request there has to be instantiated and configurated a request object (list of all request types). The project password has to be given to the request object by calling the *setSecret()* method. It is used for the hash generation. Any API parameters, exept for the hash param, have to be set to the request object by calling *addParam()*.

The method *submit()* performs the API call to GiroCheckout.

### API response

[](#api-response)

```
if($request->requestHasSucceeded()) {
  $request->getResponseParam('rc');
  $request->getResponseParam('msg');
  $request->getResponseParam('reference');
  $request->getResponseParam('redirect');
  $request->redirectCustomerToPaymentProvider();
}
/* if the transaction did not succeed, update your local system, get the responsecode and notify the customer */
else {
  $request->getResponseParam('rc');
  $request->getResponseParam('msg');
  $request->getResponseMessage($request->getResponseParam('rc'),'DE');
}
```

The method *requestHasSucceeded()* returns true, if the request was successfully performed. Any API response parameters are provided by the *getResponseParam()* method. The customer redirection can be performet by calling the *redirectCustomerToPaymentProvider()* method. The buyer will be redirected to the URL given in the *redirect* parameter.

If an eror occured there is the error code stored in the rc param. The method *getResponseMessage()* delivers a translated error message in a supporded language.

Notification und Redirect scripts
---------------------------------

[](#notification-und-redirect-scripts)

This implementation example is based on the “examples/notification.php” file.

### Load SDK

[](#load-sdk-1)

```
require '../vendor/autoload.php';
use girosolution\GiroCheckout_SDK\GiroCheckout_SDK_Request;
```

As stated above, the file "autload.php" has to be included in an appropriate place, to use API functionalities. It is located inside the vendor folder created by composer. So make sure the path to it is correct.

You may also want to add a "use" statement for every GiroCheckout class you use. GiroCheckout\_SDK\_Request will always be used at least.

### Configure data for authentication

[](#configure-data-for-authentication-1)

```
$projectPassword = xxx;
```

The password is provided in the [GiroCockpit](https://www.girocockpit.de). It is used for the hash comparison, to ensure that the data is coming from GiroCheckout.

### Process notification

[](#process-notification)

```
$notify = new GiroCheckout_SDK_Notify('creditcardTransaction');
$notify->setSecret($projectPassword);
$notify->parseNotification($_GET);
```

The notification object works the same way as the request object. First it has to be instantiated with the transaction type ([list of all request types](http://api.girocheckout.de/en:phpsdk:phpsdk:request_types_list)) and configured with the password.

Afterwards an array needs to be passed to the *parseNotification()* method that holds the request parameters .

### Handle notification

[](#handle-notification)

```
if($notify->paymentSuccessful()) {
  $notify->getResponseParam('gcReference');
  $notify->getResponseParam('gcMerchantTxId');
  $notify->getResponseParam('gcBackendTxId');
  $notify->getResponseParam('gcAmount');
  $notify->getResponseParam('gcCurrency');
  $notify->getResponseParam('gcResultPayment');

  if($notify->avsSuccessful()) {
    $notify->getResponseParam('gcResultAVS');
  }

  $notify->sendOkStatus();
  exit;
}
else {
  $notify->getResponseParam('gcReference');
  $notify->getResponseParam('gcMerchantTxId');
  $notify->getResponseParam('gcBackendTxId');
  $notify->getResponseParam('gcResultPayment');

  $notify->sendOkStatus();
  exit;
}
```

The method *paymentSuccessful()* returns true, if the payment has succeeded. Any response parameter can be obtained via the *getResponseParam()* method.

*sendOkStatus()*, *sendBadRequestStatus()* and *sendOtherStatus()* may be used to respond to the request by sending the appropriate header.

HTTP status codeMethodDescription200 (OK)*sendOkStatus()*The notification was processed correctly.400 (Bad Request)*sendBadRequestStatus()*The merchant did not process the notification and does not wish to be notified again.all others*sendOtherStatus()*The notification is repeated no more than 10 times every 30 minutes until the merchant returns the status code 200 or 400.Changing the Server Endpoint
----------------------------

[](#changing-the-server-endpoint)

In special cases it may be necessary to access a different server for development and tests than the default . Should you have received another endpoint URL from Girosolution, there is a way of overriding the default server.

You may do this in one of three ways:

1. In your PHP Code:

```
apache_setenv( "GIROCHECKOUT_SERVER", "https://other.endpoint.de" );
```

2. On the Linux command line (e.g. for executing the SDK examples without a browser):

```
export GIROCHECKOUT_SERVER=https://other.endpoint.de
```

3. In the Apache configuration (within the VirtualHost section):

```
SetEnv GIROCHECKOUT_SERVER "https://other.endpoint.de"

```

Operation via a proxy server
----------------------------

[](#operation-via-a-proxy-server)

It is possible to operate the server communication via a proxy, if your environment requires to do so. To implement this, include the following code and modify the parameters accordingly, before the GiroCheckout\_SDK\_Request::submit() function is called:

```
$Config = GiroCheckout_SDK_Config::getInstance();
$Config->setConfig('CURLOPT_PROXY', 'http://myproxy.com'):
$Config->setConfig('CURLOPT_PROXYPORT', 9090);
$Config->setConfig('CURLOPT_PROXYUSERPWD', 'myuser:mypasswd');
```

Debugging
---------

[](#debugging)

The SDK offers the possibility of debugging an API call. In order to use this, you need to define a constant which has to be set to “true”:

```
define('__GIROCHECKOUT_SDK_DEBUG__',true);
```

Now the SDK will write a log file which is located in “GiroCheckout\_PHP\_SDK/log” by default. The webserver needs to have write permissions to this folder. The debug mode should only be used while debugging issues and should be deactivated again afterwards for security and performance reasons.

### Accessing the logfile

[](#accessing-the-logfile)

The logfile is organized into different sections:

SectionDescriptionCommon issuesstartGives the timestamp when the script was loadedPHP iniProvides information about PHP, cURL and SSLcURL or SSL is not activatedtransactionShows the used API callparams setShows any parameters that were given to the request objectparameters are missingcURL requestIncludes any parameters that are sent to GiroCheckoutcURL replycURL information about the server replyreply paramsAny parameters in the server's replynotify inputInformation about the notify call (parameters, timestamp)reply paramsInformation about the used reply methodexceptionIncludes the error description### Set certificate file

[](#set-certificate-file)

In a Windows server environment, it might happen that cURL is not able to validate the SSL certificate. In such a case, it is necessary to pass cURL a specific certificate file. The SDK provides the possibility of setting a local certificate file. For this, the following code is needed **before the $request→submit() method** is called:

```
$request->setSslCertFile('path/to/certificate');
```

For testing purposes, the certificate validation can be disabled. Please do not use this in your live environment.

```
$request->setSslVerifyDisabled();
```

###  Health Score

59

—

FairBetter than 98% of packages

Maintenance78

Regular maintenance activity

Popularity38

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity86

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 84% of commits — single point of failure

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 ~37 days

Recently: every ~69 days

Total

76

Last Release

27d ago

Major Versions

0.0.1 → 2.1.252018-12-21

PHP version history (5 changes)0.0.1PHP ^5.2 || ^7.0

2.1.25PHP ^5.2 || ^7.0 || ^7.1

2.4.1.9PHP ^5.2 || ^7.0 || ^7.1 || ^7.2 || ^7.3 || ^7.4

2.4.1.10PHP ^5.2 || ^7.0 || ^7.1 || ^7.2 || ^7.3 || ^7.4 || ^8.0

2.4.6PHP ^5.2 || ^7.0 || ^7.1 || ^7.2 || ^7.3 || ^7.4 || ^8.0 || ^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/3aa8fedc39ede9115fdc9ef81b80c47ddff38c0fc1f6033b8fb296b17cd02a97?d=identicon)[girosolution](/maintainers/girosolution)

---

Top Contributors

[![michaelheumann](https://avatars.githubusercontent.com/u/25079867?v=4)](https://github.com/michaelheumann "michaelheumann (63 commits)")[![girosolution](https://avatars.githubusercontent.com/u/42979126?v=4)](https://github.com/girosolution "girosolution (12 commits)")

### Embed Badge

![Health badge](/badges/girosolution-girocheckout-sdk/health.svg)

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

###  Alternatives

[omnipay/coinbase

Coinbase driver for the Omnipay payment processing library

18570.2k1](/packages/omnipay-coinbase)[yenepay/php-sdk

YenePay SDK for PHP

112.7k](/packages/yenepay-php-sdk)

PHPackages © 2026

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