Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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)
- Host: GitHub
- URL: https://github.com/ambroisemaupate/omnipay-sips2
- Owner: ambroisemaupate
- Created: 2017-05-12T13:47:44.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-01-26T10:23:56.000Z (almost 7 years ago)
- Last Synced: 2024-10-06T14:48:25.535Z (3 months ago)
- Topics: atos, gateway, omnipay, paypage, sips, worldline
- Language: PHP
- Size: 30.3 KB
- Stars: 5
- Watchers: 4
- Forks: 5
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
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();
}
```