Download the PHP package noweh/laravel-payzen without Composer
On this page you can find all versions of the php package noweh/laravel-payzen. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package laravel-payzen
Laravel-Payzen
The library provides an easy and fast Payzen form creation. This helps to instanciate all required parameters and create the form to access to payment interface. To know required parameters, go to https://payzen.io/en-EN/form-payment/quick-start-guide/sending-a-payment-form-via-post.html
Installation
First you need to add the component to your composer.json
Update your packages with composer update or install with composer install.
Laravel uses Package Auto-Discovery, so doesn't require you to manually add the ServiceProvider.
Laravel without auto-discovery
Noweh\Payzen\PayzenServiceProvider::class,
To use the facade, add this in app.php:
'Payzen' => Noweh\Payzen\PayzenFacade::class,
Service Provider
After updating composer, add the ServiceProvider to the providers array in config/app.php
Configuration file
Next, you must migrate config :
php artisan vendor:publish --provider="Noweh\Payzen\PayzenServiceProvider"
Create a payment form
Now we are finally ready to use the package! Here is a little example:
Check Payzen response signature
Other useful functions
add_product
Add a product to the order
Parameters
array $product , must have the following keys : 'label,amount,type,ref,qty
Example
Note : the amount of each products price must not be multiplied by 100
set_amount
Defines the total amount of the order. If you doesn't give the amount in parameter, it will be automaticly calculated by the sum of products you've got in your basket.
Parameters
[optional] int $amount, Payzen format. ex : for a product with a price of 150€, give 15000
Example
get_amount
Get total amount of the order
Parameters
[optional] bool $decimal if true, you get a decimal otherwise you get standard Payzen amount format (int). Default value is true.
Example
set_params
Method to do massive assignement of parameters
Parameters
array $params associative array of Payzen parameters
Example
ascii_transcode
Method to convert an input in a compatible for Payzen
Parameters
string $input, text to convert
string $allow, n|a|an|ans
int $length 1..255
boolean $truncate allow returning truncated result if the transcoded $input length is over $length
Example
check signature in response
Checking Payzen response signature