modulargaming/payment

Payment module for Modular Gaming

Installs: 24

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 6

Forks: 0

Type:modulargaming-module

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

This package is not auto-updated.

Last update: 2024-04-08 12:43:54 UTC


README

Payment is a module for Modular Gaming, a modular persistent browser based game framework.

It adds support for processing payments within Modular Gaming, using the Omnipay Library.

Supported Gateways

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

Requirements

  • PHP 5.3.3+
  • MySQL
  • Composer (Dependency Manager)

Installation

Payment is installed using composer, simply add it as a dependency to your composer.json file:

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

Rewards

Note: Rewards are only for regular payments NOT Recurring.

The reward system is driver based, this allows you to define multiple rewards for a single package. Currently only Points are supported, however it is quite easy to implement your own driver.

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.
	}

}

Example structure for rewards row in payment_packages table

{
   "Points": 200
}

This will give the buyer 200 points.

For examples, check the current drivers, Payment/Reward.