/** * Create a new bill under a given pre-authorization * * @param array $params Must include pre_authorization_id and amount * * @return string The new bill object */ public function create_bill($params) { if (!isset($params['pre_authorization_id'])) { throw new GoCardless_ArgumentsException('pre_authorization_id missing'); } $pre_auth = new GoCardless_PreAuthorization($this, array('id' => $params['pre_authorization_id'])); return $pre_auth->create_bill(array('amount' => $params['amount'])); }
/** * Create a new bill under a given pre-authorization * * @param array $attrs Must include pre_authorization_id and amount * * @return string The new bill object */ public function create_bill($attrs) { if (!isset($this->account_details['access_token'])) { throw new GoCardless_ClientException('Access token missing'); } if (!isset($attrs['pre_authorization_id'])) { throw new GoCardless_ArgumentsException('pre_authorization_id missing'); } $pre_auth_attrs = array('id' => $attrs['pre_authorization_id']); $pre_auth = new GoCardless_PreAuthorization($this, $pre_auth_attrs); return $pre_auth->create_bill($attrs); }