Zarinpal is a laravel package to easily use zarinpal.com payment services in your applications

Related tags

Laravel zarinpal
Overview

GitHub repo size License Packagist Version Total Downloads

پکیج اتصال به درگاه پرداخت زرین پال zarinpal.com

برای اتصال به درگاه پرداخت اینترنتی زرین پال و استفاده از api های آن می توانید از این پکیج استفاده کنید.

توجه: این پکیج برای لاراول 6 به بعد قابل استفاده است.


نصب

برای نصب پکیج توسط composer مراحل زیر را به دقت دنبال کنید:

مرحله اول

composer require rahmatwaisi/zarinpal

مرحله دوم - انتقال فایل های مورد نیاز

php artisan vendor:publish
# now choose: ZarinpalServiceProvider

مرحله سوم

در این مرحله باید تنظیمات مربوط به درگاه و درج کلید پذیرندگی را انجام دهید که برای اینکار باید فایل config/zarinpal.php را ویرایش کنید.

    
    /**
     * کد پذیرندگی
     * Merchant ID
     */

    'merchant_id' => 'INSERT_YOUR_KEY_HERE',

مرحله چهارم

باید متد callback را در کنترلر app\Http\Controllers\Zarinpal\PaymentCallbackController::class طبق نیاز خود ویرایش کنید. چند راهکار به صورت TODO پیشنهاد شده است.


مرحله پایانی - اضافه کردن یک مسیر برای دریافت اطلاعات پرداخت از درگاه

باید توجه داشت که این route نباید دارای هیچ middleware ی باشد.

مسیر /zarinpal/payments/callback به عنوان callback_route به صورت پیشفرض در فایل کانفیگ پل کارت config/zarinpal.php درج شده است که می توانید آن را تغییر داده و مسیر جدید را به عنوان callback_route انتخاب کنید.

\Illuminate\Support\Facades\Route::any(
    // TODO change this path if you want
    //   so if you changed this path, open config/pol.php and edit  callback_route key.
    '/zarinpal/payments/callback'
    , [
        Http\Controllers\Zarinpal\PaymentCallbackController::class
        , 'callback'
    ]
);

نحوه استفاده

// ابتدا فاساد پکیج را ایمپورت کنید
use RahmatWaisi\Zarinpal\Facade\Zarinpal;


/*
 | در کنترلر یا متد مورد نظر کدهای زیر را استفاده کنید
 */
 
$price = 6480000; // 648 هزار تومان
$description = 'some description'; // تا حداکثر 30 کاراکتر
$mobile = '09012345678';
$email = '[email protected]';

// درخواست توکن پرداخت
$authorityResponse  = Zarinpal::authority($price, $description,null,$mobile, $email);

// $code = $authorityResponse['code']; // کد پاسخ درگاه
// $message = $authorityResponse['message']; // پیغام درگاه
$authority = $authorityResponse['authority'];

// برای هدایت به صفحه پرداخت
Zarinpal::pay($authority);

// برای بررسی صحت تراکنش
Zarinpal::verify($price, $authority);

// برای اصلاحیه پرداخت ناموفق و درخواست لغو تراکنش و برگشت مبلغ به حساب دارنده کارت
Zarinpal::refund($authority);

در صورت تمایل جهت همکاری در توسعه شامل:

  1. توسعه مستندات پکیج.
  2. گزارش باگ و خطا.
  3. افزودن سرویس های دیگر
  4. ارتقاء کدها
  5. نوشتن تست

درصورت بروز هر گونه باگ ما را آگاه سازید .


ارتباط با ما


لایسنس

پکیج اتصال به درگاه زرین پال بصورت متن باز و تحت لایسنس MIT license قرار دارد.

You might also like...
A Laravel (php) package to interface with the geo-location services at geonames.org.

geonames v7.x A Laravel (php) package to interface with the geo-location services at geonames.org. Major Version Jump I jumped several major versions

Easily add a full Laravel blog (with built in admin panel and public views) to your laravel project with this simple package.

Webdevetc BlogEtc - Complete Laravel Blog Package Quickly add a blog with admin panel to your existing Laravel project. It has everything included (ro

Laravel comments - This package enables to easily associate comments to any Eloquent model in your Laravel application

Laravel comments - This package enables to easily associate comments to any Eloquent model in your Laravel application

Dedicated laravel package for Behpadakht Mellat bank payment service.
Dedicated laravel package for Behpadakht Mellat bank payment service.

Iranian Mellat bank full online payment service Dedicated laravel package for Behpadakht Mellat bank payment service. Features Event calls Log on chan

Laravel router extension to easily use Laravel's paginator without the query string

🚨 THIS PACKAGE HAS BEEN ABANDONED 🚨 We don't use this package anymore in our own projects and cannot justify the time needed to maintain it anymore.

Nebula is a minimalistic and easy to use administration tool for Laravel applications, made with Laravel, Alpine.js, and Tailwind CSS.

Nebula Nebula is a minimalistic and easy to use administration tool for Laravel applications, made with Laravel, Alpine.js, and Tailwind CSS. Nebula m

A Laravel package that allows you to use multiple
A Laravel package that allows you to use multiple ".env" files in a precedent manner. Use ".env" files per domain (multi-tentant)!

Laravel Multi ENVs Use multiple .envs files and have a chain of precedence for the environment variables in these different .envs files. Use the .env

This package lets you add uuid as primary key in your laravel applications

laravel-model-uuid A Laravel package to add uuid to models Table of contents Installation Configuration Model Uuid Publishing files / configurations I

This package allows you to easily track your laravel jobs!
This package allows you to easily track your laravel jobs!

Trackable Jobs For Laravel This package allows you to track your laravel jobs! Using this package, you can easily persist the output and the status of

Releases(1.0.0)
Owner
Rahmat Waisi
Hi, I'm software engineer, I'm Always Learning new things in programming, and i love formatted, standard clean codes too much.
Rahmat Waisi
Learn how to accept a payment from customers around the world with a variety of payment methods.

Accept a payment Learn how to securely accept payments online. This repository includes examples of 2 types of integration types. Prebuilt Checkout pa

Stripe Samples 337 Jan 2, 2023
Laravel-veneer - A suite of mocked services to use in your Laravel tests.

Laravel Veneer A suite of fixture data and methods to help make mocking 3rd party services easier. Overview Laravel Veneer aims to solve two problems

Oh See Software 4 Jun 23, 2022
A package to easily make use of Iconic icons in your Laravel Blade views.

Blade Iconic A package to easily make use of Iconic icons in your Laravel Blade views. For a full list of available icons see the SVG directory. Iconi

Malik Alleyne-Jones 17 Aug 25, 2022
A package to easily make use of Simple Icons in your Laravel Blade views.

Blade Simple Icons A package to easily make use of Simple Icons in your Laravel Blade views. For a full list of available icons see the SVG directory.

UB Labs 12 Jan 17, 2022
A package to easily make use of SVG icons in your Laravel Blade views.

Blade Icons A package to easily make use of SVG icons in your Laravel Blade views. Originally "Blade SVG" by Adam Wathan. Turn... <!-- camera.svg -->

Blade UI Kit 1.7k Jan 2, 2023
A package to easily make use of Iconsax in your Laravel Blade views.

Blade Iconsax A package to easily make use of Iconsax in your Laravel Blade views. This package contains 1.000 icons in 6 diferent styles, a total of

Guilherme Saade 4 Oct 22, 2022
Easily generate URLs to Minecraft avatars with the ability to switch between services

Minecraft Avatar URLs This library provides PHP utilities to generate URLs to Minecraft Avatars in different formats with the ability to easily change

Gigadrive UG 3 Aug 11, 2022
A package for integrating Lazerpay services with your laravel application

This is my package lazerpay-laravel This is where your description should go. Limit it to a paragraph or two. Consider adding a small example. Support

Abdulsalam Ishaq 5 Dec 22, 2022
A Laravel package to simplify using DPO Payment API in your application.

DPO (Direct Pay Online) Laravel Package The best DPO Laravel package, simple Ever This is the package that will help you add DPO Payment API to your L

Zepson Technologies 5 Nov 17, 2022
Navigator is a package to create headless navigation menus for use in Laravel applications

Navigator Navigator is a package to create headless navigation menus for use in Laravel applications: // In a Service Provider Nav::define(fn ($user)

Sam Rowden 36 Oct 30, 2022