Exemplo n.º 1
0
 public function testMessage()
 {
     $str_client = 'test';
     $str_api_key = '123test';
     $str_event = 'service_message';
     $str_title = "Hello";
     $str_body = "From 1885";
     $str_from = "ELB";
     $obj_client = new \Venditan\Rapport\Client($str_client, $str_api_key);
     $obj_client->addMessage()->title($str_title)->body($str_body)->from($str_from);
     $obj_data = $obj_client->event($str_event)->compile();
     $this->assertEquals((object) ['client' => $str_client, 'key' => $str_api_key, 'type' => $str_event, 'message' => (object) ['title' => $str_title, 'body' => $str_body, 'from' => $str_from]], $obj_data);
 }
Exemplo n.º 2
0
<?php

/**
 * Order placed example
 */
require __DIR__ . '/../vendor/autoload.php';
$obj_client = new \Venditan\Rapport\Client('test', 'api-key-goes-here-121gw');
$obj_client->addUser()->id('1955')->name('Marty')->email('*****@*****.**')->mobile('07019551985');
$obj_client->addTransaction()->id('2015');
$obj_client->event('order_placed')->send();
Exemplo n.º 3
0
<?php

/**
 * Service message example
 */
require __DIR__ . '/../vendor/autoload.php';
$obj_client = new \Venditan\Rapport\Client('test', 'api-key-goes-here-121gw');
$obj_client->addMessage()->title('Order Update')->body('Hi Marty. I have your order ready to ship.')->from('Emmett');
$obj_client->event('service_message')->send();
Exemplo n.º 4
0
<?php

/**
 * Get a transaction thread
 */
require __DIR__ . '/../vendor/autoload.php';
$obj_client = new \Venditan\Rapport\Client('test', 'api-key-goes-here-121gw');
$obj_thread = $obj_client->getThreadForTransaction('abc123');