src/BBGS/Credits.php
public function convert ($amount)
	{
		$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'] = $amount;

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

		$url = $this->getSignedURL (self::PAYMENT_GATEWAY_URL.'convert/', $data);

		$data = $this->file_get_contents ($url);
		if ($data !== false)
		{
			return json_decode ($data, true);
		}

		return $amount;
	}
public function convert ($amount)
	{
		$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'] = $amount;

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

		$url = $this->getSignedURL (self::PAYMENT_GATEWAY_URL.'convert/', $data);

		$data = $this->file_get_contents ($url);
		if ($data !== false)
		{
			return json_decode ($data, true);
		}

		return $amount;
	}
public function convert ( $ amount ) { $ 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' ] = $ amount ; $ data = array_merge ( $ this -> data , $ data ) ; $ url = $ this -> getSignedURL ( self :: PAYMENT_GATEWAY_URL . 'convert/' , $ data ) ; $ data = $ this -> file_get_contents ( $ url ) ; if ( $ data !== false ) { return json_decode ( $ data , true ) ; } return $ amount ; }
/*
Convert credits into "proper credits"
(use this to display)
/ * Convert credits into proper credits ( use this to display )