Class: Allinpay::Client

Inherits:
Object
  • Object
show all
Includes:
Account, Payment, Query
Defined in:
lib/allinpay/client.rb

Class Attribute Summary collapse

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Query

#query_batch_pay

Methods included from Payment

#batch_pay, #pay

Methods included from Account

#account, #charge

Constructor Details

#initialize(options) ⇒ Client

初始化通联支付

Parameters:

  • options (Hash)

    交易信息

Options Hash (options):

  • :merchant (String)

    通联支付商户号

  • :username (String)

    通联支付用户名

  • :password (String)

    通联支付密码

  • :env (String)

    设置环境

  • :public_path (String)

    公共证书位置

  • :private_path (String)

    私密证书位置

  • :private_password (String)

    私密证书密码



30
31
32
33
34
35
36
# File 'lib/allinpay/client.rb', line 30

def initialize(options)
  @merchant = options[:merchant]
  @username = options[:username]
  @password = options[:password]
  env = options[:env] || 'development'
  @conn = Allinpay::Service.connection(env, options)
end

Class Attribute Details

.private_passwordObject

Returns the value of attribute private_password.



16
17
18
# File 'lib/allinpay/client.rb', line 16

def private_password
  @private_password
end

.private_pathObject

Returns the value of attribute private_path.



16
17
18
# File 'lib/allinpay/client.rb', line 16

def private_path
  @private_path
end

.public_pathObject

Returns the value of attribute public_path.



16
17
18
# File 'lib/allinpay/client.rb', line 16

def public_path
  @public_path
end

Instance Attribute Details

#connObject

Returns the value of attribute conn.



13
14
15
# File 'lib/allinpay/client.rb', line 13

def conn
  @conn
end

#merchantObject

Returns the value of attribute merchant.



13
14
15
# File 'lib/allinpay/client.rb', line 13

def merchant
  @merchant
end

#passwordObject

Returns the value of attribute password.



13
14
15
# File 'lib/allinpay/client.rb', line 13

def password
  @password
end

#usernameObject

Returns the value of attribute username.



13
14
15
# File 'lib/allinpay/client.rb', line 13

def username
  @username
end