定制 emmanuel-obua/payment-integrator 二次开发

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

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

emmanuel-obua/payment-integrator

Composer 安装命令:

composer require emmanuel-obua/payment-integrator

包简介

Integrate online payments from different service providors

README 文档

README

Available providers

Index Provider
1 FlutterWave

Usage for FlutterWave provider

Collect payment

use BlackJew\Payments\Gateway;

$gateway = Gateway::create('FlutterWave');

$gateway->loadClient()->setProvider()->setToken('passin secondary api key for flutterwave');

/*Collect payments*/

$request = [
	"tx_ref" 			=> "hooli-tx-1920bbtytty",
	"amount" 			=> "100",
	"currency" 			=> "UGX",
	"redirect_url" 		=> "https://webhook.site/9d0b00ba-9a69-44fa-a43d-a82c33c36fdc",
	"payment_options" 	=> "mobilemoneyuganda",
	"meta" => [
		"consumer_id" 	=> 23,
		"consumer_mac" 	=> "92a3-912ba-1192a"
	],
	"customer" => [
		"email" 		=> "user@gmail.com",
		"phonenumber" 	=> "080****4528",
		"name" 			=> "Yemi Desola"
	],
	"customizations" => [
		"title" 			=> "Your company's Payments",
		"description" 	=> "Middleout isn't free. Pay the price",
		"logo" 			=> "https://assets.piedpiper.com/logo.png"
	]
];

// This returns a checkout link to complete payments

$response = $gateway->collect($request);

print_r($response);

if ($response->status == true) {
	header('location:'.$response->link);
} else {
	return;
}

/*After this verify transaction ...*/

Transfer payment

use BlackJew\Payments\Gateway;

$gateway = Gateway::create('FlutterWave');

$gateway->loadClient()->setProvider()->setToken('passin secondary api key for flutterwave');

/*Transfer payments*/

$request = [
	"account_bank" 		=> "MPS",
	"account_number" 	=> "2567XXXXXXXX",
	"amount" 			=> 5500,
	"narration" 		=> "UG MOMO",
	"currency" 			=> "UGX",
	"reference" 		=> "ugx-momo-transfer",
	"beneficiary_name" 	=> "Emmanuel Obua"
];

// This returns a checkout link to complete payments

$response = $gateway->transfer($request);

print_r($response);

/**
 * Response will look like below
 */

{
	"status": "success",
	"message": "Transfer Queued Successfully",
	"data": {
		"id": 127894,
		"account_number": "2567XXXXXXXX",
		"bank_code": "MPS",
		"full_name": "Emmanuel Obua",
		"created_at": "2020-06-25T14:39:16.000Z",
		"currency": "UGX",
		"amount": 5500,
		"fee": 500,
		"status": "NEW",
		"reference": "ugx-momo-transfer",
		"meta": null,
		"narration": "UGX momo transfer",
		"complete_message": "",
		"requires_approval": 0,
		"is_approved": 1,
		"bank_name": "FA-BANK"
	}
}

/*After this, verify transaction ...*/

Transaction verification

/**
 * After payment processing on the flutterwave UI, 
 * a callback is sent back to the callback uri preset in flutterwave dashboard.
 * 1. Get the tx_ref from the callback response object.
 * 2. Verify the transaction from the callback before updating your backend
 * 3. Update the affected tables with the confirmed transaction.
*/

$transactionId = $callback_response->tx_ref;

$response = $gateway->verifyTransaction($transactionId);

print_r($response);

/**
 * Transaction verification response will look like below
 */

{
	"status": "success",
	"message": "Transaction fetched successfully",
	"data": {
		"id": 1163068,
		"tx_ref": "akhlm-pstmn-blkchrge-xx6",
		"flw_ref": "FLW-M03K-02c21a8095c7e064b8b9714db834080b",
		"device_fingerprint": "N/A",
		"amount": 3000,
		"currency": "NGN",
		"charged_amount": 3000,
		"app_fee": 1000,
		"merchant_fee": 0,
		"processor_response": "Approved",
		"auth_model": "noauth",
		"ip": "pstmn",
		"narration": "Kendrick Graham",
		"status": "successful",
		"payment_type": "card",
		"created_at": "2020-03-11T19:22:07.000Z",
		"account_id": 73362,
		"amount_settled": 2000,
		"customer": {
			"id": 252759,
			"name": "Kendrick Graham",
			"phone_number": "0813XXXXXXX",
			"email": "user@example.com",
			"created_at": "2020-01-15T13:26:24.000Z"
		}
	}
}

emmanuel-obua/payment-integrator 适用场景与选型建议

emmanuel-obua/payment-integrator 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 913 次下载、GitHub Stars 达 1, 最近一次更新时间为 2021 年 06 月 06 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 emmanuel-obua/payment-integrator 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 emmanuel-obua/payment-integrator 我们能提供哪些服务?
定制开发 / 二次开发

基于 emmanuel-obua/payment-integrator 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-06-06