anwar/abkash

Laravel Bkash 支付网关,适用于孟加拉国的 bKash 移动支付服务。

v1.02 2019-05-08 05:26 UTC

This package is auto-updated.

Last update: 2024-09-08 17:46:22 UTC


README

一个用于验证 bKash 商户付款收到的包。

要求

Laravel >=5.1
PHP >= 5.5.9

安装

对于 Laravel >= 5.5,您需要按照以下步骤操作

  1. 运行
    composer require anwar/abkash
    
  2. 运行以发布配置文件
php artisan vendor:publish --provider Anwar\Abkash\AbkashServiceProvider --force true

对于 Laravel < 5.5,您需要按照以下步骤操作

  1. 运行
    composer require anwar/abkash
    
  2. 将服务提供者添加到 config/app.php 文件。
    'providers' => [
        ...
        Anwar\Abkash\AbkashServiceProvider::class,
    ],
    'aliases' => [
        ...
        Anwar\Abkash\Faceds\AbkashFaced::class,
    ],
  3. 运行以发布配置文件
php artisan vendor:publish --provider Anwar\Abkash\AbkashServiceProvider --force true

使用方法

<?php

/**
 * @Author: anwar
 * @Date:   2018-02-07 11:13:24
 * @Last Modified by:   anwar
 * @Last Modified time: 2018-02-07 11:32:48
 */
return [
	"Abkash" => [
		'username' => '', //username of your marchant account
		'password' => '', //password of your marchant account
		'mobile' => '',  //mobile of your marchant account
	],
];

配置后

您可以使用如下方式

<?php

namespace App\Http\Controllers;

use Abkash;

class HomeController extends Controller {
	/**
	 * Create a new controller instance.
	 *
	 * @return void
	 */
	public function __construct() {
		$this->middleware('auth');
	}

	/**
	 * Show the application dashboard.
	 *
	 * @return \Illuminate\Http\Response
	 */
	public function index() {

		return view('home', compact('Abkash'));
	}
}