-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathConfiguration.rb
131 lines (118 loc) · 4.71 KB
/
Configuration.rb
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
require 'cybersource_rest_client'
public
class MerchantConfiguration
def merchantConfigProp()
# Common Paramaters
merchantId='testrest'
runEnvironment='apitest.cybersource.com'
timeout=1000 #In Milliseconds
authenticationType='http_signature'
jsonFilePath='resource/request.json'
enableLog=true
loggingLevel='DEBUG'
logDirectory='log'
logFilename='cybs'
maxLogSize=10485760
maxLogFiles=5
enableMasking=true
# proxyAddress='userproxy.com'
# proxyPort=443
# HTTP Parameters
merchantKeyId='08c94330-f618-42a3-b09d-e1e43be5efda'
merchantSecretKey='yBJxy6LjM2TmcPGu+GaJrHtkke25fPpUX+UY6/L/1tE='
# JWT Parameters
keysDirectory='resource'
keyAlias='testrest'
keyPass='testrest'
keyFilename='testrest'
# MetaKey Params
useMetaKey = false
portfolioID = ''
# Add the property if required to override the cybs default developerId in all request body
defaultDeveloperId = ""
configurationDictionary={}
configurationDictionary['merchantID'] = merchantId
configurationDictionary['runEnvironment'] = runEnvironment
configurationDictionary['timeout'] = timeout
configurationDictionary['authenticationType'] = authenticationType
configurationDictionary['jsonFilePath'] = jsonFilePath
# configurationDictionary['proxyPort'] = proxyPort
# configurationDictionary['proxyAddress'] = proxyAddress
configurationDictionary['merchantsecretKey'] = merchantSecretKey
configurationDictionary['merchantKeyId'] = merchantKeyId
configurationDictionary['keysDirectory'] = keysDirectory
configurationDictionary['keyAlias'] = keyAlias
configurationDictionary['keyPass'] = keyPass
configurationDictionary['useMetaKey'] = useMetaKey
configurationDictionary['portfolioID'] = portfolioID
configurationDictionary['keyFilename'] = keyFilename
configurationDictionary['defaultDeveloperId'] = defaultDeveloperId
log_config = {}
log_config['enableLog'] = enableLog
log_config['loggingLevel'] = loggingLevel
log_config['logDirectory'] = logDirectory
log_config['logFilename'] = logFilename
log_config['maxLogSize'] = maxLogSize
log_config['maxLogFiles'] = maxLogFiles
log_config['enableMasking'] = enableMasking
configurationDictionary['logConfiguration'] = log_config
# PEM Key file path for decoding JWE Response Enter the folder path where the .pem file is located.
# It is optional property, require adding only during JWE decryption.
configurationDictionary['pemFileDirectory'] = 'resource/NetworkTokenCert.pem'
return configurationDictionary
end
def alternativeMerchantConfigProp()
# Common Paramaters
merchantId='testrest_cpctv'
runEnvironment='apitest.cybersource.com'
timeout=1000 #In Milliseconds
authenticationType='http_signature'
jsonFilePath='resource/request.json'
enableLog=true
loggingLevel='DEBUG'
logDirectory='log'
logFilename='cybs'
maxLogSize=10485760
maxLogFiles=5
enableMasking=true
# proxyAddress='userproxy.com'
# proxyPort=443
# HTTP Parameters
merchantKeyId='964f2ecc-96f0-4432-a742-db0b44e6a73a'
merchantSecretKey='zXKpCqMQPmOR/JRldSlkQUtvvIzOewUVqsUP0sBHpxQ='
# JWT Parameters
keysDirectory='resource'
keyAlias='testrest_cpctv'
keyPass='testrest_cpctv'
keyFilename='testrest_cpctv'
# MetaKey Params
useMetaKey = false
portfolioID = ''
configurationDictionary={}
configurationDictionary['merchantID'] = merchantId
configurationDictionary['runEnvironment'] = runEnvironment
configurationDictionary['timeout'] = timeout
configurationDictionary['authenticationType'] = authenticationType
# configurationDictionary['jsonFilePath'] = jsonFilePath
# configurationDictionary['proxyPort'] = proxyPort
# configurationDictionary['proxyAddress'] = proxyAddress
configurationDictionary['merchantsecretKey'] = merchantSecretKey
configurationDictionary['merchantKeyId'] = merchantKeyId
configurationDictionary['keysDirectory'] = keysDirectory
configurationDictionary['keyAlias'] = keyAlias
configurationDictionary['keyPass'] = keyPass
configurationDictionary['useMetaKey'] = useMetaKey
configurationDictionary['portfolioID'] = portfolioID
configurationDictionary['keyFilename'] = keyFilename
log_config = {}
log_config['enableLog'] = enableLog
log_config['loggingLevel'] = loggingLevel
log_config['logDirectory'] = logDirectory
log_config['logFilename'] = logFilename
log_config['maxLogSize'] = maxLogSize
log_config['maxLogFiles'] = maxLogFiles
log_config['enableMasking'] = enableMasking
configurationDictionary['logConfiguration'] = log_config
return configurationDictionary
end
end