src/BBGS/Credits.php
public function requestCredits ($credits, $description, $callback, $action = null, $return_url = null)
	{
		$this->isValidData ();

		$data = array ();

		if (isset ($this->email))
		{
			$data['email'] = $this->email;
		}

		if (count($this->openid_hashed) > 0)
		{
			$data['openidhash'] = $this->openid_hashed[0];
			$data['openid'] = $this->openids[0];
		}

		$data['amount'] = intval ($credits);
		$data['callback'] = $callback;
		$data['description'] = $description;

		if (isset ($action))
		{
			$data['tag'] = $action;
		}

		if (isset ($return_url))
		{
			$data['return'] = $return_url;
		}

		$data = array_merge
		(
			$this->data,
			$data
		);

		return $this->getSignedURL (self::PAYMENT_GATEWAY_URL.'approve/', $data);
	}
public function requestCredits ($credits, $description, $callback, $action = null, $return_url = null)
	{
		$this->isValidData ();

		$data = array ();

		if (isset ($this->email))
		{
			$data['email'] = $this->email;
		}

		if (count($this->openid_hashed) > 0)
		{
			$data['openidhash'] = $this->openid_hashed[0];
			$data['openid'] = $this->openids[0];
		}

		$data['amount'] = intval ($credits);
		$data['callback'] = $callback;
		$data['description'] = $description;

		if (isset ($action))
		{
			$data['tag'] = $action;
		}

		if (isset ($return_url))
		{
			$data['return'] = $return_url;
		}

		$data = array_merge
		(
			$this->data,
			$data
		);

		return $this->getSignedURL (self::PAYMENT_GATEWAY_URL.'approve/', $data);
	}
/*
Request the URL to approve a credit transfer

@param $credits: Amount of credits that will be requested
@param $description: Short description of the use of these credits
@param $callback: URL that will be contacted once the transfer is approved
@param $action: A short tag to group your transfers
@param $return_url: URL where the user will be redirected