Skip to content

modulargaming/payment

Repository files navigation

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.

About

Payment module for Modular Gaming.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages