ubox 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +16 -0
- data/lib/ubox.rb +18 -0
- data/lib/ubox/version.rb +1 -1
- data/ubox.gemspec +2 -0
- metadata +15 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 37c543c515a9c858bb59e2a555c26d7e21543b16
|
4
|
+
data.tar.gz: a8df0afb085b8fdefb62f92e5dbbe2bc44c21016
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 61b29083aadc4cdc90f8e32c041d3c1a6078705b27143705f911adbe0b1269e19763c21eb007ba2519d2bd8028c73e304ac0ac120aa53201c1de465c924aa515
|
7
|
+
data.tar.gz: 332b56eaff91bd2129c43352652051a36f7ee345610bc36bfb7d26375ed7449eafaf02fd9d857248777280288976eaa44c607f3fc30e001473c80f27689c5afa
|
data/README.md
CHANGED
@@ -71,7 +71,23 @@ Ubox.product_detail('http://v.dev.uboxol.com/qr/c0081801_10000870_1')
|
|
71
71
|
}
|
72
72
|
}
|
73
73
|
```
|
74
|
+
### 扫码下单请求
|
75
|
+
```ruby
|
76
|
+
detail = Ubox.product_detail('http://v.dev.uboxol.com/qr/c0081801_10000870_1')
|
77
|
+
notify = Ubox.notify_order(tran_id: detail['body']['tran_id'],
|
78
|
+
retain_period: 300,
|
79
|
+
app_tran_id: Random.rand_str(32),
|
80
|
+
app_uid: Random.rand_str(32)
|
81
|
+
)
|
82
|
+
```
|
74
83
|
|
84
|
+
```json
|
85
|
+
{"head":{
|
86
|
+
"return_code":200,
|
87
|
+
"return_msg":"正常响应"
|
88
|
+
}
|
89
|
+
}
|
90
|
+
```
|
75
91
|
|
76
92
|
## Development
|
77
93
|
|
data/lib/ubox.rb
CHANGED
@@ -47,4 +47,22 @@ module Ubox
|
|
47
47
|
JSON.parse(body)
|
48
48
|
end
|
49
49
|
|
50
|
+
#扫码下单请求
|
51
|
+
#notify_order(tran_id:xxxx,retain_period:300,app_tran_id:xxxx,app_uid:uid)
|
52
|
+
def notify_order(attributes)
|
53
|
+
puts attributes
|
54
|
+
params = {
|
55
|
+
app_id: self.config.app_id,
|
56
|
+
tran_id: attributes[:tran_id]
|
57
|
+
}.merge(attributes)
|
58
|
+
params = params.merge({sign: self.sign(params)})
|
59
|
+
|
60
|
+
url = "#{self.config.api_url}/notifyOrder"
|
61
|
+
uri = URI(url)
|
62
|
+
res = Net::HTTP.post_form(uri, params)
|
63
|
+
|
64
|
+
body = res.body
|
65
|
+
JSON.parse(body)
|
66
|
+
end
|
67
|
+
|
50
68
|
end
|
data/lib/ubox/version.rb
CHANGED
data/ubox.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ubox
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Saxer
|
@@ -52,6 +52,20 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '3.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: core_extend
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 0.1.9
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 0.1.9
|
55
69
|
description: "友宝自动售货机开放API."
|
56
70
|
email:
|
57
71
|
- 15201280641@qq.com
|