storca/omnipay-sips2
Composer 安装命令:
composer require storca/omnipay-sips2
包简介
Omnipay gateway for Worldline Sips PayPage POST API (Atos Sips 2.0)
README 文档
README
This gateway implements Sogenactif's 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
$gateway = \Omnipay\Omnipay::create('Sogenactif'); $gateway->setMerchantId('XXXXXXXXXXXXXXXXX'); $gateway->setSecretKey('XXXXXXXXXXXXXXXXX'); $gateway->setUrl('https://payment-webinit.simu.sips-atos.com'); $card = new \Omnipay\Sips\OffsiteCreditCard(); $card->setEmail('test@test.com'); // 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
$gateway = \Omnipay\Omnipay::create('Sogenactif'); $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(); }
统计信息
- 总下载量: 6
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 3
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-11-07