Download the PHP package sindibad/zaincash without Composer
On this page you can find all versions of the php package sindibad/zaincash. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package zaincash
Laravel #1 Payment Gateway For Zaincash
This is a Laravel Package for Payment Gateway Integration. This package supports Laravel 5.5+
.
Installation
The package can be installed via Composer:
Configure
If you are not using Laravel 5.5
or higher than you need to add the provider and alias.(otherwise skip this part)
In your config/app.php
file add these two lines.
then run php artisan vendor:publish
to publish config/payment.php
file in your config directory as well as zaincash/callback.blade.php
file in views directory.
In the config file you can set to use initial configs for all your payments. But you can also change some of these values like eloquent_storage
,callback_url
,lang
,eloquent_storage
at runtime.
Then fill the credentials for zaincashGateway.php
file
How to use
Invoice
your Invoice
holds your payment details, so initially we'll talk about Invoice
class.It is mainly used for transactioninit purpose;
Working with invoices
before doing anything you need to use Invoice
class to create an invoice,
Also note that if you're planning to use EloquentStorage use the following artisan command:
In your code, use it like the below:
callBackResponse
This method is used to retrieve gatewaycallback response.it gets jwt token as it's input parameter.
By default, callback response input name is token
but you can change it if source callback is different.
if token is not set in request status will set to 'cancel'
Working with calBackResponse
$payment
includes following parameters
amount
: transaction cash amountstatus;
: success,failed,cancel,repetitious,invalid_tokenorderId
: orderId of transactionpayment
: payload dataoperationId
: operation idconfig
: default config settingsextras
: whole extras set in InvoiceserviceType
: service typeinitDate
: transaction time in timestamp formatbackButtonText
: back button textbackButtonLink
: back buttonLinkerrorMessage
: error messages if anytransaction
: this parameter returns when eloquent storage is set to true
you could also use getter methods for each of these parameters like below:
PaymentReceivedEvent
You could also use zaincash internal Event to receive payment info.
Make a new event and definePaymentReceivedEvent::class
in your EventListener.
In your event, use it like the below: