Exemple #1
0
    }

    if ($method == "query") {
       $payload = "<ns1:query><ns1:queryString>" . htmlspecialchars($body) . "</ns1:queryString></ns1:query>";
    } else {
       $payload = $body;
    }

    $callOptions = array();
    if (isset($_POST['api-singleTxn'])) {
        $callOptions = array("useSingleTransaction"=>$_POST['api-singleTxn']);
    }

    if ($method == "query" || $method == "api") {
       	try {
       	    $client = createClient($wsdl, $debug);
            $client->setLocation($_SESSION['service_url']);
       	    $locationString = $client->myLocation;
       	    $header = ZuoraAPIHelper::getHeader('');
            if (!$_SESSION['sessionId-refresh']) {
                $header->data["session"] = $_SESSION['sessionId'];
            } else {
                $header = ZuoraAPIHelper::login($client, $username, $password, $debug);
                if ($header->data["session"] == NULL) {
                    throw new Exception("Null session received, please check your username or password.");
                }
                //$_SESSION['sessionId-refresh'] = false;
                $_SESSION['sessionStartTime'] = microtime(true);
                $_SESSION['sessionId'] = $header->data["session"];
            }
            
<?php

require_once './google-api-php-client/src/Google_Client.php';
require_once './google-api-php-client/src/contrib/Google_CalendarService.php';
require_once __DIR__ . '/../apiAccess.php';
require_once './functins_google_api.php';
require_once './Presenter.php';
require_once './Logic.php';
require_once './Router.php';
session_start();
$client = createClient();
if (!authenticate($client)) {
    return;
}
$logic = new Logic($client);
$presenter = new Presenter($logic);
(new Router($presenter))->doUserAction();
//listAllCalendars($client);
Exemple #3
0
 /**
  * @Then /^they can retrieve that invoice$/
  */
 public function theyCanRetrieveThatInvoice()
 {
     try {
         $network = $this->network;
         $client = createClient($network);
         $response = $client->getInvoice($this->invoiceId);
     } catch (Exception $e) {
         var_dump($e->getMessage());
     }
     $responseInvoiceId = $response->getId();
     if ($responseInvoiceId !== $this->invoiceId) {
         throw new Exception("Invoice ids don't match");
     }
 }
{
    $buckets = $client->listBuckets();
    foreach ($buckets as $bucket) {
        echo 'Bucket: ' . $bucket->getName() . "\n";
    }
}
// Sample of create Bucket
function createBucket(OSSClient $client, $bucket)
{
    $client->createBucket(array('Bucket' => $bucket));
}
// Sample of get Bucket Acl
function getBucketAcl(OSSClient $client, $bucket)
{
    $acl = $client->getBucketAcl(array('Bucket' => $bucket));
    $grants = $acl->getGrants();
    echo $grants[0];
}
// Sample of delete Bucket
function deleteBucket(OSSClient $client, $bucket)
{
    $client->deleteBucket(array('Bucket' => $bucket));
}
$keyId = 'your-access-key-id';
$keySecret = 'your-access-key-secret';
$client = createClient($keyId, $keySecret);
$bucket = 'your-bucket-name';
listBuckets($client);
createBucket($client, $bucket);
getBucketAcl($client, $bucket);
deleteBucket($client, $bucket);
/**
 * Retrieves the endpoint for the specific service and accountID using the
 * EWS LocationService.
 * The steps to obtain a location are:
 * i)  If location is present in the ACCOUNT_LOCATION_CACHE, return it.
 * ii) If not present in ACCOUNT_LOCATION_CACHE, call location service to
 *     fetch the location. Store the location in the cache file
 *     and ACCOUNT_LOCATION_CACHE before returning it.
 *
 * $serviceName - name of the service of the form Version/Name.
 *
 * $accountID   - accountID for which location is sought.
 */
function getEndPointFromLocationService($serviceName, $accountID)
{
    global $ACCOUNT_LOCATION_CACHE;
    $cachedAccountLocation = array_key_exists($accountID, $ACCOUNT_LOCATION_CACHE) ? $ACCOUNT_LOCATION_CACHE[$accountID] : NULL;
    if (!$cachedAccountLocation) {
        $client = createClient(EWS_VERSION . "/LocationService", NULL, false);
        if ($client) {
            $response = execute($client, "getMasterAccountLocation", NULL);
            if ($response) {
                $cachedAccountLocation = $response->out;
                persistAccountLocationCache($accountID, $cachedAccountLocation);
            }
        }
    }
    if (!$cachedAccountLocation) {
        trigger_error("Service Error: Failed to get account location from server: EWS_LOCATION_SERVICE_ENDPOINT", E_USER_ERROR);
    }
    return $cachedAccountLocation . "/" . $serviceName;
}
Exemple #6
0
<?php

include_once 'connect.php';
switch ($_GET["table"]) {
    case "client":
        createClient($_GET);
        break;
    case "clois":
        createColis($_GET);
        break;
    default:
        break;
}
function createClient($data)
{
    global $conn;
    $sql = "INSERT INTO client (Id) VALUES (" + $data["Id"] + ")";
    //echo $sql;
    if ($conn->query($sql) === TRUE) {
        echo "New record of type client created successfully";
    } else {
        echo "Error: " . $sql . "<br>" . $conn->error;
    }
}
function createColis($data)
{
    global $conn;
    $sql = "INSERT INTO colis (num, poid, adress) VALUES (" . $data["Num"] . ", " . $data["Poid"] . ", " . $data["Adress"] . ")";
    //echo $sql;
    if ($conn->query($sql) === TRUE) {
        echo "New record of type colis created successfully";
 function updateCampaignBudget($masterAccount, $clientAccount, $campaign)
 {
     $this->setUser($masterAccount, $clientAccount);
     $budgetingService = createClient(EWS_VERSION . "/BudgetingService", $clientAccount->accountId);
     $retObj = execute($budgetingService, 'updateCampaignDailySpendLimit', array('campaignID' => $campaign->campaignId, 'spendLimit' => array('limit' => $campaign->newBid)));
 }