imzers/truemoney-wallet-php

TrueMoney Wallet PHP SDK 用于 REST API

dev-master 2019-08-07 08:29 UTC

This package is auto-updated.

Last update: 2024-09-29 05:09:30 UTC


README

描述

Truemoney Wallet 是一个在线支付网关。我们努力让商家和客户都能轻松地进行支付。使用此插件,您可以在您的应用程序或网站上通过 TrueMoney Wallet 支付网关接受在线支付。此模块包含库,您可以使用它来

  • 创建支付
  • 转账余额
  • 撤销支付(即将推出)
  • 检查支付状态

最低要求

  • PHP 版本 5.4.x 或更高

如何使用示例

要使用此插件上的示例,首先您需要 Truemoney Wallet 提供的 client_id、client_secret、client_token、client_shopcode 和 client_appname,请访问 http://www.truemoney.com/partner/ 或联系 partner@truemoney.com

设置 API 凭证

请检查从第 35 行开始的文件 config.php,并将所有 API 凭证放入其中

$ClientConfig = array(
	'sandbox'		=> array(
			'client_id' 		=> 'TMN_CLIENT_ID', // You will get this from TMN-Wallet, Please contact TrueMoney
			'client_secret' 	=> 'TMN_CLIENT_SECRET', // You will get this from TMN-Wallet, Please contact TrueMoney
			'client_token' 		=> 'TMN_CLIENT_TOKEN', // You will get this from TMN-Wallet, Please contact TrueMoney
			'client_shopcode'	=> 'TMN_CLIENT_SHOPCODE', // You will get this from TMN-Wallet, Please contact TrueMoney
			'client_appname'	=> 'TMN_CLIENT_APPNAME', // You will get this from TMN-Wallet, Please contact TrueMoney
	),
	'live'			=> array(
			'client_id' 		=> 'TMN_LIVE_CLIENT_ID', // You will get this from TMN-Wallet, Please contact TrueMoney
			'client_secret' 	=> 'TMN_LIVE_CLIENT_SECRET', // You will get this from TMN-Wallet, Please contact TrueMoney
			'client_token' 		=> 'TMN_LIVE_CLIENT_TOKEN', // You will get this from TMN-Wallet, Please contact TrueMoney
			'client_shopcode'	=> 'TMN_LIVE_CLIENT_SHOPCODE', // You will get this from TMN-Wallet, Please contact TrueMoney
			'client_appname'	=> 'TMN_LIVE_CLIENT_APPNAME', // You will get this from TMN-Wallet, Please contact TrueMoney
	),
);

还要检查从第 4 行开始的文件 constant.php

	static public $THIS_SERVER_MODE = 'sandbox'; // 'sandbox' || 'live'

设置您想要的 环境(沙盒或生产)

安装

  1. 打开终端/控制台窗口。
  2. 更改目录到服务器根目录和此脚本的路径(例如,如果您本地服务器的根目录是 /var/www,则输入 cd /var/www/truemoney-wallet-php-master)。
  3. 安装依赖项(composer install)。
  4. 在浏览器中访问插件示例支付(可能位于 https:///truemoney-wallet-php-master/sample/01-create-payment.php)并提交支付。

注意

  • 请注意:要在沙盒模式(测试服务器环境)中测试支付,您应该在曼谷办公时间(周一至周五,上午 9:00 至下午 5:00)进行,因为 Truemoney Wallet 会关闭测试服务器服务,包括周末和节假日。

有关 TrueMoney Wallet 的更多信息,请访问 TrueMoney 网站

演示