此包已废弃且不再维护。作者建议使用clippings/omnipay-emp包。

eMerchantPay (EMP)的支付 https://www.emerchantpay.com/

0.1.11 2014-10-02 09:13 UTC

This package is not auto-updated.

Last update: 2022-02-01 12:26:50 UTC


README

Build Status Scrutinizer Quality Score Code Coverage Latest Stable Version

这是一个访问eMerchantPay服务的API

快速示例

use OpenBuildings\Emp\Api;

$api = new Api('https://my.emerchantpay.com', CLIENT_ID, API_KEY);

$response = $api->request('/service/order/submit', array(
	'payment_type' => 'creditcard',
	'test_transaction' => 1,
));

print_r($response);

使用静态实例

您通常希望将此API配置一次,然后在整个应用中使用该配置。为此,您可以使用configure / instance静态方法

use OpenBuildings\Emp\Api;

Api::configure('https://my.emerchantpay.com', CLIENT_ID, API_KEY);

// ...

Api::instance();

威胁矩阵

要启用威胁矩阵安全,您需要使用Threatmatrix类。首先在显示请求表单的页面中(在API请求之前)您需要添加以下内容

use OpenBuildings\Emp\Api;

$thm = new Threatmatrix(ORG_ID, CLIENT_ID);

// Save the current Threatmatrix in the session
Session::set('thm', $thm);

// Use this somewhere in your views
echo $thm->tracking_code();

之后,要执行API请求,将thm添加到API实例中,如下所示

use OpenBuildings\Emp\Api;

$api = new Api('https://my.emerchantpay.com', CLIENT_ID, API_KEY);
$thm = Session::get('thm');

$response = $api
	->threatmatrix($thm)
	->request('/service/order/submit', array(
		'payment_type' => 'creditcard',
		'test_transaction' => 1,
	));

print_r($response);

许可证

版权(c)2012-2013,OpenBuildings Ltd。由Ivan Kerin在clippings.com项目中开发。

在BSD-3-Clause许可证下,请参阅LICENSE文件。