Class: NeotelisPay::Service

Inherits:
Object
  • Object
show all
Defined in:
lib/neotelis_pay/service.rb

Class Method Summary collapse

Class Method Details

.post_gateway_pay(order_id, amount, currency, product_name, product_desc, bank_no, notify_url, options = {}) ⇒ Object

网关支付接口bankNo 银行编码orderId 商户订单号amount 订单金额currency 币种orderTime 订单日期productDesc 商品描述productId 商品编号productName 商品名称productNum 商品数量notifyUrl 后台通知URL callbackUrl 前台地址reserved1 保留字段1 reserved2 保留字段2



126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
# File 'lib/neotelis_pay/service.rb', line 126

def self.post_gateway_pay(order_id, amount, currency, product_name, product_desc, bank_no, notify_url, options={})
  service_name = "gatewayPay"
  input_hash = {"type" => service_name,
                "bankNo" => bank_no,
                "orderId" => order_id,
                "amount" => amount,
                "currency" => currency,
                "orderTime" => Time.now.strftime("%Y%m%d%H%M%S"),
                "productName" => NeotelisPay.product_name || product_name,
                "productDesc" => NeotelisPay.product_desc || product_desc,
                "notifyUrl" => notify_url}
  post_params = NeotelisPay.client_params.merge(options).merge(input_hash)
  #调用查询接口
  msg = NeotelisPay::Utils::HttpPost.send_post(service_name, post_params)
  msg
end

.post_pay_confirm(token, verify_code, order_id, amount, options = {}) ⇒ Object

签约支付确认接口token 授权码verifyCode 短信验证码orderId 商户订单号amount 订单金额



99
100
101
102
103
104
105
106
107
108
109
110
# File 'lib/neotelis_pay/service.rb', line 99

def self.post_pay_confirm(token, verify_code, order_id, amount, options={})
  service_name = "payConfirm"
  input_hash = {"type" => service_name,
                "token" => token,
                "verifyCode" => verify_code,
                "orderId" => order_id,
                "amount" => amount}
  post_params = NeotelisPay.client_params.merge(options).merge(input_hash)
  #调用查询接口
  msg = NeotelisPay::Utils::HttpPost.send_post(service_name, post_params)
  msg
end

.post_prepay(order_id, amount, currency, product_name, bank_no, notify_url, bind_id, options = {}) ⇒ Object

签约支付申请接orderId 商户订单号amount 订单金额currency 币种price 商品单价orderTime 订单日期merAcDate 商户会计日期period 订单有效时间busiPartner 商户业务类型merchantAbbr 商户名称productDesc 商品描述productId 商品编号productName 商品名称productNum 商品数量orderDesc 订单描述userToken 用户手机号payerName 持卡人姓名certType 证件类型certNo 证件号bankCardType 银行卡类型bankCardNo 银行卡号bankNo 银行代码cvn2 CVN2 cardExpYear 信用卡有效期年cardExpMonth 信用卡有效期月payType 支付类型notifyUrl 后台通知URL bindId 签约协议号reserved1 保留字段1 reserved2 保留字段2



75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# File 'lib/neotelis_pay/service.rb', line 75

def self.post_prepay(order_id, amount, currency, product_name, bank_no, notify_url, bind_id, options={})
  service_name = "prepay"
  input_hash = {"type" => service_name,
                "orderId" => order_id,
                "amount" => amount,
                "currency" => currency,
                "orderTime" => Time.now.strftime("%Y%m%d%H%M%S"),
                "merAcDate" => Time.now.strftime("%Y%m%d"),
                "merchantAbbr" => NeotelisPay.merchant_abbr,
                "productName" => NeotelisPay.product_name || product_name,
                "bankNo" => bank_no,
                "notifyUrl" => notify_url,
                "bindId" => bind_id}
  post_params = NeotelisPay.client_params.merge(options).merge(input_hash)
  #调用查询接口
  msg = NeotelisPay::Utils::HttpPost.send_post(service_name, post_params)
  msg
end

.post_sign_apply(user_token, payer_name, cert_type, cert_no, bank_card_type, bank_card_no, cvn2, use_time, options = {}) ⇒ Object

签约申请接口userToken 用户手机号payerName 持卡人姓名certType 证件类型certNo 证件号bankCardType 银行卡类型bankCardNo 银行卡号cvn2 cvn2 useTime 有效期



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/neotelis_pay/service.rb', line 14

def self.post_sign_apply(user_token, payer_name, cert_type, cert_no, bank_card_type, bank_card_no, cvn2, use_time, options={})
  service_name = "signApply"
  input_hash = {"type" => service_name,
                "userToken" => user_token,
                "payerName" => payer_name,
                "certType" => cert_type,
                "certNo" => cert_no,
                "bankCardType" => bank_card_type,
                "bankCardNo" => bank_card_no,
                "cvn2" => cvn2,
                "useTime" => use_time}
  post_params = NeotelisPay.client_params.merge(options).merge(input_hash)
  #调用查询接口
  msg = NeotelisPay::Utils::HttpPost.send_post(service_name, post_params)
  msg
end

.post_sign_confirm(token, verify_code, options = {}) ⇒ Object

签约确认接口token 授权码verifyCode 短信验证码



34
35
36
37
38
39
40
41
42
43
# File 'lib/neotelis_pay/service.rb', line 34

def self.post_sign_confirm(token, verify_code, options={})
  service_name = "signConfirm"
  input_hash = {"type" => service_name,
                "token" => token,
                "verifyCode" => verify_code}
  post_params = NeotelisPay.client_params.merge(options).merge(input_hash)
  #调用查询接口
  msg = NeotelisPay::Utils::HttpPost.send_post(service_name, post_params)
  msg
end

.query_order(order_type, order_id, options = {}) ⇒ Object

查询类接口########################



144
145
146
147
148
149
150
151
152
153
# File 'lib/neotelis_pay/service.rb', line 144

def self.query_order(order_type, order_id, options={})
  service_name = "queryOrder"
  input_hash = {"type" => service_name,
                "orderType" => order_type,
                "orderId" => order_id}
  post_params = NeotelisPay.client_params.merge(options).merge(input_hash)
  #调用查询接口
  msg = NeotelisPay::Utils::HttpPost.send_post(service_name, post_params)
  msg
end