ubox 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +36 -2
  3. data/lib/ubox/version.rb +1 -1
  4. data/lib/ubox.rb +7 -2
  5. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 249f22e3cb2b990d51888c7deb9312410aa2b628
4
- data.tar.gz: 294f9fb278bd81ac099bb97b57893239e00e29ca
3
+ metadata.gz: e097388906c4e6aa77bc4af169551815113aebce
4
+ data.tar.gz: e124a2f36363f2b2de0eec6b555196028c2d8d6f
5
5
  SHA512:
6
- metadata.gz: 26071bd34a3dd9fb7a9681eb6c3da35ab846a66ae2a3cba9c5d4d77686366fcd3d1dfafc2a568c3cff943148d0c88ca5d378b747e2718b6fb5781ffabda3af06
7
- data.tar.gz: e8efa21256ee819cbc4d9665ca78497d24170e7a516280a36e3c8cad6e6815c4e6af32da791c7f921dd948323fd616f090c85221326a6c52358bcd4c7f963e58
6
+ metadata.gz: 8a54e759c7142fc3ab699e9d59a32b8bfd397ea7c7250323acf63c8cac772468c2945f4196b9ad4fea0869eb512c39700c7728919c7bd3589784ed1e159e62b0
7
+ data.tar.gz: 8161162d0b7ea910f5f1119bc85ee9815ff8abf7b92d3ae308dbc3ca746ebf7e49139e38c25f42eb7d52f7bd14f01e5d65237438e5db86142df26ad261e48652
data/README.md CHANGED
@@ -36,7 +36,7 @@ Or install it yourself as:
36
36
 
37
37
  ###getProductDetail 获取商品信息(扫码)
38
38
  ```ruby
39
- Ubox.product_detail(qr_string:'http://v.dev.uboxol.com/qr/c0081801_10000870_1')
39
+ detail=Ubox.product_detail(qr_string:'http://v.dev.uboxol.com/qr/c0081801_10000870_1')
40
40
  ```
41
41
 
42
42
  ```json
@@ -73,7 +73,6 @@ Ubox.product_detail(qr_string:'http://v.dev.uboxol.com/qr/c0081801_10000870_1')
73
73
  ```
74
74
  ### notifyOrder 扫码下单请求
75
75
  ```ruby
76
- detail = Ubox.product_detail(qr_string:'http://v.dev.uboxol.com/qr/c0081801_10000870_1')
77
76
  notify = Ubox.notify_order(tran_id: detail['body']['tran_id'],
78
77
  retain_period: 300,
79
78
  app_tran_id: Random.rand_str(32),
@@ -89,6 +88,41 @@ notify = Ubox.notify_order(tran_id: detail['body']['tran_id'],
89
88
  }
90
89
  ```
91
90
 
91
+ ### notifyPament 买取货码(支付结果通知)
92
+
93
+ ```ruby
94
+ payment = Ubox.notify_payment(tran_id: detail['body']['tran_id'],
95
+ pay_time: Time.now.to_i,
96
+ app_current_time: Time.now.to_i,
97
+ deliver_now: true)
98
+ ```
99
+ #### 商品已售空
100
+ ```json
101
+ {"head":{
102
+ "return_code":410,
103
+ "return_msg":"该商品已售空"
104
+ }
105
+ }
106
+ ```
107
+
108
+ ### getTradeOrderStatus 出货结果询问
109
+
110
+ ```ruby
111
+ status = Ubox.trade_order_status(tran_id: detail['body']['tran_id'])
112
+ ```
113
+ #### 出货失败
114
+ ```json
115
+ {"head":{
116
+ "return_code":200,
117
+ "return_msg":"正常响应"
118
+ },
119
+ "body":{
120
+ "code":500,
121
+ "msg":"出货失败"
122
+ }
123
+ }
124
+ ```
125
+
92
126
  ## Development
93
127
 
94
128
  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/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Ubox
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.5"
3
3
  end
data/lib/ubox.rb CHANGED
@@ -36,7 +36,6 @@ module Ubox
36
36
  puts attributes
37
37
  params = {
38
38
  app_id: self.config.app_id,
39
- tran_id: attributes[:tran_id]
40
39
  }.merge(attributes)
41
40
  params = params.merge({sign: self.sign(params)})
42
41
 
@@ -60,9 +59,15 @@ module Ubox
60
59
  end
61
60
 
62
61
  #m买取货吗(支付结果通知)
63
- #notify_payment(tran_id:xxx,pay_time:13311111,app_current_time:true,deliver_now:true)
62
+ #notify_payment(tran_id:xxx,pay_time: Time.now.to_i,app_current_time: Time.now.to_i,deliver_now:true)
64
63
  def notify_payment(attributes)
65
64
  post_request('/notifyPayment', attributes)
66
65
  end
67
66
 
67
+
68
+ #出货结果询问
69
+ #trade_order_status(tran_id:xxx)
70
+ def trade_order_status(attributes)
71
+ post_request('/getTradeOrderStatus', attributes)
72
+ end
68
73
  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.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Saxer