modulargaming/payment

Modular Gaming 的支付模块

安装: 24

依赖者: 0

推荐者: 0

安全: 0

星标: 1

关注者: 6

分支: 0

类型:modulargaming-module

v0.2 2014-08-01 12:51 UTC

This package is not auto-updated.

Last update: 2024-09-23 14:44:14 UTC


README

Payment 是 Modular Gaming 的一个模块,Modular Gaming 是一个模块化的 持久浏览器游戏 框架。

它增加了对在 Modular Gaming 中处理支付的支持,使用 Omnipay 库

支持的网关

  • PayPal Express Checkout
  • PayPal Recurring Payments (Express Checkout)

要求

  • PHP 5.3.3+
  • MySQL
  • Composer (依赖管理器)

安装

Payment 通过 composer 安装,只需将其添加为 composer.json 文件中的依赖项

{
	"require": {
		"modulargaming/payment": "~0.1.0"
	}
}

奖励

注意:奖励仅适用于常规支付,不适用于周期性支付。

奖励系统是基于驱动的,这允许您为单个包定义多个奖励。目前仅支持积分,但实现自己的驱动非常简单。

class Payment_Reward_Type extends Payment_Reward {

	private $_reward;

	public function __construct($reward)
	{
		$this->_reward = $reward;
	}

	public function reward(Model_User $user)
	{
		// TODO: Write the reward code.
	}

}

payment_packages 表中奖励行的示例结构

{
   "Points": 200
}

这将给买家200积分。

有关示例,请查看当前驱动,Payment/Reward。