Git Product home page Git Product logo

omnipay-sips2's Introduction

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

$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

$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();
}

omnipay-sips2's People

Contributors

ambroisemaupate avatar filipheymans avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

omnipay-sips2's Issues

CompletePurchaseResponse

Hi Ambroise,

In complete purchase response your getTransactionId should get the authorisationId field, there is no orderId key in the returned array

  /**
    * Get the transaction ID as generated by the merchant website.
    *
    * @return string
    */
   public function getTransactionId()
   {
       return $this->fields['authorisationId'];
   }

Installation issues with symfony 3.4

Hi,

I'm having installation issues with this package and symfony 3.4.

It looks like omnipay-sips2 package uses an old version of omnipay/common (~2.0 | ~2.5) which is not compatible with either symfony 3.4 nor guzzle. Could you confirm this ?

Solution would be to upgrade to omnipay/common ~3.0 which is using php-http/client-implementation ^1 and symfony/http-foundation ^2.1 | ^3 | ^4.

May I have your analysis about this issue ?

Regards.

Steps to reproduce :

composer create-project symfony/website-skeleton my_project "3.4.*"
composer require php-http/guzzle6-adapter
composer require colinodell/omnipay-bundle
composer require ambroisemaupate/omnipay-sips2

Error :

Using version ^1.0 for ambroisemaupate/omnipay-sips2
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Restricting packages listed in "symfony/symfony" to "3.4.*"
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - ambroisemaupate/omnipay-sips2 1.0.2 requires omnipay/common ~2.0|~2.5 -> satisfiable by omnipay/common[2.3.2, 2.4.0, 2.5.2, v2.0.0, v2.1.0, v2.2.0, v2.3.0, v2.3.1, v2.3.3, v2.3.4, v2.4.1, v2.5.0, v2.5.1].
    - ambroisemaupate/omnipay-sips2 1.0.1 requires omnipay/common ~2.0|~2.5 -> satisfiable by omnipay/common[2.3.2, 2.4.0, 2.5.2, v2.0.0, v2.1.0, v2.2.0, v2.3.0, v2.3.1, v2.3.3, v2.3.4, v2.4.1, v2.5.0, v2.5.1].
    - ambroisemaupate/omnipay-sips2 1.0.0 requires omnipay/common ~2.0 -> satisfiable by omnipay/common[2.3.2, 2.4.0, 2.5.2, v2.0.0, v2.1.0, v2.2.0, v2.3.0, v2.3.1, v2.3.3, v2.3.4, v2.4.1, v2.5.0, v2.5.1].
    - omnipay/common 2.5.2 requires guzzle/guzzle ~3.9 -> satisfiable by guzzle/guzzle[v3.9.0, v3.9.1, v3.9.2, v3.9.3].
    - omnipay/common v2.5.1 requires guzzle/guzzle ~3.9 -> satisfiable by guzzle/guzzle[v3.9.0, v3.9.1, v3.9.2, v3.9.3].
    - guzzle/guzzle v3.9.3 requires symfony/event-dispatcher ~2.1 -> no matching package found.
    - guzzle/guzzle v3.9.2 requires symfony/event-dispatcher ~2.1 -> no matching package found.
    - guzzle/guzzle v3.9.1 requires symfony/event-dispatcher ~2.1 -> no matching package found.
    - guzzle/guzzle v3.9.0 requires symfony/event-dispatcher ~2.1 -> no matching package found.
    - omnipay/common v2.5.0 requires symfony/http-foundation ~2.1 -> no matching package found.
    - omnipay/common v2.4.1 requires symfony/http-foundation ~2.1 -> no matching package found.
    - omnipay/common v2.3.4 requires symfony/http-foundation ~2.1 -> no matching package found.
    - omnipay/common v2.3.3 requires symfony/http-foundation ~2.1 -> no matching package found.
    - omnipay/common v2.3.1 requires symfony/http-foundation ~2.1 -> no matching package found.
    - omnipay/common v2.3.0 requires symfony/http-foundation ~2.1 -> no matching package found.
    - omnipay/common v2.2.0 requires symfony/http-foundation ~2.1 -> no matching package found.
    - omnipay/common v2.1.0 requires symfony/http-foundation ~2.1 -> no matching package found.
    - omnipay/common v2.0.0 requires symfony/http-foundation ~2.1 -> no matching package found.
    - omnipay/common 2.4.0 requires symfony/http-foundation ~2.1 -> no matching package found.
    - omnipay/common 2.3.2 requires symfony/http-foundation ~2.1 -> no matching package found.
    - Installation request for ambroisemaupate/omnipay-sips2 ^1.0 -> satisfiable by ambroisemaupate/omnipay-sips2[1.0.0, 1.0.1, 1.0.2].

Potential causes:
 - A typo in the package name
 - The package is not available in a stable-enough version according to your minimum-stability setting
   see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.
 - It's a private package and you forgot to add a custom repository to find it

Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.

Installation failed, reverting ./composer.json to its original content.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.