ubox 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +36 -2
- data/lib/ubox/version.rb +1 -1
- data/lib/ubox.rb +7 -2
- 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: e097388906c4e6aa77bc4af169551815113aebce
|
4
|
+
data.tar.gz: e124a2f36363f2b2de0eec6b555196028c2d8d6f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
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:
|
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
|