예제 #1
0
 /**
  * Test executing requests to Beepsend API
  */
 public function testExecute()
 {
     $connector = \Mockery::mock(new Curl());
     $connector->shouldReceive('call')->withAnyArgs()->once()->andReturn(array('info' => array('http_code' => 200, 'Content-Type' => 'application/json'), 'response' => json_encode(array('msg' => 'Welcome to Beepsend!'))));
     $request = new Request('SomeSecretToken', $connector);
     $response = $request->execute('/');
     $this->assertEquals('Welcome to Beepsend!', $response['msg']);
 }
예제 #2
0
 /**
  * Search for groups
  * @param string $query Will search entries with matching name
  * @return array
  */
 public function groups($query)
 {
     $data = array('query' => $query);
     $response = $this->request->execute($this->actions['groups'], 'GET', $data);
     return $response;
 }
예제 #3
0
 /**
  * Delete contact group
  * @param int $groupId
  * @return array
  */
 public function deleteGroup($groupId)
 {
     $response = $this->request->execute($this->actions['groups'] . $groupId, 'DELETE');
     return $response;
 }
예제 #4
0
 /**
  * Recive list of recipient numbers which can receive mobile originated messages
  * @return array
  */
 public function recipientNumbers()
 {
     $response = $this->request->execute($this->actions['numbers'], 'GET');
     return $response;
 }
예제 #5
0
 /**
  * Compare pricelist revisions from given connection and return their diff.
  * @param int $revision1
  * @param int $revision2
  * @param mixed $connection
  * @return array
  */
 public function diff($revision1, $revision2, $connection)
 {
     $response = $this->request->execute($this->actions['pricelists'] . $connection . '/' . $revision1 . '..' . $revision2 . $this->actions['diff']);
     return $response;
 }
예제 #6
0
 /**
  * Get customer data
  * @return array
  */
 public function get()
 {
     $response = $this->request->execute($this->actions['data'], 'GET');
     return $response;
 }
예제 #7
0
 /**
  * Delete external email for notifications to wallet.
  * @param int $walletId Wallet id
  * @param int $emailId Email id
  * @return array
  */
 public function deleteNotificationEmail($walletId, $emailId)
 {
     $response = $this->request->execute($this->actions['wallets'] . $walletId . $this->actions['notifications'] . $emailId, 'DELETE');
     return $response;
 }
예제 #8
0
파일: Hlr.php 프로젝트: kanzie/beepsend-php
 /**
  * Validate HLR request
  * @param int $msisdn Msisdn that we are looking HLR request
  * @param string $connection Connection id
  * @return array
  */
 public function validate($msisdn, $connection = 'me')
 {
     $response = $this->request->execute($this->actions['validate'], 'POST', array('msisdn' => $msisdn, 'connection' => $connection));
     return $response;
 }
예제 #9
0
 /**
  * After changing your phone number. An SMS will be sent out asking you to verify the change. Use the unique hash to verify.
  * @param string $hash
  * @return array
  */
 public function verifyPhone($hash)
 {
     $response = $this->request->execute($this->actions['users'] . $this->actions['phone'] . '/' . $hash, 'GET');
     return $response;
 }
예제 #10
0
 /**
  * List all messages sent back and forth in to a single contact/number.
  * @param string $id
  * @return array
  */
 public function fullConversation($id, $options = array())
 {
     $response = $this->request->execute($this->actions['conversations'] . $id, 'GET', $options);
     return $response;
 }