-
Notifications
You must be signed in to change notification settings - Fork 52
Expand file tree
/
Copy pathConfiguration.php
More file actions
57 lines (53 loc) · 2.53 KB
/
Copy pathConfiguration.php
File metadata and controls
57 lines (53 loc) · 2.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<?php
/*
* Purpose : passing merchant config object to the configuration
*/
require_once 'autoload.php';
require_once __DIR__ . DIRECTORY_SEPARATOR . '../vendor/cybersource/rest-client-php/lib/Authentication/Core/MerchantConfiguration.php';
class Configuration
{
//initialize variable on constructor
function __construct()
{
$this->authType = "http_signature";
$this->enableLog = true;
$this->logSize = "1048576";
$this->logFile = "Log";
$this->logFilename = "Cybs.log";
$this->merchantID = "testrest";
$this->apiKeyID = "08c94330-f618-42a3-b09d-e1e43be5efda";
$this->screteKey = "yBJxy6LjM2TmcPGu+GaJrHtkke25fPpUX+UY6/L/1tE=";
//$this->proxyUrl = "https.proxy.url";
//$this->proxyHost = "443";
$this->keyAlias = "testrest";
$this->keyPass = "testrest";
$this->keyFilename = "testrest";
$this->keyDirectory = "Resources/";
$this->runEnv = "apitest.cybersource.com";
$this->merchantConfigObject();
}
//creating merchant config object
function merchantConfigObject()
{
$config = new CyberSource\Authentication\Core\MerchantConfiguration();
if(is_bool($this->enableLog))
$confiData = $config->setDebug($this->enableLog);
$confiData = $config->setLogSize(trim($this->logSize));
$confiData = $config->setDebugFile(trim($this->logFile));
$confiData = $config->setLogFileName(trim($this->logFilename));
$confiData = $config->setAuthenticationType(strtoupper(trim($this->authType)));
$confiData = $config->setMerchantID(trim($this->merchantID));
$confiData = $config->setApiKeyID($this->apiKeyID);
$confiData = $config->setSecreteKey($this->screteKey);
//$confiData = $config->setCurlProxyHost($this->proxyUrl);
//$confiData = $config->setCurlProxyPort($this->proxyHost);
$confiData = $config->setKeyFileName(trim($this->keyFilename));
$confiData = $config->setKeyAlias($this->keyAlias);
$confiData = $config->setKeyPassword($this->keyPass);
$confiData = $config->setKeysDirectory($this->keyDirectory);
$confiData = $config->setRunEnvironment($this->runEnv);
$config->validateMerchantData($confiData);
return $config;
}
}
?>