コード例 #1
0
 * 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);
}
コード例 #2
0
 public static function fromArray($data)
 {
     $trn_tmp = new Avs();
     foreach ($data as $key => $value) {
         if (property_exists(get_class($trn_tmp), $key)) {
             if ($key == "checked") {
                 $trn_tmp->{$key} = $value;
             } else {
                 $trn_tmp->{$key} = OptionAndValue::fromArray($value);
             }
         }
     }
     return $trn_tmp;
 }