Download the PHP package code16/laravel-systempay without Composer

On this page you can find all versions of the php package code16/laravel-systempay. 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 laravel-systempay

Systempay tools for Laravel

Features

[!NOTE] If you want to use this SystemPay client to cancel or refund transactions, you must create also a REST API key in the SystemPay Back Office.

Installation

  1. Install the package

  2. Publish the config file

Configuration

After publishing edit the default configuration file : config/systempay.php

You need to set YOUR_SITE_ID and YOUR_KEY with your own values. This two values are given by Systempay.

key is only used to sign/verify the payment form and IPN callbacks. To use cancel(), refund(), cancelOrRefund() (see Cancel or refund a payment) or getTransaction() (see Get a transaction), you also need to set rest.password, the REST API password found in the Back Office, under Paramétrage > Boutique > Clés d'API REST (use the test or production password depending on env).

Specific parameters

These parameters are set by default :

name default value note
currency 978 List of currency codes
payment_config SINGLE SINGLE or MULTIPLE
trans_date [current datetime] Generated automaticaly
page_action PAYMENT
action_mode INTERACTIVE
version V2
signature [generated] Generated automaticaly

Also see Systempay documentation

NB : you don't have to add the vads_ prefix to parameters, the prefix will be automaticaly added. But you can also set the parameters with the vads_ prefix, it will be automaticaly removed.

NB : amount must be given as an integer in the smallest currency unit expected by Systempay (e.g. cents for EUR). For example, use 1234 for 12.34€, not 12.34. No unit conversion is performed by this package.

There is also possible to set some specific parameters to a configuration by setting params values.

Example :

In this case, default configuration will use the currency code 826.

Additional configuration

You can add as many configuration as you need by adding a new key to the configuration file.

For example :

To use another configuration, call the config method, for example :

IPN Callback

When a payment is processed, Systempay sends a POST request to your IPN URL (to be configured in your Systempay back office).

You can use the Systempay facade to validate the signature and check the payment status.

Webhook payload

formatWebhookPayload() looks up the signing key for the given configuration (default unless specified) and returns a Code16\Systempay\WebhookPayload object with the following read-only properties:

property type source field
orderId string vads_order_id
transactionId string vads_trans_id
transactionUuid string vads_trans_uuid
amount int vads_amount
currencyCode string vads_currency
status string vads_trans_status

It also exposes validateSignature() and isValidPayment(), so the whole IPN payload — data and validation — comes from a single object.

Signature validation for specific configuration

If you have multiple configurations, pass the configuration name to formatWebhookPayload:

Customize valid payment status

By default, isValidPayment() returns true if the status is CAPTURED, ACCEPTED, or AUTHORISED. You can customize this by passing an array of valid statuses as the parameter:

Create a payment form

To create a payment form, you can use the Systempay facade.

In your controller :

In your view

Cancel or refund a payment

Use cancel() to cancel a transaction that has not been captured yet (i.e. before it is remised en banque), and refund() to refund a captured transaction, totally or partially. Both need the transaction uuid, as returned by formatWebhookPayload().

Both throw Code16\Systempay\Exceptions\SystemPayApiException if Systempay rejects the request (e.g. the transaction cannot be cancelled or refunded in its current state). The exception's response() method returns the decoded API response, including the errorCode returned by Systempay:

Under the hood, both call the Transaction/CancelOrRefund Web Service, which lets Systempay pick the operation automatically based on the transaction's status. You can call it directly and force the operation with resolutionMode (AUTO, CANCELLATION_ONLY or REFUND_ONLY):

As with validateSignature, pass a configuration name as the last argument to target a specific store:

Get a transaction

Use getTransaction() to retrieve all the data Systempay holds for a transaction, identified by its uuid (as returned by formatWebhookPayload()):

It calls the Transaction/Get Web Service and, like cancel()/refund(), throws SystempayApiException if Systempay rejects the request, and accepts a configuration name as the second argument:


All versions of laravel-systempay with dependencies

PHP Build Version
Package Version
Requires php Version ^8.4
code16/pint-config Version ^1.3
illuminate/contracts Version ^12.0||^13.0
spatie/laravel-package-tools Version ^1.16
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 code16/laravel-systempay contains the following files

Loading the files please wait ...