Download the PHP package hosseinmehr/zarinpal-composer-library without Composer

On this page you can find all versions of the php package hosseinmehr/zarinpal-composer-library. 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 zarinpal-composer-library

zarinpal-composer-library

Tests

نسخه: 1.0.1

کتابخانه PHP برای اتصال به درگاه پرداخت زرین‌پال بر پایه API v4.

این پکیج امکان ایجاد درخواست پرداخت، وریفای، استعلام، تسویه اشتراکی شناور، میان‌پی (چک‌اوت)، واحد پولی و اعتبارسنجی خودکار/غیرخودکار را فراهم می‌کند.

نصب

پیش‌نیاز

شروع سریع

وریفای پرداخت

پس از بازگشت کاربر، پارامتر Status در QueryString مقدار OK یا NOK دارد:

ویژگی‌های پیشرفته

واحد پولی (ریال / تومان)

مقادیر مجاز: IRR (ریال، پیش‌فرض) و IRT (تومان).

اعتبارسنجی خودکار / غیرخودکار

با پارامتر auto_verify در metadata می‌توانید رفتار اعتبارسنجی را کنترل کنید:

اگر auto_verify ارسال نشود، رفتار طبق تنظیمات پنل زرین‌پال تعیین می‌شود. مستندات اعتبارسنجی

تسویه اشتراکی شناور (تسهیم)

میان‌پی (صفحه چک‌اوت)

ارسال جزئیات سبد خرید برای نمایش شفاف‌تر به خریدار:

مستندات میان‌پی

متدهای دیگر

استعلام وضعیت (بدون وریفای)

تراکنش‌های وریفای‌نشده

ریورس تراکنش

محاسبه کارمزد

کدهای خطا

کلاس ErrorCodes شامل تمام کدهای خطای مستندات زرین‌پال است: لیست خطاها

یکپارچه‌سازی با Laravel

این کتابخانه با Laravel 5.5 به بالا (شامل Laravel 8، 9، 10 و 11) سازگار است.

امکانات Laravel:

نصب در پروژه Laravel

تنظیمات

در فایل .env پروژه:

در فایل config/services.php:

یا انتشار فایل پیکربندی اختصاصی:

نمونه Controller

استفاده با Facade

استفاده با Dependency Injection

به‌جای Facade می‌توانید از container لاراول استفاده کنید:

نکات Laravel

  1. Laravel 11+ — همان روش کار می‌کند؛ فقط services.php را خودتان تنظیم کنید.
  2. محیط تست — در .env مقدار ZARINPAL_SANDBOX=true بگذارید.
  3. Route نمونه:

سازگاری با نسخه قبل

تست

تست‌های یکپارچه‌سازی به مرچنت سندباکس واقعی نیاز دارند:

مستندات رسمی

مجوز

GPL-2.0-only — مشاهده LICENSE.md

مشارکت

مخزن: github.com/hosseinmehr/zarinpal-composer-library


All versions of zarinpal-composer-library with dependencies

PHP Build Version
Package Version
Requires php Version >=7.2
guzzlehttp/guzzle Version ^6.2|^7.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 hosseinmehr/zarinpal-composer-library contains the following files

Loading the files please wait ...