コード例 #1
0
ファイル: index.php プロジェクト: rublon/rublon-sdk-php
 if (!empty($_GET['action']) and $_GET['action'] == 'logout') {
     // Logout action
     logout();
     redirect('index.php');
     exit;
 } else {
     if (!empty($_GET['action']) and $_GET['action'] == 'confirm') {
         // Rublon transaction confirmation
         include 'confirm.php';
     } else {
         if (!empty($_GET['action']) and $_GET['action'] == 'features') {
             try {
                 $client = new RublonAPIGetAvailableFeatures($rublon);
                 $client->perform();
                 echo '<pre>';
                 print_r($client->getFeatures());
             } catch (Exception $e) {
                 echo $e->getClient()->getRawRequestHeader();
                 echo $e->getClient()->getRawRequestBody();
                 echo $e->getClient()->getRawResponseHeader();
                 echo $e->getClient()->getRawResponseBody();
                 echo get_class($e);
                 echo $e->getMessage();
             }
             exit;
         } else {
             if (!empty($_GET['action']) and $_GET['action'] == 'notification' and !empty($_POST['url'])) {
                 try {
                     $client = new RublonAPINotification($rublon);
                     $client->initUrlNotification('Demo notification', $_POST['url']);
                     $client->perform();
コード例 #2
0
ファイル: RublonFeature.php プロジェクト: khanhnd91/khaosan
 /**
  * Get the features list from Rublon server.
  * 
  * @return NULL|array
  */
 static function getFeaturesFromServer()
 {
     if (!RublonHelper::isSiteRegistered()) {
         return null;
     }
     try {
         $client = new RublonAPIGetAvailableFeatures(RublonHelper::getRublon());
         $client->perform();
         return $client->getFeatures();
     } catch (RublonException $e) {
         return null;
     }
 }