承接 projovi/khalti 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

projovi/khalti

Composer 安装命令:

composer require projovi/khalti

包简介

Php wrapper for khalti integration

README 文档

README

This package can help you integrate Khalti new ePayment Gateway (NEW) to your php application.

Here is an example of how you can initiate Khalti transaction:

...
use Projovi\Facades\Khalti;

class PaymentController extends Controller {
    ...
    public function pay() {
        $return_url = "http://example.com/verify";
        $purchase_order_id = "your_transaction_id"; // example 123567;
        $purchase_order_name = "your_order_name"; // example Transaction: 1234,
        $amount = 1000; // Your total amount in paisa Rs 1 = 100 paisa

        return Khalti::initiate($return_url, $purchase_order_id, $purchase_order_name,  $amount);
    }

    public function verify(Request $request) {
        $pidx = $request->get('pidx');
        return Khalti::lookup($pidx);
    }


}

Installation

You can install the package via composer:

composer require projovi/khalti

The package will automatically register itself.

You can publish the config with:

php artisan vendor:publish --tag=khalti-config

This is the contents of the published config file:

<?php

return [
    'debug' => true, // set false to run on live khalti url
    'auto_redirect' => true, // set false if you don't want khalti to auto redirect
    'website_url' => 'https://example.com', // your website url
    'live_public_key' => env('KHALTI_LIVE_PUBLIC_KEY', ''), // public key from khalti
    'live_secret_key' => env('KHALTI_LIVE_SECRET_KEY', ''), // secret key from khalti
    'test_public_key' => env('KHALTI_TEST_PUBLIC_KEY', ''), // public key from khalti
    'test_secret_key' => env('KHALTI_TEST_SECRET_KEY', '') // secret key from khalti
];

Update .env with your khalti credentials

This credentals are provided with merchant dashboard.

set debug flag to false in config to use live khalti

KHALTI_DEBUG=true # Set this flag to false to use khatli in production
KHALTI_LIVE_PUBLIC_KEY=
KHALTI_LIVE_SECRET_KEY=
KHALTI_TEST_PUBLIC_KEY=
KHALTI_TEST_SECRET_KEY=

Usage

The basic concept of this package is that you can integrate Khalti ePayment Gateway (NEW) to your laravel applications and initiate/verify transactions

统计信息

  • 总下载量: 5
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-07-04