reapal 0.9.9 → 0.9.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dc80418f6aab1c7493e241753d345e3bd620ce39
4
- data.tar.gz: 9ff754f1eece3976e594a48102cf397a3b3f6aa5
3
+ metadata.gz: c5ac0e3d6c32176c28c8fc38dd40baffe47a7679
4
+ data.tar.gz: 7530628760cc05e9a0084bc6dd875061f1c47f1a
5
5
  SHA512:
6
- metadata.gz: 3f1d6bdfc9249a5a756f71ff57f5823050ed88e293d45abf635dbe5cccdb2b9d1a835d72f2d1086d132150b1ebbf2069a8c6fa48a672b33341f6606d3a76b9f8
7
- data.tar.gz: 0ac5d3e3fd14af75f461648182b6d7691eea081ef0cdcf994db2d382622b2fb0d7ba7d78a0eb45331f854a580bc19b5a11dbbd6f7799ce6e214586f96b598efc
6
+ metadata.gz: 99c449bf8eea9b87124ed9401168b8edad6d65170e62fc17691428d06c2e8b0bc0dd055cf975450f4cd44620b2dc62297c81446c61929bc1023a4eaf6a18923a
7
+ data.tar.gz: 4a80dd4dd68f70fa9e59b68a7d36573893c7234ac54bbe193acc3f84d066f7eda8e16464bd415a808574b489a41ed4234a11a7d5700d258d53671f436be642de
@@ -1,60 +1,55 @@
1
1
  # coding: utf-8
2
2
 
3
3
  module Reapal
4
- module Api
5
- module Money
6
- module DepositConfirmApi
7
-
8
- # 2.3 快捷充值确认(API)
9
- #
10
- # @param flow_id [ String ] 商户订单号(非自动生成,与充值签约订单号一致)
11
- # @param contracts [ String ] 用户协议号
12
- # @param check_code [ String ] 短信验证码
13
- # @param terminal_info [ String ] 终端信息(手机IMEI地址、MAC地址、UUID)
14
- # @param member_ip [ String ] 用户IP
15
- # @param busway [ String ] 设备通道 00:PC端;01:手机端;02:Pad端;03:其它
16
- # @param remark [ String ] 业务备注信息
17
- #
18
- # @return [ Hash ] 结果集
19
- # * :result [String] "S"/"F"/"P"
20
- # * :request_params [Hash] 请求参数
21
- # * :response [Object] 请求返回对象
22
- # * :error_code [String] 错误代号
23
- # * :error_msg [String] 错误信息
24
- # * :data: 具体业务返回信息
25
- # * :orderNo [String] 订单号
26
- # * :resultCode [String] 结果代码 0000:充值成功
27
- # * :resultMsg [String] 结果描述
28
- #
29
- def deposit_confirm_api(flow_id, contracts, check_code, terminal_info, member_ip, busway = '01', remark = '')
30
- service = 'reapal.trust.depositConfirmAPI'
31
- post_path = '/reagw/service/depwit.htm'
32
-
33
- params = {
34
- orderNo: flow_id,
35
- contracts: contracts,
36
- checkCode: check_code,
37
- busway: busway,
38
- terminalInfo: terminal_info,
39
- memberIp: member_ip,
40
- applyTime: Time.now.strftime('%Y-%m-%d %H:%M:%S'),
41
- }
42
-
43
- res = operate_post(:operate, service, params, post_path, Http::ErrorCode.deposit_confirm_api, ['0000'])
44
-
45
- error_result_code = %w(9060 9065 9083 9084 9085 0017 0210 0302 0303 0328 0329
46
- 0330 0332 0333 0335 0339 0340 0341 0342 0343 0344 0345
47
- 0346 0347 0348 0350 0351 0352 0358 0359 0360 0362 0363
48
- 0001 0004)
49
-
50
- if 'S' == res[:result] && error_result_code.include?(res[:data][:resultCode])
51
- res[:result] = 'F'
52
- end
53
-
54
- res
55
- end
56
-
57
- end # module
58
- end
4
+ module Api
5
+ module Money
6
+ module DepositConfirmApi
7
+
8
+ # 2.3 快捷充值确认(API)
9
+ #
10
+ # @param flow_id [ String ] 商户订单号(非自动生成,与充值签约订单号一致)
11
+ # @param contracts [ String ] 用户协议号
12
+ # @param check_code [ String ] 短信验证码
13
+ # @param terminal_info [ String ] 终端信息(手机IMEI地址、MAC地址、UUID)
14
+ # @param member_ip [ String ] 用户IP
15
+ # @param busway [ String ] 设备通道 00:PC端;01:手机端;02:Pad端;03:其它
16
+ # @param remark [ String ] 业务备注信息
17
+ #
18
+ # @return [ Hash ] 结果集
19
+ # * :result [String] "S"/"F"/"P"
20
+ # * :request_params [Hash] 请求参数
21
+ # * :response [Object] 请求返回对象
22
+ # * :error_code [String] 错误代号
23
+ # * :error_msg [String] 错误信息
24
+ # * :data: 具体业务返回信息
25
+ # * :orderNo [String] 订单号
26
+ # * :resultCode [String] 结果代码 0000:充值成功
27
+ # * :resultMsg [String] 结果描述
28
+ #
29
+ def deposit_confirm_api(flow_id, contracts, check_code, terminal_info, member_ip, busway = '01', _remark = '')
30
+ service = 'reapal.trust.depositConfirmAPI'
31
+ post_path = '/reagw/service/depwit.htm'
32
+
33
+ params = {
34
+ orderNo: flow_id,
35
+ contracts: contracts,
36
+ checkCode: check_code,
37
+ busway: busway,
38
+ terminalInfo: terminal_info,
39
+ memberIp: member_ip,
40
+ applyTime: Time.now.strftime('%Y-%m-%d %H:%M:%S')
41
+ }
42
+
43
+ res = operate_post(:operate, service, params, post_path, Http::ErrorCode.deposit_confirm_api, ['0000'])
44
+
45
+ if 'P' == res[:result] && ['0001', '0004', '3084'].include?(res[:data][:resultCode])
46
+ res[:result] = 'F'
47
+ end
48
+
49
+ res
50
+ end
51
+
52
+ end # module
53
+ end
59
54
  end
60
55
  end
@@ -29,7 +29,7 @@ module Reapal
29
29
 
30
30
  res = operate_post(:query, service, params, post_path, Http::ErrorCode.deposit_query, ['0000'])
31
31
 
32
- if 'S' == res[:result] && ('0001' || '0004') == res[:data][:resultCode]
32
+ if 'P' == res[:result] && ('0001' || '0004') == res[:data][:resultCode]
33
33
  res[:result] = 'F'
34
34
  end
35
35
 
@@ -40,7 +40,7 @@ module Reapal
40
40
 
41
41
  res = operate_post(:operate, service, params, post_path, Http::ErrorCode.sub_account, ['0000'])
42
42
 
43
- if 'S' == res[:result] && '0001' == res[:data][:resultCode]
43
+ if 'P' == res[:result] && '0001' == res[:data][:resultCode]
44
44
  res[:result] = 'F'
45
45
  end
46
46
 
@@ -38,7 +38,7 @@ module Reapal
38
38
 
39
39
  res = operate_post(:query, service, params, post_path, Http::ErrorCode.sub_account_query, ['0000'])
40
40
 
41
- if 'S' == res[:result] && '0001' == res[:data][:resultCode]
41
+ if 'P' == res[:result] && '0001' == res[:data][:resultCode]
42
42
  res[:result] = 'F'
43
43
  end
44
44
 
@@ -34,7 +34,7 @@ module Reapal
34
34
 
35
35
  res = operate_post(:query, service, params, post_path, Http::ErrorCode.withdraw_query, ['0002'])
36
36
 
37
- if 'S' == res[:result] && '0003' == res[:data][:resultCode]
37
+ if 'P' == res[:result] && '0003' == res[:data][:resultCode]
38
38
  res[:result] = 'F'
39
39
  end
40
40
 
@@ -57,7 +57,7 @@ module Reapal
57
57
 
58
58
  res = operate_post(:query, service, params, post_path, Http::ErrorCode.query_by_flow_id, ['0000'])
59
59
 
60
- if 'S' == res[:result] && ('0001' || '0003') == res[:data][:resultCode]
60
+ if 'P' == res[:result] && ('0001' || '0003') == res[:data][:resultCode]
61
61
  res[:result] = 'F'
62
62
  end
63
63
 
@@ -48,7 +48,7 @@ module Reapal
48
48
 
49
49
  res = operate_post(:query, service, params, post_path, Http::ErrorCode.query_by_single_flow_id, ['0000'])
50
50
 
51
- if 'S' == res[:result] && ('0001' || '0003') == res[:data][:resultCode]
51
+ if 'P' == res[:result] && ('0001' || '0003') == res[:data][:resultCode]
52
52
  res[:result] = 'F'
53
53
  end
54
54
 
@@ -46,7 +46,7 @@ module Reapal
46
46
 
47
47
  res = operate_post(:query, service, params, post_path, Http::ErrorCode.tender_auth_query, ['0000'])
48
48
 
49
- if 'S' == res[:result] && ('0001' || '0003') == res[:data][:resultCode]
49
+ if 'P' == res[:result] && ('0001' || '0003') == res[:data][:resultCode]
50
50
  res[:result] = 'F'
51
51
  end
52
52
 
@@ -33,11 +33,17 @@ module Reapal
33
33
  post_path = '/reagw/agreement/agreeApi.htm'
34
34
 
35
35
  params = {
36
- orderNo: oneket_com_contract_flow_id,
36
+ orderNo: onekey_com_contract_flow_id,
37
37
  queryTime: Time.now.strftime('%Y-%m-%d %H:%M:%S'),
38
38
  }
39
39
 
40
- operate_post(:query, service, params, post_path, Http::ErrorCode.contract_query, ['0000'])
40
+ res = operate_post(:query, service, params, post_path, Http::ErrorCode.contract_query, ['0000'])
41
+
42
+ if 'P' == res[:result] && '0001' == res[:data][:resultCode]
43
+ res[:result] = 'F'
44
+ end
45
+
46
+ res
41
47
  end
42
48
 
43
49
  end # module
@@ -66,7 +66,7 @@ module Reapal
66
66
 
67
67
  res = operate_post(:operate, service, params, post_path, Http::ErrorCode.com_contract_create, ['0002', '0006'])
68
68
 
69
- if 'S' == res[:result] && '0003' == res[:data][:resultCode]
69
+ if 'P' == res[:result] && '0003' == res[:data][:resultCode]
70
70
  res[:result] = 'F'
71
71
  end
72
72
 
@@ -1,18 +1,18 @@
1
- # coding: utf-8
1
+
2
2
  # API 公共错误相关
3
3
  module Reapal
4
4
  module Http
5
5
  module ErrorCode
6
6
 
7
7
  def self.common
8
- %w( 0001 0002 0003 0004 0005 0006 0007 0008 0009 0010 0011
9
- 0012 0013 0014 0015 0016 0017 0099 9001 9002 9003 9004
10
- 9005 9006 9007 9008 9009 9010 9011 9012 9013 9014 9015
11
- 9016 9017 9018 9019 9020 9021 9022 9023 9024 9025 9026
12
- 9027 9028 9029 9030 9031 9032 9033 9034 9035 9036 9037
13
- 9038 9039 9040 9041 9042 9043 9044 9045 9046 9047 9048
14
- 9049 9050 9051 9052 9053 9054 9055 9056 9056 9057 9058
15
- 9059 9060 9061 9062 9063 9064 9065 9066 9067 9068 9069 )
8
+ @_common ||= %w(0002 0003 0004 0005 0006 0007 0008 0009 0010 0011
9
+ 0012 0013 0014 0015 0016 0017 9001 9002 9003
10
+ 9005 9006 9007 9008 9009 9011 9012 9013 9014 9015
11
+ 9016 9017 9018 9019 9020 9021 9022 9023 9024 9025 9026
12
+ 9027 9028 9029 9030 9031 9032 9033 9034 9035 9036 9037
13
+ 9038 9039 9040 9041 9042 9043 9044 9045 9046 9047 9048
14
+ 9049 9050 9051 9052 9053 9054 9055 9056 9056 9057 9058
15
+ 9059 9060 9061 9062 9063 9064 9065 9066 9067 9068 9069)
16
16
  end
17
17
 
18
18
  end # module ErrorCode
@@ -5,34 +5,29 @@ module Reapal
5
5
  module ErrorCode
6
6
 
7
7
  def self.deposit_common
8
- @_deposit ||= %w(0000 0001 0003 0004 0005 0201 0202 0203 0204 0205
9
- 0206 0207 0208 0209 1701 1702 1703 1704 1705 1706
10
- 1707 1708 1709 1710 1711 1712 1713 1714 1801 1802
11
- 1803 1804 1805 1901 1001 1002 1003 1004 1005 1006
12
- 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016
13
- 1017 1018 1019 1020 1021 1023 1024 1025 1026 1027
14
- 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037
15
- 1038 1039 1040 1041 1042 1043 1044 1047 1048 1049
16
- 1050 1051 1088 1115 1806 2001 2002 2003 2004 2005
17
- 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015
18
- 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025
19
- 2027 2028 2029 2030 2031 2032 2033 3001 3002 3003
20
- 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013
21
- 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023
22
- 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033
23
- 3034 3035 3036 3037 3038 3039 3040 3041 3051 3052
24
- 3053 3054 3056 3057 3058 3059 3060 3061 3062 3063
25
- 3064 3065 3066 3067 3068 3069 3073 3074 3075 3077
26
- 3078 3079 3080 3081 3083 3084 3086 3088 3094 3095
27
- 3096 3097 3098 3099 3100 3135 3136 4001 4002 4003
28
- 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013
29
- 4014 4015 4016 4017 4018 4019 6001 6002) | common
8
+ @_deposit_common ||= %w(0201 0202 0203 0204 0205 0206 0207 0208 0209 1701 1702
9
+ 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713
10
+ 1714 1801 1802 1803 1804 1805 1901 1002 1004 1005 1006
11
+ 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017
12
+ 1018 1019 1020 1021 1023 1024 1025 1026 1027 1028 1029
13
+ 1030 1031 1032 1033 1034 1036 1037 1038 1039 1040 1041
14
+ 1042 1043 1047 1048 1051 1088 1115 1806 2001 2002 2003
15
+ 2004 2005 2006 2007 2008 2009 2011 2012 2013 2014 2015
16
+ 2017 2018 2020 2021 2022 2023 2024 2025 2027 2028 2029
17
+ 2030 2031 2032 2033 3001 3002 3003 3004 3005 3006 3007
18
+ 3008 3009 3010 3011 3012 3013 3014 3015 3016 3018 3019
19
+ 3020 3021 3022 3023 3024 3025 3026 3027 3028 3030 3031
20
+ 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3051
21
+ 3052 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066
22
+ 3068 3069 3074 3075 3077 3078 3079 3080 3084 3086 3088
23
+ 3094 3095 3096 3097 3098 3099 3100 3135 3136 4002 4003
24
+ 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014
25
+ 4015 4016 4018 4019 6001 6002) | common
30
26
  end
31
27
 
32
28
  def self.deposit_apply_api
33
- @_deposit_apply_api ||= %w(1701 1702 1703 1704 1705 1706
34
- 1707 1708 1709 1710 1711 1712
35
- 1713 1714) | deposit_common
29
+ @_deposit_apply_api ||= %w(1701 1702 1703 1704 1705 1706 1707 1708 1709
30
+ 1710 1711 1712 1713 1714 0001) | deposit_common
36
31
  end
37
32
 
38
33
  def self.deposit_confirm_api
@@ -40,18 +35,18 @@ module Reapal
40
35
  end
41
36
 
42
37
  def self.deposit_sms_api
43
- @_deposit_sms_api ||= [] | deposit_common
38
+ @_deposit_sms_api ||= %w(1801 1802 1803 1804 1805) | deposit_common
44
39
  end
45
40
 
46
41
  def self.deposit_query
47
- @_deposit_query ||= %w(0208) | deposit_common
42
+ @_deposit_query ||= deposit_common
48
43
  end
49
44
 
50
45
  def self.withdraw_query
51
- @_withdraw_query ||= %w(0301 0302 0303 0304 0305 0306 0307 0308 0309
52
- 0310 0311 0312 0313 0314 0315 0316 0317 0318 0319 0320 0321 0322
53
- 0333 0324 0326 0327 0328 0329 0330 0331 0332 0333 0334 0335 0336
54
- 0337 0338 0339 0340) | common
46
+ @_withdraw_query ||= %w(0301 0302 0303 0304 0305 0306 0307 0308 0309 0310
47
+ 0311 0312 0313 0314 0315 0316 0317 0318 0319 0320
48
+ 0321 0322 0333 0324 0326 0327 0328 0329 0330 0331
49
+ 0332 0333 0334 0335 0336 0337 0338 0339 0340) | common
55
50
  end
56
51
 
57
52
  def self.sub_account
@@ -59,7 +54,7 @@ module Reapal
59
54
  end
60
55
 
61
56
  def self.sub_account_query
62
- @_sub_account_query ||= %w(1608 1609 1610 1611) | common
57
+ @_sub_account_query ||= %w(1609 1611) | common
63
58
  end
64
59
 
65
60
  end # module ErrorCode
@@ -5,11 +5,11 @@ module Reapal
5
5
  module ErrorCode
6
6
 
7
7
  def self.query_by_single_flow_id
8
- @_query_by_single_flow_id ||= %w(1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 0001) | tender_common
8
+ @_query_by_single_flow_id ||= %w(1103 1104 1105 1106 1107 1108 1109 0001 0519) | tender_common
9
9
  end
10
10
 
11
11
  def self.query_by_flow_id
12
- @_query_by_flow_id ||= %w(1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 0001) | tender_common
12
+ @_query_by_flow_id ||= %w(1103 1104 1105 1106 1107 1108 1109 0001) | tender_common
13
13
  end
14
14
 
15
15
  end # module ErrorCode
@@ -48,21 +48,21 @@ module Reapal
48
48
  end
49
49
 
50
50
  def self.tender_finish
51
- @_tender_finish ||= %w(0800 0801 0802 0803 0804 0805 0806 0807) | tender_common
51
+ @_tender_finish ||= %w(0801 0803 0804 0805 0806 0807) | tender_common
52
52
  end
53
53
 
54
54
  def self.tender_onekey_invest
55
- @_tender_onekey_invest ||= %w(0600 0601 0602 0603 0604 0605 0606 0607 0608 0609) | tender_common
55
+ @_tender_onekey_invest ||= %w(0519 0536 0600 0601 0602 0603 0606 0607 0608 0609) | tender_common
56
56
  end
57
57
 
58
58
  def self.tender_onekey_refund
59
- @_tender_onekey_refund ||= %w(0900 0901 0902 0903 0904 0905 0906 0907 0908 0909 0910
59
+ @_tender_onekey_refund ||= %w(0901 0902 0903 0904 0905 0906 0907 0908 0909 0910
60
60
  0911 0912 0913 0914 0915 0916 0917 0918 0919 0920 0921
61
61
  0922 0923 0001) | tender_common
62
62
  end
63
63
 
64
64
  def self.tender_onekey_single_transfer
65
- @_tender_onekey_single_transfer ||= %w(1000 1001 1002 1003 1004 1005 1006 1007 1008
65
+ @_tender_onekey_single_transfer ||= %w(1000 1001 1002 1003 1004 1005 1006
66
66
  1009 1010 1011 1012 1013 0001) | tender_common
67
67
  end
68
68
 
@@ -5,24 +5,23 @@ module Reapal
5
5
  module ErrorCode
6
6
 
7
7
  def self.contract_common
8
- ['0103'] | common
8
+ @_contract_common ||= %w(0101 0102 0103 0104 0105 0106 0107 0108 0109 0110
9
+ 0111 0112 0113 0114 0115 0116 0117 0118 0119 0120
10
+ 0121 0122 0123 0124 0125 0126 0127 0128 0129 0130
11
+ 0131 0132 0150 0151 0152 0153 0154 0155 0156 0157
12
+ 0158 0159 0160 0161 0162 0163 0164 0165 0166 0167) | common
9
13
  end
10
14
 
11
15
  def self.contract_create
12
- ['0101', '0102', '0103', '0104', '0105', '0106', '0107', '0108', '0109',
13
- '0110', '0111', '0112', '0113', '0114', '0115', '0116', '0117', '0118',
14
- '0119', '0120', '0121', '0122', '0123', '0124', '0125', '0126', '0127',
15
- '0128', '0129', '0130', '0131', '0132', '0150', '0151', '0152', '0153',
16
- '0154', '0155', '0156', '0157', '0158', '0159', '0160', '0161', '0162',
17
- '0163', '0164', '0165', '0166', '0167', '0525'] | contract_common
16
+ @_contract_create ||= contract_common
18
17
  end
19
18
 
20
19
  def self.com_contract_create
21
- ['9015'] | contract_create | contract_common
20
+ @_com_contract_common ||= ['9015'] | contract_common
22
21
  end
23
22
 
24
23
  def self.contract_query
25
- ['0113'] | contract_common
24
+ @_contract_query ||= contract_common
26
25
  end
27
26
 
28
27
  def self.mobile
@@ -30,10 +29,10 @@ module Reapal
30
29
  end
31
30
 
32
31
  def self.bind_card
33
- @_bind_card ||= %w(9060 9064 9065 9083 9084 9085 0017 0210 0302 0303 0328
32
+ @_bind_card ||= %w(9060 9064 9065 9083 9084 9085 0017 0302 0303 0328
34
33
  0329 0330 0332 0333 0335 0339 0340 0341 0342 0343
35
- 0344 0345 0346 0347 0348 0350 0351 0352 0358 0359
36
- 0360 0362 0363) | contract_common
34
+ 0345 0346 0347 0348 0350 0351 0352 0358 0359 0360
35
+ 0362 0363) | contract_common
37
36
  end
38
37
 
39
38
  end # module ErrorCode
@@ -1,3 +1,3 @@
1
1
  module Reapal
2
- VERSION = "0.9.9"
2
+ VERSION = "0.9.10"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: reapal
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.9
4
+ version: 0.9.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - tony
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-12-09 00:00:00.000000000 Z
11
+ date: 2017-12-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler