Download the PHP package amyavari/iran-payment-laravel without Composer

On this page you can find all versions of the php package amyavari/iran-payment-laravel. 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 iran-payment-laravel

Iran Payment Laravel

PHP Version Laravel Version Packagist Version Packagist Downloads Packagist License Tests

A simple and convenient way to connect your app to Iranian payment providers.

To view the Persian documentation, please refer to README_FA.md.

برای مشاهده راهنمای فارسی، لطفاً به فایل README_FA.md مراجعه کنید.

Requirements

List of Available Payment Gateways

Gateway Name (EN) Gateway Name (FA) Gateway Website Gateway Key Version
Behpardakht به پرداخت ملت behpardakht.com behpardakht 1.0.0
Sep سامان کیش (سپ) sep.ir sep 1.0.0
Zarinpal زرین پال zarinpal.com zarinpal 1.0.0
IDPay آی دی پی idpay.ir idpay 1.0.0
Pep پرداخت الکترونیک پاسارگاد pep.co.ir pep 1.1.0
Sadad سداد sadadpsp.ir sadad 1.1.0
Zibal زیبال zibal.ir zibal 2.0.0
PayPing پی پینگ payping.ir payping 2.0.0
NextPay نکست پی nextpay.org nextpay 2.0.0

[!CAUTION] Gateways have different rules for pending verifications and reversals. Please check gateways_note_en.md.

Table of Contents

Installation

To install the package via Composer, run:

Publish Vendor Files

Publish All Files

To publish all vendor files (config and migrations):

Note: To create tables from migrations:

Publish Specific Files

To publish only the config file:

To publish only the migration file:

Note: To create tables from migrations:

Configuration

To configure payment gateways, add the following to your .env file:

Notes:

Usage

Create a Payment

You can create a new payment using the facade provided by the package:

Note: For the $gateway, refer to the gateway Key column in the List of Available Payment Gateways.

Checking API Call Status

In all calls to a gateway’s API (all methods in this package), you can check the latest status and response using the following methods:

Storing Payment Data

Automatic Store

The package can automatically store payments and keep them in sync during later API calls such as verification, or reversal.

If you prefer full control, Manual Store approach.

Enable automatic storage by chaining store() before calling create():

Notes:

Accessing the Stored Payment

After a payment is created, and during any subsequent API calls such as verify(), or reverse(), you can access the underlying payment model:

To see all available attributes, refer to src/Models/Payment.php

Tracking Payments via the Payable Model

When using automatic storage, add the AliYavari\IranPayment\Concerns\HasPayment trait to your payable model to track its payments:

Note: For more information about this relationship, see Eloquent relationships: one-to-many polymorphic.

Querying Stored Payments

The Payment model provides query scopes for common payment states:

Manual Store

If you want full control over storing and tracking payments, you can use these methods:

Redirect User to Payment Page

To redirect user to the gateway’s payment page, use the data provided by the following method:

Verification

Verify and Reverse

After the user is redirected back to your application from the gateway, you can verify the payment using these methods:

Notes:

If you used the internal automatic storage

If you stored the payment manually,

To reverse the payment:

Notes:

Successful Payment Details

If the payment is successful, the following methods are available to retrieve additional payment details:

Form Request Classes

To validate callback data from each gateway, this package provides simple FormRequest classes. You can use them like this (using the sep gateway as an example):

Available Form Request classes:

Verification Without Callback

Sometimes the user does not return to your website after completing the payment. In this case, you should use the noCallback() method instead of fromCallback(). All other steps remain the same.

If you are using Automatic Store, you can directly rebuild the gateway payment instance from the stored model:

Note: Some gateways (mainly Shaparak-based gateways) automatically reverse the transaction if the callback is not received, while others allow verification without a callback. This package applies each gateway’s rules internally.

Testing

For local development or automated tests, you can fake payment responses so no real transactions are made. This allows you to test success, failure, and connection errors safely.

Note: All methods are chainable. Examples below show single calls for clarity.

Faking a Gateway

Note: For the $gateway, refer to the gateway Key column in the List of Available Payment Gateways.

Defining Fake Behavior for create()

Note: If $redirectData is null, this default is returned:

Defining Fake Behavior for verify()

Note: The fake gateway does not validate gateway payloads or callback data. You can only simulate an invalid callback exception by explicitly forcing it:

Defining Fake Behavior for reverse()

Note: If you set behavior for the same gateway and method multiple times, only the last definition will take effect.

Contributing

Thank you for considering contributing to the Iran Payment Laravel! The contribution guide can be found in the CONTRIBUTING.md.

License

Iran Payment Laravel was created by Ali Mohammad Yavari under the MIT license.


All versions of iran-payment-laravel with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
spatie/laravel-package-tools Version ^1.92
illuminate/contracts Version ^11.44|^12.23|^13.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 amyavari/iran-payment-laravel contains the following files

Loading the files please wait ...