定制 shibanashiqc/nbo-payment-gateway-php 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

shibanashiqc/nbo-payment-gateway-php

最新稳定版本:v2.0

Composer 安装命令:

composer require shibanashiqc/nbo-payment-gateway-php

包简介

NBO Payment Gateway

README 文档

README

Unofficial PHP library for NBO Unified Checkout.

Read up here for getting started and understanding the payment flow with NBO Unified Checkout: https://www.nbo.om/en/Pages/Corporate-Banking/Support/POS-Solutions.aspx

Prerequisites

  • A minimum of PHP 8.1 is required.

Installation

  • If your project using composer, run the below command
composer require shibanashiqc/nbo-payment-gateway-php

  • If you are not using composer, download the latest release from the releases section. You should download the nbo-payment-gateway-php-1.zip file. After that, include Nbo.php in your application and you can use the API as usual.

##Note: This PHP library follows the following practices:

  • Namespaced under Shibanashiqc\NboPaymentGatewayPhp\
  • API throws exceptions instead of returning errors
  • Options are passed as an array instead of multiple arguments wherever possible
  • All requests and responses are communicated over JSON

Documentation

Documentation of NBO Unified Checkout's API and their usage is available at https://www.nbo.om/en/Pages/Corporate-Banking/Support/POS-Solutions.aspx

Basic Usage

Merchant credentials can be obtained from the NBO. You can use the following credentials for testing:

Required parameters for the constructor are: Merchant ID, Password, ResourceKey

use Shibanashiqc\NboPaymentGatewayPhp\Nbo;

$request = new Nbo('IPAYlCR6qZF7q6w', 'TEST123456@', '34343434343497');
// $request->client->setURL('production_url_get_from_nbo_dashboard'); // if you got production keys the enable this
$request->setErrorURL('http://localhost:8000/error');
$request->setResponseURL('http://localhost:8000/response');

Create a Payment

getPaymentRequest() on this function first parameter is amount, second parameter is customer name, third parameter is customer mobile number, fourth parameter is customer email, fifth parameter is order id

$result = $request->getPaymentRequest(20, 'Sj', '458485747', 'user@gmail.com', strval(rand(100000, 999999)));
echo $result->redirectUrl();

redirect url to redirect your user to NBO payment page complete the payment after payment complete NBO will redirect to your callback url with payment details

License

The NBO Unified Checkout PHP SDK is released under the MIT License. See LICENSE file for more details.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-03-07