Download the PHP package finopal/finopal-php-sdk without Composer

On this page you can find all versions of the php package finopal/finopal-php-sdk. 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 finopal-php-sdk

نمونه کد PHP فینوپال

کیت PHP درگاه پرداخت اینترنتی فینوپال. استفاده با Options، کلاینت، paymentGateway() و یک آبجکت برای هر متد است.

مبلغ‌ها به ریال هستند. حداقل ۱۰۰۰ ریال.

نصب

پیش‌نیاز: PHP 8.1 یا بالاتر، افزونه curl و Composer.

تا زمان انتشار روی Packagist، بسته را از همین مخزن وصل کنید:

اگر خود این پوشه را جدا کلون کرده‌اید:

پیکربندی

merchant_id را از پنل کاربری فینوپال بردارید. برای محیط آزمایشی sandbox را true بگذارید.

حالت آدرس
واقعی https://payment.finopal.ir
سندباکس https://sandbox.finopal.ir

برای میزبان دلخواه کلید base_url را بدهید. این مقدار جای سندباکس و تولید را می‌گیرد.

درخواست پرداخت

order_id در فینوپال الزامی است. description حداکثر ۲۵۵ کاراکتر است.

اگر payment_url خالی باشد:

نمونه کامل: examples/request.php

تأیید پرداخت

فقط وقتی Status=OK (یا در سندباکس Status=0) است verify را صدا بزنید. مبلغ باید دقیقاً همان مبلغ درخواست اول باشد.

کد 100 یعنی تازه تأیید شد. کد 101 یعنی قبلاً تأیید شده بود. هر دو یعنی پرداخت موفق است.

نمونه کامل: examples/verify.php

استعلام تراکنش

استعلام وضعیت را عوض نمی‌کند. اگر verify به‌خاطر قطع شبکه نامعلوم ماند، به‌جای ساخت درخواست تازه استعلام بگیرید.

وضعیت‌ها: pending، successful، failed، cancelled، refunded، callback.

نمونه: examples/inquiry.php

ریورس تراکنش

فقط روی تراکنش تأییدشده و در بازه کوتاه پس از تأیید. تکرار ریورس یا گذشتن مهلت خطا می‌دهد.

نمونه: examples/reverse.php

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

قبل از ساخت پرداخت، کارمزد را نشان دهید. fee_type برابر Merchant یعنی کارمزد روی پذیرنده است و Payer یعنی روی خریدار.

نمونه: examples/fee.php

خطا

استثنا معنی
ValidationException ورودی نامعتبر؛ درخواستی ارسال نشده
ResponseException گیت‌وی درخواست را رد کرده. getErrorCode() و getErrorDetails()
TransportException شبکه، JSON نامعتبر یا خطای ۵xx. نتیجه نامعلوم است؛ استعلام بگیرید

کدهای پرکاربرد: -9 اعتبارسنجی، -11 درگاه یا تراکنش پیدا نشد، -14 دامنه بازگشت با دامنه ثبت‌شده یکی نیست، -50 مبلغ تأیید با مبلغ درخواست فرق دارد، 100 و 101 تأیید موفق.

لیست تراکنش‌ها و تراکنش‌های تأییدنشده در API پذیرنده فینوپال نیست و در این نمونه کد هم نیست.


All versions of finopal-php-sdk with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
ext-curl Version *
ext-json Version *
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 finopal/finopal-php-sdk contains the following files

Loading the files please wait ...