Download the PHP package xpiston/worldline-sips without Composer

On this page you can find all versions of the php package xpiston/worldline-sips. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package worldline-sips

# ๐Ÿฆ Worldline Sips for PHP **One connector, five bank brands.** Sealed Paypage requests, verified responses, capture, cancel and refund โ€” for Laravel, Symfony, or no framework at all. [![PHP](https://img.shields.io/badge/PHP-8.2%20%E2%86%92%208.5-777BB4?logo=php&logoColor=white)](https://php.net) [![Laravel](https://img.shields.io/badge/Laravel-12%20%7C%2013-FF2D20?logo=laravel&logoColor=white)](https://laravel.com) [![Symfony](https://img.shields.io/badge/Symfony-6.4%20%7C%207-000000?logo=symfony&logoColor=white)](https://symfony.com) [![Tests](https://img.shields.io/badge/tests-243%20%2B%2010%20live-22C55E)](#-tests) [![PHPStan](https://img.shields.io/badge/PHPStan-max-2563EB)](#-tests) [![License](https://img.shields.io/badge/license-MIT-blue)](#license)

Worldline Sips is the payment platform behind a great many French bank brands: Sogenactif (Sociรฉtรฉ Gรฉnรฉrale), Mercanet (BNP Paribas), Scellius (La Banque Postale), Sherlock's (LCL), ElysNet (HSBC). One protocol, one contract shape, one set of seal rules โ€” and a different name on every merchant agreement.

This package implements that protocol: the sealed form that sends a customer to the payment page, the two responses that come back, and the three cash-management calls that move the money afterwards. Nothing else. It has no opinion about your orders and touches the network only when you ask it to capture, cancel or refund.

Everything below was checked against Worldline's own servers. The simulation platform's credentials are published in its quick start guide, and the Office test platform's in the Office guide โ€” so this package has a live test suite that needs no contract, and every claim in this README that could be wrong was measured rather than read. The places where the documentation contradicts itself are called out, with what the server actually does.

โœจ What's inside

๐Ÿš€ Quick start

No contract yet? The simulation platform is open, and its credentials are published:

That form posts three fields โ€” Data, InterfaceVersion, Seal โ€” and the simulator answers with a real payment page. Its test cards are deterministic: the result is decided by the last two digits of the card number, and the 3-D Secure step is simulated so you choose the outcome.

For production, the three values Worldline issued:

Reading the response

Sips posts the result twice: to normalReturnUrl, which the customer's browser carries, and to automaticResponseUrl, server to server. Same fields, same seal. The documentation is blunt about the difference and so is this README: a customer can close the tab, so business logic belongs on the second one and the first is for showing them a page.

matches() is three comparisons โ€” reference, amount, merchant id โ€” and it is not optional thinking. A valid seal proves the message is authentic and unaltered. It does not prove it is about the order you are holding.

Capturing, cancelling, refunding

These three call Worldline over HTTPS, so they need a PSR-18 client โ€” pass one, or let php-http/discovery find the one your application already has:

Rendering a form and verifying a response need no HTTP client at all, which is why the constructor does not ask for one.

๐Ÿ” The seal, in one page

Every message in both directions carries one, and Sips has three different rules for building the string it is computed over. Not two algorithms in one shape โ€” three shapes.

Paypage concatenates name=value pairs with a |:

Office concatenates the values only, sorted by field name, and leaves out keyVersion and sealAlgorithm:

And on top of that, two algorithms. HMAC-SHA256(Data, key), or SHA256(Data + key) โ€” a plain hash with the key glued on the end, which is the platform's default and which its own documentation calls "no longer recommended". Getting the better one takes one field: sealAlgorithm.

The rule that decides the design

"It is important not to sort the content of the Data field to calculate the Seal of the response. Keep the fields in the sequence you received them."

A Sips response has around a hundred fields in an order only the platform knows โ€” the documented example has 104, starting at captureDay and ending at abortedProcessingLocation. Sort them, drop one you do not recognise, or re-encode a value, and every payment reads as a forgery.

So this package never rebuilds a response. DataElement::received() keeps the string that arrived and parses it only for reading; the seal is computed over transmitted(). The same class builds an outgoing message once, and that one string is both what is sealed and what is posted. There is no path through an array and back.

What was measured

Both documented vectors reproduce exactly โ€” ac2332b5โ€ฆ for a SHA-256 request, c946655cโ€ฆ for an HMAC response of 104 fields. Then, against the live Office test platform, one cancel request sent six ways:

the seal was computedโ€ฆ the platform answered
over the values, sorted by name, without keyVersion and sealAlgorithm 25 โ€” transaction not found: the request was read
over name=value\|โ€ฆ instead, the Paypage way 34
over the values including keyVersion 34
with the right shape and the wrong key 34
as SHA256(data+key) while declaring HMAC 34
as sixty-four fs 34

Five negative controls and one positive, which is a stronger statement than any documentation. The response seal was confirmed the same way: a reply of {"responseCode":"12"} is sealed as the HMAC of the string 12.

What a payment actually looks like

Driven end to end through a browser against the simulator โ€” the form, a card typed on Worldline's page, the 3-D Secure step, and the response verified by this package:

the customerโ€ฆ responseCode what came back
pays with a good card and passes 3-D Secure 00 26 fields: brand, masked PAN, authorisation number, 3D_SUCCESS
is refused, then gives up 17 18 fields, no brand, no PAN
fails 3-D Secure, then gives up 17 18 fields

Two things in that table are worth more than the table.

A refusal does not end the payment. A refused card puts the customer back on Worldline's payment-method page to try another one; nothing is posted to your URLs. The response leaves only when the payment ends โ€” paid, given up, or out of attempts. So a shop sees far more 17 than 05, and an order with no response at all is a customer who closed the tab. Which is the argument for automaticResponseUrl restated as an observation: the browser is not a reliable messenger.

The field count changes with the outcome. Twenty-six fields on an accepted payment, eighteen on an abandoned one โ€” no paymentMeanBrand, no maskedPan, no authorisationId. Every accessor on PaymentResponse returns null rather than assuming, and this is why.

๐Ÿงฐ Laravel

The provider is discovered automatically.

Leave the credentials empty and it falls back to the published simulation shop, so the package boots five minutes after composer require. On production it refuses to boot without them, which is the one place where an exception is kinder than a default.

ResponseRequest::fields() is not decoration. $request->all() merges the query string into the body โ€” and a return URL with a query parameter is the normal shape here, because normalReturnUrl is where a shop puts its own order id. One ?order=42 and the seal is computed over a field Sips never sent.

php artisan vendor:publish --tag=sips-config writes the config file, with the reasoning for each option in it.

๐Ÿงฐ Symfony

Sips and ResponseVerifier are then autowired, and the PSR-18 client comes from the container as soon as symfony/http-client is installed. The notification route has to be reachable without a session and without authentication โ€” if a firewall covers the path, give it security: false.

๐Ÿงฑ How it's built

Decisions visible in the code

โœ… Tests

The default suite needs nothing but PHP 8.2 and Composer, and runs in under half a second.

The live suite is separate on purpose: it talks to somebody else's server, so a red run there means "Worldline is down" as often as "this is broken", and that is not what a merge gate is for. It runs nightly in CI and by hand, and it needs no credentials. What it proves cannot be proved any other way โ€” that the seal, the field names and the interface versions are what the platform expects, and that a wrong key is refused, which is the control that makes the rest mean something.

Three groups in the default suite are worth naming:

Against the documentation. Worldline publishes a Data string, a key and the seal it expects, for both algorithms. Those are in the suite verbatim, together with a test that sorting the documented 104-field response breaks its seal.

Against a fake platform. tests/Support/Platform seals a response the way Sips does, so the pair that means something can be asserted: a response sealed correctly is accepted, and the same response with its fields reordered is not.

Against the real frameworks. The Laravel bridge runs in a Laravel application booted by Testbench; the Symfony bundle compiles a real Symfony container. The second earned its place immediately โ€” it caught two service definitions that would have broken every installation, one of them an object where Symfony only accepts scalars, enums and services.

๐Ÿค” Why another package?

Worldline publishes its own PHP SDK. Measured on Packagist rather than guessed at:

worldline/sips-payment-sdk last stable 1.0.7, March 2021, marked abandoned, php >=7.0
downloads on that dead package ~99,000
kptive/payment-sips-bundle last stable January 2015
ambroisemaupate/omnipay-sips2 last stable January 2018

So the official connector for a platform that serves five bank brands has been abandoned since 2021, and the community alternatives predate PHP 8 entirely. That is the gap. Beyond the dates: the three seal shapes, the order rule, the two response channels, the field sets that only the platform will tell you, and framework wiring that does not quietly put a query parameter into a signature โ€” those are where the afternoons go, and they are what this package is.

โš ๏ธ Not included

๐Ÿ“š The documentation this was built from

Where the documentation contradicts itself, the code says so and a test pins the behaviour: the default algorithm is documented as SHA-256 on the Paypage POST page and as HMAC on the JSON one (this package declares it explicitly either way), and sealAlgorithm is spelled HMAC-SHA-256 in a request and sha256 in a documented response (both are read).

License

MIT.


All versions of worldline-sips with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
ext-hash Version *
ext-json Version *
psr/http-client Version ^1.0
psr/http-factory Version ^1.0
psr/http-message Version ^1.1 || ^2.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package xpiston/worldline-sips contains the following files

Loading the files please wait ...