cpay 0.2.2 → 0.3.0
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 +4 -4
- data/.idea/workspace.xml +44 -39
- data/README.md +21 -23
- data/lib/cpay.rb +14 -18
- data/lib/cpay/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b6370fba03d7a7d4025073ac896e0826a88e0670fb864c02ce37ac0e9acff8c8
|
|
4
|
+
data.tar.gz: 3707b824ee2941260354ee2771f8bf5fc9e42731f3b838f3b1f4f216e37ac730
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: bf84a96be7814cff3f167f6d8ec40ff7882b13799ccc1550b2cdb976aa71fe7a39f883bcbcb891a7c0043f0fbb4bbfcced9a4196d8af8068acdc65cb2dd3d836
|
|
7
|
+
data.tar.gz: 29add0efecfd537ecfa1a918c4afc70952692123c32400fc5fe98ccf94e873e09ca8f01952d0e7fcdde4ff76989b01ea87ef1f5b1d6572eec00dfd9e20b1f05f
|
data/.idea/workspace.xml
CHANGED
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
<option name="LAST_RESOLUTION" value="IGNORE" />
|
|
30
30
|
</component>
|
|
31
31
|
<component name="CoverageDataManager">
|
|
32
|
-
<SUITE FILE_PATH="coverage/cpay@test_it_does_something_useful__cpay.rcov" NAME="test_it_does_something_useful: cpay Coverage Results" MODIFIED="
|
|
32
|
+
<SUITE FILE_PATH="coverage/cpay@test_it_does_something_useful__cpay.rcov" NAME="test_it_does_something_useful: cpay Coverage Results" MODIFIED="1540615212209" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="rcov" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" MODULE_NAME="cpay" />
|
|
33
33
|
</component>
|
|
34
34
|
<component name="DatabaseView">
|
|
35
35
|
<option name="SHOW_INTERMEDIATE" value="true" />
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
<entry key="gemspec" value="3" />
|
|
61
61
|
<entry key="gitignore" value="1" />
|
|
62
62
|
<entry key="md" value="3" />
|
|
63
|
-
<entry key="rb" value="
|
|
63
|
+
<entry key="rb" value="11" />
|
|
64
64
|
<entry key="txt" value="1" />
|
|
65
65
|
<entry key="yml" value="1" />
|
|
66
66
|
</counts>
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
<counts>
|
|
70
70
|
<entry key="Markdown" value="3" />
|
|
71
71
|
<entry key="PLAIN_TEXT" value="2" />
|
|
72
|
-
<entry key="Ruby" value="
|
|
72
|
+
<entry key="Ruby" value="16" />
|
|
73
73
|
<entry key="YAML" value="1" />
|
|
74
74
|
</counts>
|
|
75
75
|
</usages-collector>
|
|
@@ -77,13 +77,13 @@
|
|
|
77
77
|
<counts>
|
|
78
78
|
<entry key="gemspec" value="82" />
|
|
79
79
|
<entry key="md" value="1307" />
|
|
80
|
-
<entry key="rb" value="
|
|
80
|
+
<entry key="rb" value="3638" />
|
|
81
81
|
</counts>
|
|
82
82
|
</usages-collector>
|
|
83
83
|
<usages-collector id="statistics.file.types.edit">
|
|
84
84
|
<counts>
|
|
85
85
|
<entry key="Markdown" value="1116" />
|
|
86
|
-
<entry key="Ruby" value="
|
|
86
|
+
<entry key="Ruby" value="3911" />
|
|
87
87
|
</counts>
|
|
88
88
|
</usages-collector>
|
|
89
89
|
<usages-collector id="statistics.js.language.service.starts" />
|
|
@@ -93,15 +93,20 @@
|
|
|
93
93
|
</component>
|
|
94
94
|
<component name="FileEditorManager">
|
|
95
95
|
<leaf>
|
|
96
|
-
<file pinned="false" current-in-tab="
|
|
96
|
+
<file pinned="false" current-in-tab="false">
|
|
97
97
|
<entry file="file://$PROJECT_DIR$/test/cpay_test.rb">
|
|
98
98
|
<provider selected="true" editor-type-id="text-editor">
|
|
99
|
-
<state relative-caret-position="
|
|
100
|
-
<caret line="
|
|
99
|
+
<state relative-caret-position="310">
|
|
100
|
+
<caret line="113" column="18" selection-start-line="113" selection-start-column="18" selection-end-line="113" selection-end-column="18" />
|
|
101
101
|
</state>
|
|
102
102
|
</provider>
|
|
103
103
|
</entry>
|
|
104
104
|
</file>
|
|
105
|
+
<file pinned="false" current-in-tab="false">
|
|
106
|
+
<entry file="file://$PROJECT_DIR$/test/test_helper.rb">
|
|
107
|
+
<provider selected="true" editor-type-id="text-editor" />
|
|
108
|
+
</entry>
|
|
109
|
+
</file>
|
|
105
110
|
<file pinned="false" current-in-tab="false">
|
|
106
111
|
<entry file="file://$PROJECT_DIR$/Gemfile">
|
|
107
112
|
<provider selected="true" editor-type-id="text-editor" />
|
|
@@ -121,15 +126,15 @@
|
|
|
121
126
|
<entry file="file://$PROJECT_DIR$/README.md">
|
|
122
127
|
<provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
|
|
123
128
|
<state split_layout="SPLIT">
|
|
124
|
-
<first_editor relative-caret-position="
|
|
125
|
-
<caret line="
|
|
129
|
+
<first_editor relative-caret-position="273">
|
|
130
|
+
<caret line="126" column="35" lean-forward="true" selection-start-line="126" selection-start-column="35" selection-end-line="126" selection-end-column="35" />
|
|
126
131
|
</first_editor>
|
|
127
132
|
<second_editor />
|
|
128
133
|
</state>
|
|
129
134
|
</provider>
|
|
130
135
|
</entry>
|
|
131
136
|
</file>
|
|
132
|
-
<file pinned="false" current-in-tab="
|
|
137
|
+
<file pinned="false" current-in-tab="true">
|
|
133
138
|
<entry file="file://$PROJECT_DIR$/lib/cpay/version.rb">
|
|
134
139
|
<provider selected="true" editor-type-id="text-editor">
|
|
135
140
|
<state relative-caret-position="21">
|
|
@@ -141,8 +146,8 @@
|
|
|
141
146
|
<file pinned="false" current-in-tab="false">
|
|
142
147
|
<entry file="file://$PROJECT_DIR$/lib/cpay.rb">
|
|
143
148
|
<provider selected="true" editor-type-id="text-editor">
|
|
144
|
-
<state relative-caret-position="
|
|
145
|
-
<caret line="
|
|
149
|
+
<state relative-caret-position="403">
|
|
150
|
+
<caret line="251" column="9" lean-forward="true" selection-start-line="251" selection-start-column="9" selection-end-line="251" selection-end-column="9" />
|
|
146
151
|
</state>
|
|
147
152
|
</provider>
|
|
148
153
|
</entry>
|
|
@@ -170,8 +175,8 @@
|
|
|
170
175
|
<option value="$PROJECT_DIR$/cpay.gemspec" />
|
|
171
176
|
<option value="$PROJECT_DIR$/lib/cpay.rb" />
|
|
172
177
|
<option value="$PROJECT_DIR$/README.md" />
|
|
173
|
-
<option value="$PROJECT_DIR$/lib/cpay/version.rb" />
|
|
174
178
|
<option value="$PROJECT_DIR$/test/cpay_test.rb" />
|
|
179
|
+
<option value="$PROJECT_DIR$/lib/cpay/version.rb" />
|
|
175
180
|
</list>
|
|
176
181
|
</option>
|
|
177
182
|
</component>
|
|
@@ -285,44 +290,44 @@
|
|
|
285
290
|
<option name="number" value="Default" />
|
|
286
291
|
<option name="presentableId" value="Default" />
|
|
287
292
|
<updated>1540542021525</updated>
|
|
288
|
-
<workItem from="1540542023212" duration="
|
|
293
|
+
<workItem from="1540542023212" duration="25343000" />
|
|
289
294
|
</task>
|
|
290
295
|
<servers />
|
|
291
296
|
</component>
|
|
292
297
|
<component name="TestHistory">
|
|
293
|
-
<history-entry file="test_it_does_something_useful__cpay - 2018.10.27 at
|
|
298
|
+
<history-entry file="test_it_does_something_useful__cpay - 2018.10.27 at 11h 51m 29s.xml">
|
|
294
299
|
<configuration name="test_it_does_something_useful: cpay" configurationId="TestUnitRunConfigurationType" />
|
|
295
300
|
</history-entry>
|
|
296
|
-
<history-entry file="test_it_does_something_useful__cpay - 2018.10.27 at
|
|
301
|
+
<history-entry file="test_it_does_something_useful__cpay - 2018.10.27 at 11h 51m 34s.xml">
|
|
297
302
|
<configuration name="test_it_does_something_useful: cpay" configurationId="TestUnitRunConfigurationType" />
|
|
298
303
|
</history-entry>
|
|
299
|
-
<history-entry file="test_it_does_something_useful__cpay - 2018.10.27 at
|
|
304
|
+
<history-entry file="test_it_does_something_useful__cpay - 2018.10.27 at 11h 53m 20s.xml">
|
|
300
305
|
<configuration name="test_it_does_something_useful: cpay" configurationId="TestUnitRunConfigurationType" />
|
|
301
306
|
</history-entry>
|
|
302
|
-
<history-entry file="test_it_does_something_useful__cpay - 2018.10.27 at
|
|
307
|
+
<history-entry file="test_it_does_something_useful__cpay - 2018.10.27 at 12h 36m 00s.xml">
|
|
303
308
|
<configuration name="test_it_does_something_useful: cpay" configurationId="TestUnitRunConfigurationType" />
|
|
304
309
|
</history-entry>
|
|
305
|
-
<history-entry file="test_it_does_something_useful__cpay - 2018.10.27 at
|
|
310
|
+
<history-entry file="test_it_does_something_useful__cpay - 2018.10.27 at 12h 37m 10s.xml">
|
|
306
311
|
<configuration name="test_it_does_something_useful: cpay" configurationId="TestUnitRunConfigurationType" />
|
|
307
312
|
</history-entry>
|
|
308
|
-
<history-entry file="test_it_does_something_useful__cpay - 2018.10.27 at
|
|
313
|
+
<history-entry file="test_it_does_something_useful__cpay - 2018.10.27 at 12h 37m 35s.xml">
|
|
309
314
|
<configuration name="test_it_does_something_useful: cpay" configurationId="TestUnitRunConfigurationType" />
|
|
310
315
|
</history-entry>
|
|
311
|
-
<history-entry file="test_it_does_something_useful__cpay - 2018.10.27 at
|
|
316
|
+
<history-entry file="test_it_does_something_useful__cpay - 2018.10.27 at 12h 38m 11s.xml">
|
|
312
317
|
<configuration name="test_it_does_something_useful: cpay" configurationId="TestUnitRunConfigurationType" />
|
|
313
318
|
</history-entry>
|
|
314
|
-
<history-entry file="test_it_does_something_useful__cpay - 2018.10.27 at
|
|
319
|
+
<history-entry file="test_it_does_something_useful__cpay - 2018.10.27 at 12h 39m 50s.xml">
|
|
315
320
|
<configuration name="test_it_does_something_useful: cpay" configurationId="TestUnitRunConfigurationType" />
|
|
316
321
|
</history-entry>
|
|
317
|
-
<history-entry file="test_it_does_something_useful__cpay - 2018.10.27 at
|
|
322
|
+
<history-entry file="test_it_does_something_useful__cpay - 2018.10.27 at 12h 40m 02s.xml">
|
|
318
323
|
<configuration name="test_it_does_something_useful: cpay" configurationId="TestUnitRunConfigurationType" />
|
|
319
324
|
</history-entry>
|
|
320
|
-
<history-entry file="test_it_does_something_useful__cpay - 2018.10.27 at
|
|
325
|
+
<history-entry file="test_it_does_something_useful__cpay - 2018.10.27 at 12h 40m 15s.xml">
|
|
321
326
|
<configuration name="test_it_does_something_useful: cpay" configurationId="TestUnitRunConfigurationType" />
|
|
322
327
|
</history-entry>
|
|
323
328
|
</component>
|
|
324
329
|
<component name="TimeTrackingManager">
|
|
325
|
-
<option name="totallyTimeSpent" value="
|
|
330
|
+
<option name="totallyTimeSpent" value="25343000" />
|
|
326
331
|
</component>
|
|
327
332
|
<component name="ToolWindowManager">
|
|
328
333
|
<frame x="0" y="0" width="1680" height="1050" extended-state="0" />
|
|
@@ -356,9 +361,6 @@
|
|
|
356
361
|
<option name="myLimit" value="2678400000" />
|
|
357
362
|
</component>
|
|
358
363
|
<component name="editorHistoryManager">
|
|
359
|
-
<entry file="file://$PROJECT_DIR$/test/test_helper.rb">
|
|
360
|
-
<provider selected="true" editor-type-id="text-editor" />
|
|
361
|
-
</entry>
|
|
362
364
|
<entry file="file://$USER_HOME$/.rbenv/versions/2.5.1/lib/ruby/2.5.0/json/common.rb">
|
|
363
365
|
<provider selected="true" editor-type-id="text-editor">
|
|
364
366
|
<state relative-caret-position="196">
|
|
@@ -412,32 +414,35 @@
|
|
|
412
414
|
</entry>
|
|
413
415
|
<entry file="file://$PROJECT_DIR$/lib/cpay.rb">
|
|
414
416
|
<provider selected="true" editor-type-id="text-editor">
|
|
415
|
-
<state relative-caret-position="
|
|
416
|
-
<caret line="
|
|
417
|
+
<state relative-caret-position="403">
|
|
418
|
+
<caret line="251" column="9" lean-forward="true" selection-start-line="251" selection-start-column="9" selection-end-line="251" selection-end-column="9" />
|
|
417
419
|
</state>
|
|
418
420
|
</provider>
|
|
419
421
|
</entry>
|
|
420
422
|
<entry file="file://$PROJECT_DIR$/README.md">
|
|
421
423
|
<provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
|
|
422
424
|
<state split_layout="SPLIT">
|
|
423
|
-
<first_editor relative-caret-position="
|
|
424
|
-
<caret line="
|
|
425
|
+
<first_editor relative-caret-position="273">
|
|
426
|
+
<caret line="126" column="35" lean-forward="true" selection-start-line="126" selection-start-column="35" selection-end-line="126" selection-end-column="35" />
|
|
425
427
|
</first_editor>
|
|
426
428
|
<second_editor />
|
|
427
429
|
</state>
|
|
428
430
|
</provider>
|
|
429
431
|
</entry>
|
|
430
|
-
<entry file="file://$PROJECT_DIR$/
|
|
432
|
+
<entry file="file://$PROJECT_DIR$/test/cpay_test.rb">
|
|
431
433
|
<provider selected="true" editor-type-id="text-editor">
|
|
432
|
-
<state relative-caret-position="
|
|
433
|
-
<caret line="
|
|
434
|
+
<state relative-caret-position="310">
|
|
435
|
+
<caret line="113" column="18" selection-start-line="113" selection-start-column="18" selection-end-line="113" selection-end-column="18" />
|
|
434
436
|
</state>
|
|
435
437
|
</provider>
|
|
436
438
|
</entry>
|
|
437
|
-
<entry file="file://$PROJECT_DIR$/test/
|
|
439
|
+
<entry file="file://$PROJECT_DIR$/test/test_helper.rb">
|
|
440
|
+
<provider selected="true" editor-type-id="text-editor" />
|
|
441
|
+
</entry>
|
|
442
|
+
<entry file="file://$PROJECT_DIR$/lib/cpay/version.rb">
|
|
438
443
|
<provider selected="true" editor-type-id="text-editor">
|
|
439
|
-
<state relative-caret-position="
|
|
440
|
-
<caret line="
|
|
444
|
+
<state relative-caret-position="21">
|
|
445
|
+
<caret line="1" column="18" selection-start-line="1" selection-start-column="18" selection-end-line="1" selection-end-column="18" />
|
|
441
446
|
</state>
|
|
442
447
|
</provider>
|
|
443
448
|
</entry>
|
data/README.md
CHANGED
|
@@ -121,24 +121,19 @@ Or install it yourself as:
|
|
|
121
121
|
accno: accno, #银行卡账号
|
|
122
122
|
accname: accname, #姓名
|
|
123
123
|
remark: remark, #备注
|
|
124
|
+
tranTime: tranTime,#交易时间 Time.now.strftime('%Y%m%d%H%M%S'),查单时需要
|
|
124
125
|
mid: mid, #商户id
|
|
125
126
|
publickey: publickey, #公钥
|
|
126
127
|
privatekey: privatekey, #私钥
|
|
127
128
|
}
|
|
128
129
|
ret = Cpay::Sand::Draw.agentpay(p)
|
|
129
|
-
|
|
130
|
-
if
|
|
131
|
-
|
|
130
|
+
puts ret
|
|
131
|
+
if ret[:next]
|
|
132
|
+
puts '状态不明,需要通过查单接口查询状态。'
|
|
133
|
+
elsif ret[:ok]
|
|
134
|
+
puts '订单成功'
|
|
132
135
|
else
|
|
133
|
-
|
|
134
|
-
end
|
|
135
|
-
#-----------------------------------------
|
|
136
|
-
if ret[:data]['resultFlag']=='0'
|
|
137
|
-
#代付成功
|
|
138
|
-
elsif ret[:data]['resultFlag']=='1'
|
|
139
|
-
#代付成功
|
|
140
|
-
else
|
|
141
|
-
# 状态不明
|
|
136
|
+
puts '订单失败'
|
|
142
137
|
end
|
|
143
138
|
```
|
|
144
139
|
- 查询余额
|
|
@@ -150,30 +145,33 @@ Or install it yourself as:
|
|
|
150
145
|
privatekey: privatekey, #私钥
|
|
151
146
|
}
|
|
152
147
|
ret = Cpay::Sand::Draw.queryBalance(p)
|
|
153
|
-
|
|
154
|
-
if
|
|
155
|
-
|
|
148
|
+
puts ret
|
|
149
|
+
if ret[:cpay][:ok]
|
|
150
|
+
puts ret[:cpay][:balance]
|
|
151
|
+
else
|
|
152
|
+
puts "查询失败"
|
|
156
153
|
end
|
|
157
154
|
|
|
158
155
|
```
|
|
159
156
|
- 代付订单查询
|
|
160
157
|
```ruby
|
|
161
|
-
p={
|
|
158
|
+
p = {
|
|
162
159
|
orderid: orderid, #订单号
|
|
163
160
|
mid: mid, #商户id
|
|
164
|
-
tranTime: tranTime
|
|
161
|
+
tranTime: tranTime,#订单时间
|
|
165
162
|
publickey: publickey, #公钥
|
|
166
163
|
privatekey: privatekey, #私钥
|
|
167
164
|
}
|
|
168
165
|
ret = Cpay::Sand::Draw.queryOrder(p)
|
|
169
|
-
|
|
166
|
+
puts ret
|
|
170
167
|
if ret[:cpay][:next]
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
168
|
+
puts '状态不明,需要通过查单接口查询状态。'
|
|
169
|
+
elsif ret[:cpay][:ok]
|
|
170
|
+
puts '订单成功'
|
|
171
|
+
else
|
|
172
|
+
puts '订单失败'
|
|
176
173
|
end
|
|
174
|
+
|
|
177
175
|
```
|
|
178
176
|
|
|
179
177
|
## License
|
data/lib/cpay.rb
CHANGED
|
@@ -96,15 +96,6 @@ module Cpay
|
|
|
96
96
|
end
|
|
97
97
|
|
|
98
98
|
def notify(c_params)
|
|
99
|
-
=begin
|
|
100
|
-
return {
|
|
101
|
-
orderid:'12311',
|
|
102
|
-
amount:'1222',
|
|
103
|
-
transid: '23',
|
|
104
|
-
successcode: 'success',
|
|
105
|
-
state: '1',
|
|
106
|
-
}
|
|
107
|
-
=end
|
|
108
99
|
sign = c_params[:sign]
|
|
109
100
|
data = c_params[:data]
|
|
110
101
|
publickey = c_params[:publickey]
|
|
@@ -192,6 +183,7 @@ return {
|
|
|
192
183
|
cgi_parse = CGI.parse(Utils.url_decode(res.body))
|
|
193
184
|
unless Utils.rsa_verify(cgi_parse['data'][0], cgi_parse['sign'][0].to_s.gsub(' ', '+'), c_params[:publickey])
|
|
194
185
|
ret[:code] = 2
|
|
186
|
+
ret[:msg] = "签名错误"
|
|
195
187
|
else
|
|
196
188
|
ret[:code] = 0
|
|
197
189
|
ret[:data] = JSON(cgi_parse['data'][0])
|
|
@@ -210,14 +202,13 @@ return {
|
|
|
210
202
|
extend self
|
|
211
203
|
|
|
212
204
|
def agentpay(c_params)
|
|
213
|
-
tranTime = Time.now.strftime('%Y%m%d%H%M%S')
|
|
214
205
|
b_params = {
|
|
215
206
|
uri: URI("https://caspay.sandpay.com.cn/agent-main/openapi/agentpay"),
|
|
216
207
|
pt: {
|
|
217
208
|
orderCode: c_params[:orderid].to_s,
|
|
218
209
|
version: '01',
|
|
219
210
|
productId: '00000004',
|
|
220
|
-
tranTime: tranTime,
|
|
211
|
+
tranTime: c_params[:tranTime],
|
|
221
212
|
tranAmt: c_params[:amount].to_s.rjust(12, '0'),
|
|
222
213
|
currencyCode: '156',
|
|
223
214
|
accAttr: '0',
|
|
@@ -231,9 +222,12 @@ return {
|
|
|
231
222
|
|
|
232
223
|
ret = base_draw_act b_params, c_params
|
|
233
224
|
ret[:cpay] = {
|
|
234
|
-
msg: ret[:data]['
|
|
235
|
-
ok: ret[:data]['resultFlag'] == '0',
|
|
236
|
-
|
|
225
|
+
msg: ret[:data]['respDesc'],
|
|
226
|
+
ok: ret[:code] == 0 && (ret[:data]['resultFlag'] == '0'),
|
|
227
|
+
next: ret[:code] != 0 || ret[:data]['resultFlag'] == '2',
|
|
228
|
+
tranTime: c_params[:tranTime],
|
|
229
|
+
orderid: c_params[:orderid].to_s,
|
|
230
|
+
flag: ret[:data]['resultFlag']
|
|
237
231
|
}
|
|
238
232
|
ret
|
|
239
233
|
end
|
|
@@ -252,8 +246,9 @@ return {
|
|
|
252
246
|
|
|
253
247
|
ret = base_draw_act b_params, c_params
|
|
254
248
|
ret[:cpay] = {
|
|
255
|
-
ok: ret[:data]['respCode'] == '0000',
|
|
256
|
-
msg: ret[:data]['balance'].to_i
|
|
249
|
+
ok: ret[:code] == 0 && ret[:data]['respCode'] == '0000',
|
|
250
|
+
msg: ret[:data]['balance'].to_i,
|
|
251
|
+
balance: ret[:data]['balance'].to_i
|
|
257
252
|
}
|
|
258
253
|
ret
|
|
259
254
|
|
|
@@ -272,8 +267,8 @@ return {
|
|
|
272
267
|
}
|
|
273
268
|
ret = base_draw_act b_params, c_params
|
|
274
269
|
ret[:cpay] = {
|
|
275
|
-
ok: ret[:data]['resultFlag'] == '0',
|
|
276
|
-
next: ret[:
|
|
270
|
+
ok: ret[:code] == 0 && ret[:data]['resultFlag'] == '0',
|
|
271
|
+
next: ret[:code] != 0 || ret[:data]['resultFlag'] == '2',
|
|
277
272
|
msg: ''
|
|
278
273
|
}
|
|
279
274
|
ret
|
|
@@ -318,6 +313,7 @@ return {
|
|
|
318
313
|
ret[:data] = JSON(res_data)
|
|
319
314
|
else
|
|
320
315
|
ret[:code] = 2
|
|
316
|
+
ret[:msg] = "签名错误"
|
|
321
317
|
end
|
|
322
318
|
rescue Exception => ex
|
|
323
319
|
ret[:msg] = ex.to_s
|
data/lib/cpay/version.rb
CHANGED