* 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);
//$result = $transaction->getRiskFraudSettings();
//var_dump($result);
$risk = new RiskFraudSettings();
$trnVolSet = new TrnVolSet();
$trnVolSet->setChecked(false);
$optionAndValue = new OptionAndValue();
$optionAndValue->setOption(2);
$optionAndValue->setValue(5000);
$trnVolSet->setDaysTrnAmountMoreThan($optionAndValue);
$risk->setTransactionVolumeSettings($trnVolSet);
$result = $transaction->patchRiskFraudSettings($risk);
if (is_array($result)) {
    var_dump($result);
} else {
    $result = $transaction->getRiskFraudSettings();
    var_dump($result);
}
 public static function fromArray($data)
 {
     $rf = new RiskFraudSettings();
     foreach ($data as $key => $value) {
         if ($key == "transaction_volume_settings") {
             $rf->{$key} = TrnVolSet::fromArray($value);
         }
         if ($key == "card_filtering") {
             $rf->{$key} = CardFiltering::fromArray($value);
         }
         if ($key == "email") {
             $rf->{$key} = RiskEmail::fromArray($value);
         }
         if ($key == "credit_card_security_codes") {
             $rf->{$key} = CreditCardSecurityCodes::fromArray($value);
         }
         if ($key == "address_verification_system") {
             $rf->{$key} = Avs::fromArray($value);
         }
     }
     return $rf;
 }