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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: badaab7f029c707220f0f6d753abfda36ff33322
4
- data.tar.gz: 4f09c0631f505511928b35825f2a1cc94386968c
3
+ metadata.gz: 37c543c515a9c858bb59e2a555c26d7e21543b16
4
+ data.tar.gz: a8df0afb085b8fdefb62f92e5dbbe2bc44c21016
5
5
  SHA512:
6
- metadata.gz: 894991f42f1a1c109a90e5853abe63857a38e07ace8a3c1735eafd7d2d6c10b3418eb0b2ba91f11c15bb6cf74a9e150606f359c86d70d6a819bd8a4991567397
7
- data.tar.gz: 3475764e829252016a2c0b4b270e93c5e6ee69424725444ead769eb9e35d0495f4d26744272cc791972022f807037f4232fb0c16e52ab08f1bfbbcacd9a0609f
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
 
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Ubox
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
@@ -30,4 +30,6 @@ Gem::Specification.new do |spec|
30
30
  spec.add_development_dependency "bundler", "~> 1.11"
31
31
  spec.add_development_dependency "rake", "~> 10.0"
32
32
  spec.add_development_dependency "rspec", "~> 3.0"
33
+ spec.add_development_dependency "core_extend", "~> 0.1.9"
34
+
33
35
  end
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.2
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