Download the PHP package konekt/payum-otp-hungary without Composer

On this page you can find all versions of the php package konekt/payum-otp-hungary. 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 payum-otp-hungary

Payum Gateway for SimplePay Hungary via the Legacy OTP Integration

Packagist Stable Version OTP SDK v5 SimplePay Compatible

The OTP based payment method has been deprecated by the bank, use SimplePay instead!

It works with OTP SDK v5 despite the names and references to v4.

Consists of a standard payum gateway library with which you can make online payments through OTP Bank Hungary. It also provides basic integration with Symfony and Sylius.

Disclaimer: the library for now provides only simple offsite (haromszereplos) payment for a single shop (no multishop support). Feel free to contribute or ask for support if you need further functionality.

Architecture

The library builds on top of OTP's official SDK. It hides some of the library's inconveniences, like having to edit a configuration file, no autoloading, messy warnings/notices and no support for PHP7. The official SDK's logging features work as they provide it.

You will have to download the SDK from OTP's site in order to be able to use the library.

SDK

After you downloaded the SDK (currently a ZIP file named Webshop_4.0) you will find the needed php library in the zip on the following path: . This is the library that is used and you have to put it in a place accessible to your web server. From now on we will call the full path where you have the library .

Because the SDK has no proper versioning, to check if it is the same code that this library is building on you will have to generate the checksum of the library like this (assuming you're on Unix):

The tested library has a checksum of 5a57d623e8da3541c8b8d6fd3848862c. If you have another one it means the SDK code has changed. If something is not working as expected this can be a reason for that.

Using the standalone library

You will have to implement actions as described in the Payum documentation. In the folder you will find working scripts which can help you.

Configuration

You will find the parameters you will have to configure in .

In addition you can configure the log dirs where the SDK will log the transactions. You will find the details in the SDK official documentation about each directory.

Using the library with Sylius

You will have to register the action which converts the Sylius models into the gateway's data as a service.

You also can define another service where you can control the payment note (shopMegjegyzes) sent to OTP. If you do this you have to implement \Konekt\PayumOtp\Bridge\Sylius\PaymentNoteProviderInterface in your app and define it as a service, then inject it to the converter. In this case the above definition looks like:

To register the custom payum library into your app, you should add the following to your AppBundle:

Then you will have to configure the payum bundle to know about the new custom library like this:

You can define the parameters in your (recommended). For the meaning of the parameters see the Configuration section above. Note: even if you are in sandbox mode you will have to provide a value for secret_key and pos_id, but in this case it doesn't matter what you provide there (this is a technical depth for now).

Error handling

You also have the possibility to handle the transaction errors in a decoupled way. For example you want to get an email if any transaction fails by reasons such as wrong amount sent or the private key was rejected etc. In this case you will have to register the library's event notifier extension class as a service:

Then you will have to write a listener in your app and define it as a service. Implement which sends an email if an error occurs:

Then register it as a service:

In the method you will get a event, which contains the array of occured errors and other details of the transaction. You can write your handling logic as you need.

FINAL NOTES

If you have any questions feel free to open an issue. Any improvements or further functionality is very welcomed, feel free to make a pull request.


All versions of payum-otp-hungary with dependencies

PHP Build Version
Package Version
Requires payum/core Version ~1.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 konekt/payum-otp-hungary contains the following files

Loading the files please wait ....