PHPackages                             vjee/sips-payment-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. vjee/sips-payment-sdk

ActiveLibrary[Payment Processing](/categories/payments)

vjee/sips-payment-sdk
=====================

(FORK of worldline/sips-payment-sdk) This library simplifies the use of Sips 2.0, the e-payments API.

1.0.2(7y ago)0394MITPHPPHP &gt;=7.0.0

Since Mar 6Pushed 7y ago1 watchersCompare

[ Source](https://github.com/vjee/sips-sdk-php)[ Packagist](https://packagist.org/packages/vjee/sips-payment-sdk)[ RSS](/packages/vjee-sips-payment-sdk/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (2)Versions (5)Used By (0)

Sips Library
============

[](#sips-library)

This package provides a PHP implementation for Sips, the Woirldline e-payments gateway.

> ⚠️ This library was written for Sips 2.0 and is not comptible with Sips 1.0!

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

[](#installation)

The recommanded way to install this Sips Library is through [Composer](http://getcomposer.org).

Run the composer commmand to install the latest stable version of the package:

```
composer require worldline/sips-payment-sdk
```

After installing the package, you need to require Composer's autoloader:

```
require 'vendor/autoload.php'
```

Usage
-----

[](#usage)

> 💡 Currently the labrary only supports Sips in paypage mode.

### Initialization

[](#initialization)

First, create a client for the desired environment using your merchant ID, key version &amp; secret key.

```
//these parameters should not be hardcoded.
$sipsClient = new SipsClient(
    new SipsEnvironment("SIMU"),
    "002001000000001",
    "002001000000001_KEY1",
    1
    );
```

Next, set up the request to initialize a session on the Sips server.

```
$paypageRequest = new PaypageRequest();
$paypageRequest->setAmount(200);
$paypageRequest->setCurrencyCode("EUR");
$paypageRequest->setNormalReturnUrl('http://lib.wl.be//return.php');
$paypageRequest->setOrderChannel("INTERNET");
```

Add a unique reference for the transaction.

```
$paypageRequest->setTransactionReference("myUniqueIdentifier");
```

💡 If no reference is provided by you, the plugin will generate one.

And finaly submit the request to the server to initialize the transaction.

```
$initializationResponse = $sipsClient->initialize($paypageRequest);
```

The `initializationResponse` you'll receive grom the server contains all information needed to continue handling the transaction. If your initialization was seccessful, your response will contain `redirectionStatusCode = '00'`

### Redirection to the paypage

[](#redirection-to-the-paypage)

In case your initialization was successful, you have to use the redirectionUrl received to perform a POST request with both the redirectionData and seal as parameters. Since this should redirect the customer to the Sips payment page, the cleanest exampleis a simpleHTML form:

```
