Download the PHP package pythagus/lydia without Composer
On this page you can find all versions of the php package pythagus/lydia. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download pythagus/lydia
More information about pythagus/lydia
Files in pythagus/lydia
Package lydia
Short Description Oriented-Object Package to use Lydia payment way in PHP
License MIT
Informations about the package lydia
Lydia payment
Lydia is an online-payment solution. This package presents an implementation of this tool in an Object-Oriented view. This is a stand-alone package.
Version
This package works since PHP 7.3. Please refer to the next table to check whether your PHP version is compatible with this package.
Package version | PHP version |
---|---|
1.x | 7.x, 8.x |
Installation
With composer
Use the package manager composer to install this package.
Without package manager
You can clone the current repository and completely use this package. You need to make (or use) an autoload package (like composer) to correctly discover the files.
Usage
This section describes how to correctly and fully use this package.
The Lydia facade
The class allows you to custom the Lydia main interactions with your application. You need to extend this class. The package won't work otherwise. You can refer to the example/MyLydiaFacade class to have an example how to override this class.
When you override the class, you need to àdd the next line to be taking into account:
If you are using a framework, you can add this line when your application is starting. If you are not, you need to add this line before every request you make.
Note : if you are using a framework, you will probably have a redirect response manager. So you can override the
method to use your framework instead.
Configuration
You have an example of a configuration file in the example folder. The class show you what you should override to adapt this package to your application. I suggest you copying the config file and only add your personal keys.
Properties
The key in the config file allows you to declare some properties that won't change from a request to another (like the currency).
Lydia requests
For now, the package implements 3 Lydia's requests:
PaymentRequest
Make a payment request to the Lydia's server. You need to use the method to define the return route using by Lydia to redirect the user. You also need to define amount and recipient parameters like:
The method will redirect the user to the Lydia's page. After payment, the user will be redirected to .
PaymentStateRequest
Check the state of a payment. You need to set the that is given in the array when the payment is requested. You can execute the request like:
RefundRequest
Refund partially or globally a transaction. You need to set the that is given in the finish route. You need to add the amount parameter. You can execute the request like:
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
License
MIT