Download the PHP package unicorncrew-tech/sylius-comgate-plugin without Composer

On this page you can find all versions of the php package unicorncrew-tech/sylius-comgate-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-comgate-plugin

Sylius Logo

Sylius Comgate Plugin

Build Status Latest Version on Packagist

Integration of the Czech payment gateway Comgate with Sylius as a Payum gateway.


Requirements

How it works

Comgate is a redirect + server-to-server-webhook gateway: the shopper is redirected to a Comgate-hosted payment page, Comgate then confirms the outcome by calling back a STATUS URL on your shop and by redirecting the shopper back to a PAID/CANCELLED/PENDING URL.

This plugin implements that flow as a Payum gateway (factory name comgate), the same architecture used by the official sylius/paypal-plugin and sylius/mollie-plugin:

Installation

  1. Require the plugin:

  2. Enable it in config/bundles.php:

  3. Import its configuration in config/packages/unicorncrew_sylius_comgate.yaml:

  4. Run migrations if needed (this plugin adds no new entities/tables, so this is normally a no-op) and clear the cache.

Configuration

  1. Go to the admin panel, Configuration > Payment methods, and create a new payment method.
  2. Pick Comgate as the gateway.
  3. Fill in:
    • Code: e.g. comgate — this becomes the gateway name used in the webhook URL below.
    • Channels: the channels this payment method should be available on.
    • Merchant ID / Secret: from portal.comgate.cz.
    • Test mode: check this while testing; Comgate flags the payment as a test transaction rather than using a different endpoint.
  4. Give it a display name for each locale, and save.

Webhook (STATUS URL)

In portal.comgate.cz, set the STATUS URL (and, if you want Comgate itself to redirect back with a PAID/CANCELLED/PENDING query string, the corresponding redirect URLs — this plugin already sets its own dynamic return URL per payment, so those portal-level URLs are only a fallback) to:

Use bin/console debug:router payum_notify_do_unsafe to double check the exact path prefix used by your shop, and the payment method's code (as configured in step 3 above) as the <payment method code> segment.

Refunds

Refunds are sent to Comgate's refund API from the Sylius admin. There are two ways to do it, depending on whether sylius/refund-plugin is installed.

Full refund (Sylius core)

On the order page (Sales > Orders > order > Payments), the Refund button of a completed Comgate payment refunds the whole payment amount at Comgate, then marks the payment as refunded.

This works with the Symfony Workflow state machine (the Sylius 2 default) and with winzou_state_machine if your app maps the sylius_payment graph to it.

Partial refunds (sylius/refund-plugin)

With sylius/refund-plugin installed and enabled, Sylius' core payment Refund button is hidden, and you refund from the order's Refunds page instead. There you pick any items and shipping costs to refund, including partial amounts. This plugin adds comgate to sylius_refund.supported_gateways for you, so Comgate payment methods show up as refund methods.

When the refund method you pick is a Comgate one, the refunded amount goes to Comgate through the order's Comgate payment, and the refund payment is marked completed straight away. If Comgate refuses the refund, or the order was not paid through Comgate, the refund plugin rolls the whole refund back (no credit memo, no refund payment) and shows its generic error flash. The reason is in the application log. To refund an order without moving money through Comgate (e.g. by bank transfer), pick an offline refund method.

Comgate always refunds in the currency of the original transaction. Test-mode gateways send test-mode refunds.

Testing

This plugin uses sylius/test-application as a dev dependency instead of bundling its own throwaway Sylius app. tests/Unit runs in isolation (no framework needed); tests/Functional boots the real Sylius kernel — with this plugin enabled via tests/TestApplication/bundles.php and tests/TestApplication/.env — and asserts the container actually compiles: the comgate Payum gateway factory is registered, its actions resolve, and the admin gateway configuration form type is wired, i.e. everything bin/console debug:container would otherwise be used for. It also renders the admin payment method form's gateway configuration section (create and update) through Sylius' Twig hooks and asserts the Merchant ID / Secret / Test mode fields and their validation errors show up, and applies Sylius' payment refund transition to check that it refunds at Comgate, or is aborted when Comgate refuses the refund. A second kernel with sylius/refund-plugin enabled checks that Comgate is offered as a refund method and that the plugin's refund payments are refunded at Comgate.

No database is required to run the suite (tests/TestApplication/.env points DATABASE_URL at a local SQLite file); it's only needed for Behat/browser-level testing, which this plugin does not ship.

Releasing

Commit messages MUST follow Conventional Commits - this is what drives versioning and the changelog:

Releases are automated with release-please: every push to master runs .github/workflows/release-please.yaml, which keeps a "Release PR" up to date with the next version (computed from the commits above) and the generated CHANGELOG.md. Merging that PR tags the release and publishes a GitHub Release; Packagist picks up new tags automatically once the repository is registered there.

There is no version field to bump in composer.json - Packagist and Composer resolve versions from git tags, so nothing else needs to change by hand.

Security

If you think you have found a security issue, please do not use the public issue tracker; contact the maintainers directly instead.

License

This plugin is released under the MIT License.


All versions of sylius-comgate-plugin with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
comgate/sdk Version ^1.9
payum/core Version ^1.7
sylius/sylius Version ^2.0
symfony/config Version ^6.4 || ^7.0
symfony/dependency-injection Version ^6.4 || ^7.0
symfony/form Version ^6.4 || ^7.0
symfony/http-foundation Version ^6.4 || ^7.0
symfony/http-kernel Version ^6.4 || ^7.0
webmozart/assert Version ^1.11
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 unicorncrew-tech/sylius-comgate-plugin contains the following files

Loading the files please wait ...