Download the PHP package nimah79/f3-zarinpal without Composer
On this page you can find all versions of the php package nimah79/f3-zarinpal. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package f3-zarinpal
F3 Zarinpal
This is a Zarinpal plugin for the PHP Fat-Free Framework.
Features
- Easy to use API
- Full API Methods
- Full Documented
Installation
Using Composer
composer require nimah79/f3-zarinpal
Config sample
Add these lines to your F3 config:
Quick Start
Request Authority (and redirecting user)
Verifying transaction
More!
Set uesr information
You can pass user information to Zarinpal. This is recommended to have more control on your transactions:
Using Sandbox
You can use sandbox mode when you want to do some test transactions with custom result (succeeded or failed):
Using Zaringate
By default, users will redirect to Zarinpal Webgate page, but you can transfer your users to payment gateway directly. Notice that you need to activate necessary service for using Zaringate (call Zarinpal supports):
Shared payoff
This method is suitable for those sellers whose benefit from entered price must be distributed in a special way. For example, you own a website that presents ceremony services and you have some contributions with several contractors. In this way you would keep some money and settle the rest of it to the contractors' account.
You can also add multiple items for shared payoff:
Long time authority
By default, an authority will expire at 15 minutes after generating, but you can set your custom lifetime for your generated authority by using expireIn()
method (between 1800 to 3888000 seconds). You should use it before request()
:
Notice that you need to activate necessary service for using thins method (call Zarinpal supports).
Get redirect URL
Sometimes, you need to have gateway URL instead of redirecting:
Pay attention to use this method after $zarinpal->request()
. Look at to this example:
Get generated authority
Normally you don't need this method, but it's possible to get pure generated authority. It also need to run after request()
:
Refresh Authority
If you want to refresh your authority lifetime, use refreshAuthority()
. It does the same thing that expireIn()
does. but refreshAuthority()
can be used when you generated an authority in past and expireIn()
will help you to set your authority life span before generating:
Get list of unverified transactions
This method return a list of transactions that you didn't verify()
them, so it sound that all transactions on this list should be uncompleted:
Response
All responses from the API will return a Response
object. This object contains these datas:
You can check if the request was successful or not using ok
, get returned status in status
and get translated status message in message
. Also, you can access to api result in body
.
All versions of f3-zarinpal with dependencies
ext-curl Version *