Module: Cmbchina

Defined in:
lib/cmbchina.rb

Defined Under Namespace

Modules: Api, Service, Sign Classes: Message, Order, SessionObject

Constant Summary collapse

URI =
{
  #支付网关
  gateway: {
    api:  'https://payment.ebank.cmbchina.com/NetPayment/BaseHttp.dll',
    live: 'https://netpay.cmbchina.com/netpayment/BaseHttp.dll?PrePayC2',
    test: 'https://netpay.cmbchina.com/netpayment/BaseHttp.dll?TestPrePayC2'
  }
}
@@gateway_url =
URI[:gateway][:live]

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.branch_idObject

开户分行号



24
25
26
# File 'lib/cmbchina.rb', line 24

def branch_id
  @branch_id
end

.co_noObject

商户号



25
26
27
# File 'lib/cmbchina.rb', line 25

def co_no
  @co_no
end

.envObject

Returns the value of attribute env.



29
30
31
# File 'lib/cmbchina.rb', line 29

def env
  @env
end

.passwordObject

登录密码



28
29
30
# File 'lib/cmbchina.rb', line 28

def password
  @password
end

.public_keyObject

招行官方公钥(从der版本转换为pem版本)



26
27
28
# File 'lib/cmbchina.rb', line 26

def public_key
  @public_key
end

.secretObject

商户秘钥



27
28
29
# File 'lib/cmbchina.rb', line 27

def secret
  @secret
end

Class Method Details

.api_urlObject



45
46
47
# File 'lib/cmbchina.rb', line 45

def api_url
  URI[:gateway][:api]
end

.config(options) ⇒ Object



35
36
37
38
39
# File 'lib/cmbchina.rb', line 35

def config(options)
  options.each do |key, value|
    send "#{key}=", value
  end
end

.initializeObject



31
32
33
# File 'lib/cmbchina.rb', line 31

def initialize
  @env = :test
end

.urlObject



41
42
43
# File 'lib/cmbchina.rb', line 41

def url
  URI[:gateway][env]
end