Class: UnionPei::SDKConfig
- Inherits:
-
Object
- Object
- UnionPei::SDKConfig
- Includes:
- Singleton
- Defined in:
- lib/unionpei/sdk_config.rb
Instance Attribute Summary collapse
-
#appTransUrl ⇒ Object
readonly
Returns the value of attribute appTransUrl.
-
#backTransUrl ⇒ Object
readonly
Returns the value of attribute backTransUrl.
-
#backUrl ⇒ Object
readonly
Returns the value of attribute backUrl.
-
#batchTransUrl ⇒ Object
readonly
Returns the value of attribute batchTransUrl.
-
#cardTransUrl ⇒ Object
readonly
Returns the value of attribute cardTransUrl.
-
#encoding ⇒ Object
readonly
Returns the value of attribute encoding.
-
#encryptCertPath ⇒ Object
readonly
Returns the value of attribute encryptCertPath.
-
#fileTransUrl ⇒ Object
readonly
Returns the value of attribute fileTransUrl.
-
#frontTransUrl ⇒ Object
readonly
Returns the value of attribute frontTransUrl.
-
#frontUrl ⇒ Object
readonly
Returns the value of attribute frontUrl.
-
#ifValidateCNName ⇒ Object
readonly
Returns the value of attribute ifValidateCNName.
-
#ifValidateRemoteCert ⇒ Object
readonly
Returns the value of attribute ifValidateRemoteCert.
-
#jfAppTransUrl ⇒ Object
readonly
Returns the value of attribute jfAppTransUrl.
-
#jfBackTransUrl ⇒ Object
readonly
Returns the value of attribute jfBackTransUrl.
-
#jfCardTransUrl ⇒ Object
readonly
Returns the value of attribute jfCardTransUrl.
-
#jfFrontTransUrl ⇒ Object
readonly
Returns the value of attribute jfFrontTransUrl.
-
#jfSingleQueryUrl ⇒ Object
readonly
Returns the value of attribute jfSingleQueryUrl.
-
#logFilePath ⇒ Object
readonly
Returns the value of attribute logFilePath.
-
#logLevel ⇒ Object
readonly
Returns the value of attribute logLevel.
-
#middleCertPath ⇒ Object
readonly
Returns the value of attribute middleCertPath.
-
#qrcB2cIssBackTransUrl ⇒ Object
readonly
Returns the value of attribute qrcB2cIssBackTransUrl.
-
#qrcB2cMerBackTransUrl ⇒ Object
readonly
Returns the value of attribute qrcB2cMerBackTransUrl.
-
#qrcBackTransUrl ⇒ Object
readonly
Returns the value of attribute qrcBackTransUrl.
-
#rootCertPath ⇒ Object
readonly
Returns the value of attribute rootCertPath.
-
#secureKey ⇒ Object
readonly
Returns the value of attribute secureKey.
-
#signCertPath ⇒ Object
readonly
Returns the value of attribute signCertPath.
-
#signCertPwd ⇒ Object
readonly
Returns the value of attribute signCertPwd.
-
#signMethod ⇒ Object
readonly
Returns the value of attribute signMethod.
-
#singleQueryUrl ⇒ Object
readonly
Returns the value of attribute singleQueryUrl.
-
#validateCertDir ⇒ Object
readonly
Returns the value of attribute validateCertDir.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Instance Method Summary collapse
-
#initialize ⇒ SDKConfig
constructor
A new instance of SDKConfig.
- #parse_acpsdk ⇒ Object
Constructor Details
#initialize ⇒ SDKConfig
Returns a new instance of SDKConfig.
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 |
# File 'lib/unionpei/sdk_config.rb', line 16 def initialize ini = parse_acpsdk acpsdk = ini['acpsdk'] @frontTransUrl = acpsdk['acpsdk.frontTransUrl'] @singleQueryUrl = acpsdk['acpsdk.singleQueryUrl'] @backTransUrl = acpsdk['acpsdk.backTransUrl'] @batchTransUrl = acpsdk['acpsdk.batchTransUrl'] @fileTransUrl = acpsdk['acpsdk.fileTransUrl'] @appTransUrl = acpsdk['acpsdk.appTransUrl'] @cardTransUrl = acpsdk['acpsdk.cardTransUrl'] @jfFrontTransUrl = acpsdk['acpsdk.jfFrontTransUrl'] @jfSingleQueryUrl = acpsdk['acpsdk.jfSingleQueryUrl'] @jfBackTransUrl = acpsdk['acpsdk.jfBackTransUrl'] @jfCardTransUrl = acpsdk['acpsdk.jfCardTransUrl'] @jfAppTransUrl = acpsdk['acpsdk.jfAppTransUrl'] @qrcBackTransUrl = acpsdk['acpsdk.qrcBackTransUrl'] @qrcB2cIssBackTransUrl = acpsdk['acpsdk.qrcB2cIssBackTransUrl'] @qrcB2cMerBackTransUrl = acpsdk['acpsdk.qrcB2cMerBackTransUrl'] @signMethod = acpsdk['acpsdk.signMethod'] @signMethod = @signMethod.to_s unless @signMethod.nil? @version = acpsdk['acpsdk.version'] @version = '5.0.0' if @version.nil? @ifValidateCNName = acpsdk['acpsdk.ifValidateCNName'] @ifValidateCNName = true if @ifValidateCNName.nil? @ifValidateRemoteCert = acpsdk['acpsdk.ifValidateRemoteCert'] @ifValidateRemoteCert = false if @ifValidateRemoteCert.nil? @signCertPath = acpsdk['acpsdk.signCert.path'] @signCertPwd = acpsdk['acpsdk.signCert.pwd'] @signCertPwd = @signCertPwd.to_s unless @signCertPwd.nil? @validateCertDir = acpsdk['acpsdk.validateCert.dir'] @encryptCertPath = acpsdk['acpsdk.encryptCert.path'] @rootCertPath = acpsdk['acpsdk.rootCert.path'] @middleCertPath = acpsdk['acpsdk.middleCert.path'] @frontUrl = acpsdk['acpsdk.frontUrl'] @backUrl = acpsdk['acpsdk.backUrl'] @encoding = acpsdk['acpsdk.encoding'] @secureKey = acpsdk['acpsdk.secureKey'] @secureKey = @secureKey.to_s unless @secureKey.nil? @logFilePath = acpsdk['acpsdk.log.file.path'] @logLevel = acpsdk['acpsdk.log.level'] @encoding = 'UTF-8' end |
Instance Attribute Details
#appTransUrl ⇒ Object (readonly)
Returns the value of attribute appTransUrl.
9 10 11 |
# File 'lib/unionpei/sdk_config.rb', line 9 def appTransUrl @appTransUrl end |
#backTransUrl ⇒ Object (readonly)
Returns the value of attribute backTransUrl.
9 10 11 |
# File 'lib/unionpei/sdk_config.rb', line 9 def backTransUrl @backTransUrl end |
#backUrl ⇒ Object (readonly)
Returns the value of attribute backUrl.
9 10 11 |
# File 'lib/unionpei/sdk_config.rb', line 9 def backUrl @backUrl end |
#batchTransUrl ⇒ Object (readonly)
Returns the value of attribute batchTransUrl.
9 10 11 |
# File 'lib/unionpei/sdk_config.rb', line 9 def batchTransUrl @batchTransUrl end |
#cardTransUrl ⇒ Object (readonly)
Returns the value of attribute cardTransUrl.
9 10 11 |
# File 'lib/unionpei/sdk_config.rb', line 9 def cardTransUrl @cardTransUrl end |
#encoding ⇒ Object (readonly)
Returns the value of attribute encoding.
9 10 11 |
# File 'lib/unionpei/sdk_config.rb', line 9 def encoding @encoding end |
#encryptCertPath ⇒ Object (readonly)
Returns the value of attribute encryptCertPath.
9 10 11 |
# File 'lib/unionpei/sdk_config.rb', line 9 def encryptCertPath @encryptCertPath end |
#fileTransUrl ⇒ Object (readonly)
Returns the value of attribute fileTransUrl.
9 10 11 |
# File 'lib/unionpei/sdk_config.rb', line 9 def fileTransUrl @fileTransUrl end |
#frontTransUrl ⇒ Object (readonly)
Returns the value of attribute frontTransUrl.
9 10 11 |
# File 'lib/unionpei/sdk_config.rb', line 9 def frontTransUrl @frontTransUrl end |
#frontUrl ⇒ Object (readonly)
Returns the value of attribute frontUrl.
9 10 11 |
# File 'lib/unionpei/sdk_config.rb', line 9 def frontUrl @frontUrl end |
#ifValidateCNName ⇒ Object (readonly)
Returns the value of attribute ifValidateCNName.
9 10 11 |
# File 'lib/unionpei/sdk_config.rb', line 9 def ifValidateCNName @ifValidateCNName end |
#ifValidateRemoteCert ⇒ Object (readonly)
Returns the value of attribute ifValidateRemoteCert.
9 10 11 |
# File 'lib/unionpei/sdk_config.rb', line 9 def ifValidateRemoteCert @ifValidateRemoteCert end |
#jfAppTransUrl ⇒ Object (readonly)
Returns the value of attribute jfAppTransUrl.
9 10 11 |
# File 'lib/unionpei/sdk_config.rb', line 9 def jfAppTransUrl @jfAppTransUrl end |
#jfBackTransUrl ⇒ Object (readonly)
Returns the value of attribute jfBackTransUrl.
9 10 11 |
# File 'lib/unionpei/sdk_config.rb', line 9 def jfBackTransUrl @jfBackTransUrl end |
#jfCardTransUrl ⇒ Object (readonly)
Returns the value of attribute jfCardTransUrl.
9 10 11 |
# File 'lib/unionpei/sdk_config.rb', line 9 def jfCardTransUrl @jfCardTransUrl end |
#jfFrontTransUrl ⇒ Object (readonly)
Returns the value of attribute jfFrontTransUrl.
9 10 11 |
# File 'lib/unionpei/sdk_config.rb', line 9 def jfFrontTransUrl @jfFrontTransUrl end |
#jfSingleQueryUrl ⇒ Object (readonly)
Returns the value of attribute jfSingleQueryUrl.
9 10 11 |
# File 'lib/unionpei/sdk_config.rb', line 9 def jfSingleQueryUrl @jfSingleQueryUrl end |
#logFilePath ⇒ Object (readonly)
Returns the value of attribute logFilePath.
9 10 11 |
# File 'lib/unionpei/sdk_config.rb', line 9 def logFilePath @logFilePath end |
#logLevel ⇒ Object (readonly)
Returns the value of attribute logLevel.
9 10 11 |
# File 'lib/unionpei/sdk_config.rb', line 9 def logLevel @logLevel end |
#middleCertPath ⇒ Object (readonly)
Returns the value of attribute middleCertPath.
9 10 11 |
# File 'lib/unionpei/sdk_config.rb', line 9 def middleCertPath @middleCertPath end |
#qrcB2cIssBackTransUrl ⇒ Object (readonly)
Returns the value of attribute qrcB2cIssBackTransUrl.
9 10 11 |
# File 'lib/unionpei/sdk_config.rb', line 9 def qrcB2cIssBackTransUrl @qrcB2cIssBackTransUrl end |
#qrcB2cMerBackTransUrl ⇒ Object (readonly)
Returns the value of attribute qrcB2cMerBackTransUrl.
9 10 11 |
# File 'lib/unionpei/sdk_config.rb', line 9 def qrcB2cMerBackTransUrl @qrcB2cMerBackTransUrl end |
#qrcBackTransUrl ⇒ Object (readonly)
Returns the value of attribute qrcBackTransUrl.
9 10 11 |
# File 'lib/unionpei/sdk_config.rb', line 9 def qrcBackTransUrl @qrcBackTransUrl end |
#rootCertPath ⇒ Object (readonly)
Returns the value of attribute rootCertPath.
9 10 11 |
# File 'lib/unionpei/sdk_config.rb', line 9 def rootCertPath @rootCertPath end |
#secureKey ⇒ Object (readonly)
Returns the value of attribute secureKey.
9 10 11 |
# File 'lib/unionpei/sdk_config.rb', line 9 def secureKey @secureKey end |
#signCertPath ⇒ Object (readonly)
Returns the value of attribute signCertPath.
9 10 11 |
# File 'lib/unionpei/sdk_config.rb', line 9 def signCertPath @signCertPath end |
#signCertPwd ⇒ Object (readonly)
Returns the value of attribute signCertPwd.
9 10 11 |
# File 'lib/unionpei/sdk_config.rb', line 9 def signCertPwd @signCertPwd end |
#signMethod ⇒ Object (readonly)
Returns the value of attribute signMethod.
9 10 11 |
# File 'lib/unionpei/sdk_config.rb', line 9 def signMethod @signMethod end |
#singleQueryUrl ⇒ Object (readonly)
Returns the value of attribute singleQueryUrl.
9 10 11 |
# File 'lib/unionpei/sdk_config.rb', line 9 def singleQueryUrl @singleQueryUrl end |
#validateCertDir ⇒ Object (readonly)
Returns the value of attribute validateCertDir.
9 10 11 |
# File 'lib/unionpei/sdk_config.rb', line 9 def validateCertDir @validateCertDir end |
#version ⇒ Object (readonly)
Returns the value of attribute version.
9 10 11 |
# File 'lib/unionpei/sdk_config.rb', line 9 def version @version end |
Instance Method Details
#parse_acpsdk ⇒ Object
69 70 71 72 |
# File 'lib/unionpei/sdk_config.rb', line 69 def parse_acpsdk acp_sdk_config_path = ::UnionPei.configuration.acp_sdk_config_path IniParse.parse(File.read(acp_sdk_config_path).force_encoding('UTF-8')) end |