ubox 0.1.8 → 0.1.9
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/README.md +7 -0
- data/lib/ubox.rb +10 -1
- data/lib/ubox/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d4bff5aa97c0be41e28710e543f4477b8b86933c
|
4
|
+
data.tar.gz: 50fb98101cd0eb493e38370645cf837c2ea6bc7c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4d8b7f6ce132eceef2b00570c7e458169021fb69391d7064aa582f674571efb19473ccec2454fe23c2660bc1ef5f6c0afa8852fc3d3b3e94a1277b5b1734b0ae
|
7
|
+
data.tar.gz: 31196de226145ae11dc2d872889730fe186448e332236631c41b4c73f83eac737621dd8d3dcde71db453054ae2bc379b986fe00c4680b98e674521073c8de2ee
|
data/README.md
CHANGED
@@ -355,6 +355,13 @@ delivery_code = Ubox.order_code(vmid: '0061029',
|
|
355
355
|
}
|
356
356
|
```
|
357
357
|
|
358
|
+
### deliverTrade 出货接口
|
359
|
+
```ruby
|
360
|
+
deliver = Ubox.deliver_trade(tran_id: delivery_code['body']['delivery_code'])
|
361
|
+
```
|
362
|
+
```json
|
363
|
+
```
|
364
|
+
|
358
365
|
## Development
|
359
366
|
|
360
367
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
data/lib/ubox.rb
CHANGED
@@ -33,17 +33,20 @@ module Ubox
|
|
33
33
|
|
34
34
|
|
35
35
|
def post_request(api_path, attributes)
|
36
|
-
puts attributes
|
37
36
|
params = {
|
38
37
|
app_id: self.config.app_id,
|
39
38
|
}.merge(attributes)
|
40
39
|
params = params.merge({sign: self.sign(params)})
|
41
40
|
|
41
|
+
puts "\n\n#{api_path}\n"
|
42
|
+
puts params
|
43
|
+
|
42
44
|
url = "#{self.config.api_url}/#{api_path}"
|
43
45
|
uri = URI(url)
|
44
46
|
res = Net::HTTP.post_form(uri, params)
|
45
47
|
|
46
48
|
body = res.body
|
49
|
+
puts body
|
47
50
|
JSON.parse(body)
|
48
51
|
end
|
49
52
|
|
@@ -85,4 +88,10 @@ module Ubox
|
|
85
88
|
def order_code(attributes)
|
86
89
|
post_request('/orderCode', attributes)
|
87
90
|
end
|
91
|
+
|
92
|
+
#出货接口
|
93
|
+
def deliver_trade(attributes)
|
94
|
+
post_request('/deliverTrade', attributes)
|
95
|
+
end
|
96
|
+
|
88
97
|
end
|
data/lib/ubox/version.rb
CHANGED