Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ambroisemaupate/omnipay-sips2

Omnipay gateway for Worldline Sips PayPage POST API (Atos Sips 2.0)
https://github.com/ambroisemaupate/omnipay-sips2

atos gateway omnipay paypage sips worldline

Last synced: 3 months ago
JSON representation

Omnipay gateway for Worldline Sips PayPage POST API (Atos Sips 2.0)

Awesome Lists containing this project

README

        

# Omnipay gateway for Worldline (Atos) Sips 2.0

This gateway implements *Sips PayPage POST API* only.

## Gateway parameters

Gateway is provided default *Sogenactif* (Société Générale) testing credentials.

| Parameter | Default value |
| --------- | ------------- |
| merchantId | `002001000000001` |
| secretKey | `002001000000001_KEY1` |
| interfaceVersion | `"HP_2.14"` |
| keyVersion | `1` |
| url | `https://payment-webinit.simu.sips-atos.com` |

Be careful, in *test* mode, `transactionReference` parameter is mandatory.

## Usage

### First step: offsite payment

```php
$gateway = \Omnipay\Omnipay::create('SipsPayPage');
$gateway->setMerchantId('XXXXXXXXXXXXXXXXX');
$gateway->setSecretKey('XXXXXXXXXXXXXXXXX');
$gateway->setUrl('https://payment-webinit.simu.sips-atos.com');

$card = new \Omnipay\Sips\OffsiteCreditCard();
$card->setEmail('[email protected]');

// Send purchase request
$request = $gateway->purchase(
[
'clientIp' => $request->getClientIp(),
'amount' => '10.00',
'currency' => 'EUR',
'returnUrl' => $this->generateUrl('completePurchaseRoute', [], UrlGenerator::ABSOLUTE_URL),
'notifyUrl' => $this->generateUrl('completePurchaseRoute', [], UrlGenerator::ABSOLUTE_URL),
'cancelUrl' => $this->generateUrl('cancelRoute', [], UrlGenerator::ABSOLUTE_URL),
'card' => $card
]
);
$response = $request->send();

if ($response->isRedirect()) {
$response->redirect(); // this will automatically forward the customer
}
```

### Second step: manual and automatic response

```php
$gateway = \Omnipay\Omnipay::create('SipsPayPage');
$gateway->setMerchantId('XXXXXXXXXXXXXXXXX');
$gateway->setSecretKey('XXXXXXXXXXXXXXXXX');
$gateway->setUrl('https://payment-webinit.simu.sips-atos.com');

// Send completePurchase request
$request = $gateway->completePurchase();
$response = $request->send();

if ($response->isSuccessful()) {
// DO your store logic.

$bankTransactionRef = $response->getTransactionReference();
$websiteOrderId = $response->getTransactionId();
} elseif ($response->isPending()) {
// Do temporary things until we get a success/failed tranaction response.
} else {
echo $response->getMessage();
}
```