ovri/payment 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

ovri/payment

Composer 安装命令:

composer require ovri/payment

包简介

Composer Library for payment gateway Ovri.com / Ovri.app

README 文档

README

OVRI is a payment solution powered by the Fintech IPS INTERNATIONAL available at : [https://www.ovri.com/]. This library is a PHP Client for the OVRI API. It allows you to initiate a payment via Ovri credit card solution.

Installation

Official installation method is via composer and its packagist package ovri/payment.

$ composer require ovri/payment

Usage

The simplest usage of the library would be as follow:

<?php

require_once __DIR__ . '/vendor/autoload.php';

$Ovri = new Ovri\Payment([
	'MerchantKey' => '<your-merchant-key>',
	'SecretKey' => '<your-secret-key>',
	'API' => 'https://api.ovri.app'
]);

$data = [
	'amount' => '<amount-transaction>',
	'RefOrder' => '<your-reference-order-id>',
	'Customer_Email' => '<customer-email>',
	'Customer_Name' => '<customer-lastname>',
	'Customer_FirstName' => '<customer-firstname>'
];

$reponse = $Ovri->initializePayment($data);
//201 success request (others code = failed)
if ($reponse['http'] === 201) {
	//Code is internal Ovri coding (200 success others is failed)
	if ($reponse['Code'] === 200) {
		//Either you redirect the customer to the WEB payment url
		header('Location: ' . $reponse['DirectLinkIs']);
		//Or you just get the token to initiate one of our JS SDK libraries
		//@token is $reponse['SACS']
	}
} else {
	//Error and display result
	foreach ($reponse as $key => $value) {
		//If key Explanation or MissingParameters array for explain error
		if ($key === 'Explanation' || $key === 'MissingParameters') {
			echo "<b>$key</b> =>  " . print_r($value, TRUE) . "<br>";
		} else {
			echo "<b>$key</b> =>  $value <br>";
		}
	}
}

To set up another type of payment, like a recurring payment, in several times or other see the api documentation to know which parameter can be inserted in $data[].

Optional : You can verify the status of the payment to see if the payment is done.

<?php

require_once __DIR__ . '/vendor/autoload.php';

$Ovri = new Ovri\Payment([
'MerchantKey' => '<your-merchant-key>',
'SecretKey' => '<your-secret-key>',
'API' => 'https://api.ovri.app'
]);

$data = [
	'MerchantOrderId' => '<your-reference-order-id>'
];

$reponse = $Ovri->getStatusPayment($data); 
if ($reponse['http'] === 201) {
	//Display All transaction information (success)
	echo '<h1>Success request</h1>';
	echo '<pre>' . print_r($reponse, true) . '</pre>';
} else {
	//Display Failed message
	echo '<h1>Failed request</h1>';
	echo '<pre>' . print_r($reponse, true) . '</pre>';
}

Instant payment notification (IPN)

If you want you can dynamically configure a URL that Ovri will call automatically at the end of the payment to notify your server of the result of the transaction.

All you have to do is add a parameter when initiating the payment.

With the above example the payment parameters were :

$data = [
	'amount' => '<amount-transaction>',
	'RefOrder' => '<your-reference-order-id>',
	'Customer_Email' => '<customer-email>
];

By adding the notification url it would become :

$data = [
	'amount' => '<amount-transaction>',
	'RefOrder' => '<your-reference-order-id>',
	'Customer_Email' => '<customer-email>,
	'urlIPN' => '<votre-url-de-notification>'
];

Please note that the minimum required parameters are : amount,RefOrder,Customer_Email,Customer_Name,Customer_FirstName

ovri/payment 适用场景与选型建议

ovri/payment 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 38 次下载、GitHub Stars 达 0, 最近一次更新时间为 2022 年 10 月 25 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「payment」 「gateway」 「Bank」 「Banking」 「credit card」 「processor」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

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

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

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-10-25