Download the PHP package storkplus/sylius-xpay-plugin without Composer

On this page you can find all versions of the php package storkplus/sylius-xpay-plugin. 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 sylius-xpay-plugin

Sylius XPay Plugin

XPay payment gateway for Sylius 2.1+: cards (with 3-D Secure), Fawry and ValU, through XPay's Hosted Checkout. Built on the Sylius 2 Payment Request architecture (no Payum).

Requirements

Version
PHP 8.2+
Sylius 2.1, 2.2, 2.3

Installation

The package is private; add the repository and require it:

Register the bundle in config/bundles.php:

Import its configuration in config/packages/storkplus_sylius_xpay.yaml:

Import its route (the static webhook endpoint) in config/routes/storkplus_sylius_xpay.yaml:

No database migrations are needed: payments go through the Sylius routes (/pay/{hash}, /after-pay/{hash}) and the plugin stores what it needs in the payment details.

Clear the cache. The payment request messenger transport must stay synchronous (the Sylius default, SYLIUS_MESSENGER_TRANSPORT_PAYMENT_REQUEST_DSN=sync://) so the customer is redirected in the same request.

Setting up a payment method

  1. In XPay, open Developers → API keys and copy a secret key (sk_test_… while testing).
  2. In Sylius admin, Configuration → Payment methods → Create → XPay (cards, Fawry, ValU). The form shows the shop's webhook URL, https://<your-shop>/payment/xpay/webhook. It is fixed per shop (it does not depend on the method code), so it can be registered right away.
  3. Fill in the code, channels, name and secret key.
  4. In XPay, open Developers → Webhooks → Add endpoint, paste the URL and subscribe to:
    • checkout.session.completed
    • checkout.session.async_payment_succeeded
    • checkout.session.async_payment_failed
    • checkout.session.expired
  5. Copy the whsec_… signing secret XPay shows once, paste it into Webhook signing secret, save.

When a shop has several XPay methods (e.g. test and live), each event is matched to the method whose signing secret verifies it. The per-method Sylius endpoint /payment-methods/{code} keeps working as well.

Test and live mode are separate in XPay: switching to live means a sk_live_… key and a new live webhook endpoint with its own whsec_… secret.

Optional settings:

From the command line

How a payment flows

Payment states:

XPay session Sylius payment
paymentStatus: paid (amount and currency match) completed
status: complete, paymentStatus: unpaid (Fawry reference issued) processing
open, bank verification still running processing
checkout.session.async_payment_failed / expired failed (Sylius opens a new payment)
customer back via the cancel URL, nothing in flight session expired, payment failed

Safety rules:

Amounts: Sylius stores two implied decimals for every currency; for KWD, BHD, JOD, OMR and LYD the plugin converts to XPay's three-decimal minor unit.

Testing with XPay test mode

Use card 5123 4500 0000 0008, expiry 01/39, CVV 100 for an approved payment. Other expiries simulate declines (05/39), insufficient funds (01/27) and more; see XPay test mode. Fawry and ValU need a total of at least 50 EGP.

Development

Logs go to the xpay Monolog channel.


All versions of sylius-xpay-plugin with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
sylius/sylius Version ^2.1
symfony/http-client Version ^6.4 || ^7.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 storkplus/sylius-xpay-plugin contains the following files

Loading the files please wait ...