suning_pay 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c5f8b7ccff022e6115b83b41aef01f93be73e970
4
- data.tar.gz: 748fe7c9a0add1c2686defeb89f86ac5eafb0dbd
3
+ metadata.gz: 97ec05b437374da105374bd63f4ae23ec2fbe233
4
+ data.tar.gz: cb7636a6a2b6ee9c7ebd0c453efd7159bb5a7479
5
5
  SHA512:
6
- metadata.gz: 80a5eb127fdd282104fd86121b6201ee52d9b99f102efe173d4f661d14874c86028836c46ef27498be4884706c17cf7be9468f1a741a5771ec7a0117ec50bcc4
7
- data.tar.gz: b8c78d250535d556e51dcc50aeb62951d720a5d67d099afacb62128760687e0825832c1bf47595d7a1a19a63fe41a7863d48efd12ca3ed834a058db618718584
6
+ metadata.gz: c3abf85a1d7d61c17c8fdd9ebe787f9812e50d3deb8b5ab34cdb6f4ea8a4e56d10049ea95c0e71d57aeac2240319d9678aeb84d2d53da3eddf4ae14819bd5238
7
+ data.tar.gz: 9b1f8d926bd9a45748b72398fb4c2855e42be90041baddb8ee9b06e4dab2160f5be0bff0dff5ef4153926e000b9c7559585e7a8a3ddb5d52502698d5078e202d
data/lib/suning_pay.rb CHANGED
@@ -5,6 +5,7 @@ require 'digest/md5'
5
5
  require 'base64'
6
6
 
7
7
  require "suning_pay/version"
8
+ require "suning_pay/result"
8
9
  require "suning_pay/rsa"
9
10
  require "suning_pay/util"
10
11
  require "suning_pay/service"
@@ -0,0 +1,88 @@
1
+ #encoding: utf-8
2
+ module SuningPay
3
+ class Result < ::Hash
4
+ RESULT_SUCCESS_FLAG = '0000'
5
+
6
+ RESULT_MSG = {
7
+ '0000' => '成功',
8
+ '0140' => '不支持该业务',
9
+ '0160' => '未开通支付方式',
10
+ '0161' => '渠道维护关闭',
11
+ '0162' => '服务维护中',
12
+ '0360' => '订单已失效',
13
+ '0400' => '请检查银行卡号是否正确',
14
+ '0401' => '请检查银行编码、卡类型是否正确',
15
+ '0430' => '该银行卡已签约',
16
+ '0431' => '请重新 交签约申请',
17
+ '0432' => '未绑定银行卡,请签约后交支付',
18
+ '0440' => '订单金额超过银行限额',
19
+ '0501' => '渠道维护升级中',
20
+ '0596' => '支付处理中,请稍后查询',
21
+ '0597' => '服务处理中,请稍后查询',
22
+ '0598' => '请求参数不合法',
23
+ '0599' => '系统异常,请稍后查询',
24
+ '2121' => '支付处理中,请稍后查询订单状态',
25
+ '2125' => '支付处理中,请稍后查询订单状态',
26
+ '2126' => '支付处理中,请稍后查询订单状态',
27
+ '3600' => '风控额度校验不通过',
28
+ '3610' => '风控未配置额度,不通过',
29
+ '6218' => '银行返回超时,请稍后查询',
30
+ '6601' => '验签失败',
31
+ '6611' => '验签失败',
32
+ '6804' => '商户不存在有效合同',
33
+ '7401' => '查询商户信息失败',
34
+ '8001' => '支付失败',
35
+ '8007' => '支付失败',
36
+ '8015' => '支付失败',
37
+ '8016' => '银行处理中,请稍后查询',
38
+ '8021' => '银行卡余额不足',
39
+ '8022' => '交易金额超过银行限额',
40
+ '8025' => '交易金额低于银行最低要求',
41
+ '8053' => '24 小时内银行卡余额不足次数超限',
42
+ '8054' => '该卡当日失败次数超限',
43
+ '8055' => '同一卡号单位时间内交易次数过高,请降低提交频次',
44
+ '8060' => '黑名单用户',
45
+ '8068' => '发卡行交易权限受限,详情请咨询您的发卡行',
46
+ '8074' => '非白名单用户',
47
+ '8075' => '银行卡已挂失,请更换其他付款方式',
48
+ '8090' => '交易失败,请联系银行',
49
+ '8093' => '银行扣款失败',
50
+ '8104' => '银行正在进行日终处理,请稍后重试',
51
+ '8105' => '通道不支持该笔交易',
52
+ '8106' => '无可用渠道',
53
+ '8107' => '无匹配路由',
54
+ '8120' => '银行卡号不正确',
55
+ '8125' => '与银行预留的证件号不符',
56
+ '8127' => '与银行预留的信息不符,请核实后重新提交',
57
+ '8147' => '银行卡状态异常,请更换其他付款方式',
58
+ '8160' => '支付金额超过日累计限额',
59
+ '9996' => '系统处理超时,请稍后查询',
60
+ '9997' => '交易处理中,请稍后查询',
61
+ '9998' => '交易处理中,请稍后查询',
62
+ '9999' => '系统处理异常,请稍后查询'
63
+ }
64
+
65
+ def initialize(result)
66
+ super nil
67
+ self[:raw] = result
68
+
69
+ if result.class == Hash
70
+ result.each do |k, v|
71
+ self[k] = v
72
+ end
73
+ end
74
+ end
75
+
76
+ def msg_code
77
+ self['responseCode']
78
+ end
79
+
80
+ def msg_info
81
+ self['responseMsg']
82
+ end
83
+
84
+ def success?
85
+ self['responseCode'] == RESULT_SUCCESS_FLAG
86
+ end
87
+ end
88
+ end
@@ -1,3 +1,3 @@
1
1
  module SuningPay
2
- VERSION = "0.2.2"
2
+ VERSION = "0.2.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: suning_pay
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Terry.Tu
@@ -90,6 +90,7 @@ files:
90
90
  - lib/suning_pay.rb
91
91
  - lib/suning_pay/ent_service.rb
92
92
  - lib/suning_pay/railtie.rb
93
+ - lib/suning_pay/result.rb
93
94
  - lib/suning_pay/rsa.rb
94
95
  - lib/suning_pay/service.rb
95
96
  - lib/suning_pay/util.rb