コード例 #1
0
 public function getWebhookConfiguration()
 {
     $url = $this->getUrl() . WebhookConfiguration::$WEBHOOK_LINK;
     $request = $this->setHeadersGet($url, $this->_oauthToken);
     $result = $this->doGet($request);
     if (array_key_exists('errors', $result)) {
         $errors_tmp = new Errors();
         foreach ($result as $errorData) {
             $errors_tmp = Errors::fromArray($errorData);
         }
         $errors[] = $errors_tmp;
         return $errors;
     } else {
         $response_tmp = WebhookConfiguration::fromArray($result['webhookConfiguration']);
         return $response_tmp;
     }
 }
コード例 #2
0
<?php

/**
 * Created by PhpStorm.
 * User: agustin
 * Date: 27/07/2015
 * Time: 12:34
 */
$path_to_IncludeClases = "../com/payhub/ws/extra/includeClasses.php";
include_once $path_to_IncludeClases;
//Defining the Web Service URL
$WsURL = "https://sandbox-api.payhub.com/api/v2/";
$oauth_token = "2a5d6a73-d294-4fba-bfba-957a4948d4a3";
//Defining data for the SALE transaction
// Merchant data (obtained from the payHub Virtual Terminal (3rd party integration)
$merchant = new Merchant();
$merchant->setOrganizationId(10074);
$merchant->setTerminalId(134);
$transaction = new TransactionManager($merchant, $WsURL, $oauth_token);
$wh = new WebhookConfiguration();
$wh->setMobileHub(false);
$wh->setBatchIsActive(false);
$result = $transaction->patchWebhookConfiguration($wh);
if (is_array($result)) {
    var_dump($result);
} else {
    $result = $transaction->getWebhookConfiguration();
    var_dump($result);
}