public function get_launch_url(VO\LicenseIDArray $license_id_array, VO\MemberID $member_id, VO\StringVO $callback_url) { $request = new Request(new GuzzleClient(), $this->credentials, VO\HTTP\Url::fromNative($this->base_url . '/purchase/launch_url/get'), new VO\HTTP\Method('POST')); $request_parameters = array('license_ids' => $license_id_array->__toArray(), 'member_id' => $member_id->__toString(), 'callback_url' => $callback_url->__toString()); $response = $request->send($request_parameters); $data = $response->get_data(); return $data->launch_url; }
public function create_offline_enrolment(VO\MemberID $member_id, VO\CourseId $course_id, VO\StringVO $file_name, VO\Integer $hrs, VO\Integer $mins, VO\Integer $sec, VO\StringVO $issued_at, VO\StringVO $expire_at, VO\Flag $send_email = null) { $request = new Request(new GuzzleClient(), $this->credentials, VO\HTTP\Url::fromNative($this->base_url . '/enrolment/offline/create'), new VO\HTTP\Method('POST')); $request_parameters = array('member_id' => $member_id->__toString(), 'course_id' => $course_id->__toString(), 'file' => $file_name->__toString(), 'hrs' => $hrs->__toInteger(), 'mins' => $mins->__toInteger(), 'sec' => $sec->__toInteger(), 'expire_at' => $expire_at->__toString(), 'issued_at' => $issued_at->__toString()); if ($send_email) { $request_parameters['send_email'] = $send_email->__toBool(); } $response = $request->send($request_parameters); $data = $response->get_data(); return $data->enrolment_id; }
public function __construct($value) { if (!in_array(strtoupper($value), $this->allowed_methods)) { throw new MethodNotAllowedException($value, $this->allowed_methods); } parent::__construct($value); }
/** * Returns a Hostname * * @param string $value */ public function __construct($value) { $validator = new Hostname(array('allow' => Hostname::ALLOW_DNS | Hostname::ALLOW_LOCAL)); if (false === $validator->isValid($value)) { throw new InvalidValueObjectsArgumentException($value, 'Hostname'); } parent::__construct($value); }