Ejemplo n.º 1
0
 /**
  * @param $payload
  * @param $options
  *
  * @return mixed
  */
 public function Send($payload, $options = [])
 {
     $request = QuarkDTO::ForPOST(new QuarkJSONIOProcessor());
     $request->Header(QuarkDTO::HEADER_AUTHORIZATION, 'key=' . $this->_key);
     $request->Data(array('registration_ids' => $this->_devices, 'data' => $payload));
     $response = new QuarkDTO(new QuarkJSONIOProcessor());
     return QuarkHTTPTransportClient::To('https://android.googleapis.com/gcm/send', $request, $response);
 }
Ejemplo n.º 2
0
 /**
  * @param \Quark\Extensions\Payment\IQuarkPaymentScenario $data
  * @param string $url
  *
  * @return QuarkHTTPTransportClient
  */
 public function API($data, $url)
 {
     $request = QuarkDTO::ForPOST(new QuarkJSONIOProcessor());
     $request->Header(QuarkDTO::HEADER_AUTHORIZATION, $this->Authorization());
     $request->Data($data);
     $response = new QuarkDTO(new QuarkJSONIOProcessor());
     return QuarkHTTPTransportClient::To($url, $request, $response);
 }