Download the PHP package markette/gopay without Composer

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

Website 🚀 contributte.org | Contact 👨🏻‍💻 f3l1x.io | Twitter 🐦 @contributte

Disclaimer

:warning: This project is no longer being maintained. Please use contributte/gopay-inline.
Composer markette/gopay
Version
PHP
License

About

This version used communication through SOAP. We recommend using contributte/gopay-inline which uses JSON REST API.

Installation

To install the latest version of markette/gopay use Composer.

Configuration

Register extension in DI:

Usage

Services

You can choose from three services:

You can use autowiring and inject them into Presenter:

Before payment

Before payment, you need to create a form with the corresponding payment buttons. Each payment channel is represented by one button. You can add buttons to the form simply via Binder with the bindPaymentButtons() method:

The passed callback will be called after the successful submission of the form by one from the payment buttons (ie as after calling ->onClick[] on the given button). The selected channel can be obtained from the button:

If you want to render the form manually (eg using form maker), it is best to pass a list of used channels to the template and iterate over it:

It's a good idea to wrap the getChannels() call by catching the GopayFatalException exception because for the first time it queries the Gopay server to get the default list.

Custom payment channels

You can register your custom payment channels for a single job:

You can also disable or enable any predefined (or even your custom) payment channel:

We can also make these settings in the configuration file:

If we want to allow to change channel on the GoPay page:

Make a payment

Payment can be made in the following steps. First you need to create new payment instance:

Second, set the addresses to which the Gopay payment gateway redirects the success of the payment or while error in payment proccess:

It is useful to make a note of the payment ID (for example if the payment is to be bound to an order etc.). This can be accomplished by passing the callback as the third parameter to the pay() method:

The payment itself can be made in two ways:

Redirect after a payment

The pay() action returns an RedirectResponse, which redirects you to the Gopay gateway:

Inline payment

The payInline() action returns a field with the url and signature keys:

The payment gateway can be created using the form, which can be found in documentation.

Payment exception

Two things can go wrong when calling pay() or payInline():

  1. Bad parameters are provided somewhere
  2. The official Gopay payment gateway is broken

The first mistake should never occur. It means a mistake in your code.

The second can happen at any time, so it generates a slightly different exception that you need to catch and inform the customer according to it that the error is not on to Your side:

After payment

Your customer will perform the necessary actions on the Gopay payment gateway, and once the process is completed, he is redirected back to your application, either to successUrl or failureUrl address. Both will receive the following set of parameters from Gopay:

Plus the parameters you specify in successUrl or failureUrl.

The first parameter is identical to the one that we have saved in the previous chapter to our internal model representation of the order. So we can use it for reload.

We will then use all this data + data from the loaded order for payment object reassembly:

Two control methods can be called on a payment object: isFraud() and isPaid(). The first informs us whether the payment is genuine or not for fraud (internally, the four parameters passed from the payment system are checked by payment gate).

The second isPaid() then returns TRUE if the payment is actually paid. If yes, the process is over, we can mark that the order is paid and send for example, an email to the customer.

In case of unsuccessful payment, all four parameters are passed again, so it is possible to retrieve information about the related order. However there is no need to check anything, the information about the failure is quite clear from the character of the request.

Recurring payments

Making a recurring payment is very easy:

We will need $paymentSessionId to cancel the recurring payment:

Pre-authorized payments

Making a pre-authorized payment is very simple:

We will need $paymentSessionId to cancel the pre-authorized payment:

Versions

State Version Branch Nette PHP
dev ^3.4.0 master 3.0+ >=7.1
stable ^3.3.0 master 3.0+ >=7.1
stable ^3.2.0 master 2.4 >=5.6
stable ^3.0.0 master 2.3 >=5.5
stable ^2.3.0 master 2.3 >=5.4
stable ^2.2.0 master 2.2 >=5.3.2

Development

This package was maintained by these authors.


Consider to support contributte development team. Also thank you for using this package.


All versions of gopay with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1
markette/gopay-api Version ^2.5.4
nette/forms Version ^3.1.0
nette/application Version ^3.1.0
nette/di Version ^3.0.8
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 markette/gopay contains the following files

Loading the files please wait ...