blsm-vd-core 0.3.9 → 0.4.0

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: f0cd1c3b20a562fbeed78474299a6f482d84b718
4
- data.tar.gz: cadccdc61a4713cab430405e9e79c1a52d7cc2ae
3
+ metadata.gz: bf07cda0da972dc53eac58aca880cdfbee8ff55d
4
+ data.tar.gz: 1f744ca8b99dc5e9c0ba68ce695d2606d4fd4e39
5
5
  SHA512:
6
- metadata.gz: 805b78c786f624d1861128c7f0feccd7af01b2df32f0007c865161559cd10f6b3d59fa8962c68938dbeb986ea7299308627bbb094ed2593c4fa6aba582a5db8b
7
- data.tar.gz: 8708a269cd769c282379d641232339aebde5552d6b920be6ed546c6b1fdb31ad103235d48c41be818b00b7119dad01a0662284fae5213b3be16afb2be485c296
6
+ metadata.gz: 10b1a91b040c16bfa282589a7467ea989a57a7f00ed61c605af4757c6a273229e8da68d21f96d378c2374d1922505aa3a190f2582b6f7f42e0c4381089b19f4b
7
+ data.tar.gz: 50e46ea162f5ba6d3181a55711848e0e5972649bd79bc33800cbff5a28ddffd3cf2defa6f2b8c909d73094f203c810e244263a1aa874cccc4d5ed839f0d6f382
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- blsm-vd-core (0.3.8)
4
+ blsm-vd-core (0.3.9)
5
5
 
6
6
  GEM
7
7
  remote: https://ruby.taobao.org/
@@ -34,7 +34,7 @@ GEM
34
34
  i18n (~> 0.6)
35
35
  multi_json (~> 1.0)
36
36
  arel (3.0.2)
37
- blsm-mp-wx (0.1.9)
37
+ blsm-mp-wx (0.2.3)
38
38
  builder (3.0.0)
39
39
  diff-lcs (1.2.5)
40
40
  erubis (2.7.0)
@@ -109,7 +109,7 @@ DEPENDENCIES
109
109
  activemodel (~> 3.2)
110
110
  activerecord (~> 3.2)
111
111
  activesupport (~> 3.2)
112
- blsm-mp-wx (~> 0.1.9)
112
+ blsm-mp-wx (~> 0.2.3)
113
113
  blsm-vd-core!
114
114
  bundler (~> 1.9)
115
115
  faraday (~> 0.9)
@@ -117,6 +117,3 @@ DEPENDENCIES
117
117
  rails (~> 3.2)
118
118
  rake (~> 10.0)
119
119
  rspec (~> 3.2)
120
-
121
- BUNDLED WITH
122
- 1.10.3
data/blsm-vd-core.gemspec CHANGED
@@ -37,5 +37,5 @@ Gem::Specification.new do |spec|
37
37
  spec.add_development_dependency "activerecord", "~> 3.2"
38
38
  spec.add_development_dependency "activesupport", "~> 3.2"
39
39
  spec.add_development_dependency "faraday", "~> 0.9"
40
- spec.add_development_dependency "blsm-mp-wx", "~> 0.1.9"
40
+ spec.add_development_dependency "blsm-mp-wx", "~> 0.2.3"
41
41
  end
@@ -1,3 +1,3 @@
1
1
  module BlsmVdCore
2
- VERSION = "0.3.9"
2
+ VERSION = "0.4.0"
3
3
  end
data/lib/blsm-vd-core.rb CHANGED
@@ -87,10 +87,12 @@ module BlsmVdCore
87
87
  def on_order_signed(order_id, sign_type)
88
88
  order = Order.where(id: order_id).first
89
89
  clearing_item = ClearingItem.where(order_id: order.id).first if order
90
+ seller = order.application.user if order && order.application
90
91
 
91
92
  #数据校验
92
93
  return ERROR_CODES[404] unless order
93
94
  return ERROR_CODES[4042] unless clearing_item
95
+ return ERROR_CODES[4045] unless seller
94
96
  return ERROR_CODES[0] if sign_type =~ /sign_ok/ && clearing_item.state.to_s =~ /CASH_BACK/
95
97
 
96
98
  #安全校验
@@ -98,20 +100,26 @@ module BlsmVdCore
98
100
  danger = VdInfoSec.dangerous?(vd_transaction)
99
101
  return danger if danger
100
102
 
101
- #货到付款(物流返款成功,订单完成)
102
- if sign_type =~ /sign_ok/ && order.pay_off_line?
103
+ #(物流返款成功,订单完成)
104
+ if sign_type =~ /sign_ok/
103
105
  note = Order.latest_notes(clearing_item, {username: '首趣'}, '标记物流返款')
104
106
  clearing_item.marking_confirm(note)
107
+
108
+ #物流返款通知
109
+ seller_notify = {touser: seller.openid, order_id: Order.encrypt(Order.encrypted_id_key, order.id.to_s), content: "【物流返款通知】"}
110
+ BlsmMpWx.create_msg(nil, seller.openid, seller_notify, 'order')
111
+
105
112
  VdInfoSec.committed(vd_transaction)
106
113
  return ERROR_CODES[200]
107
114
  end
108
115
 
116
+
109
117
  #签收失败(拒签)
110
118
  if sign_type =~ /sign_fail/
111
119
  VdInfoSec.committed(vd_transaction)
112
120
  user = order.application.user if order && order.application
113
121
  #拒签删除积分
114
- on_order_sign_fail(user.id,order_id) if user
122
+ on_order_sign_fail(user.id, order_id) if user
115
123
  if clearing_item.clearing && clearing_item.clearing.state == "BALANCED"
116
124
  i_clearing = clearing_item.clone
117
125
  i_clearing.clearing_id = nil
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blsm-vd-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.9
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - saxer
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2015-07-23 00:00:00.000000000 Z
12
+ date: 2015-09-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
@@ -143,14 +143,14 @@ dependencies:
143
143
  requirements:
144
144
  - - "~>"
145
145
  - !ruby/object:Gem::Version
146
- version: 0.1.9
146
+ version: 0.2.3
147
147
  type: :development
148
148
  prerelease: false
149
149
  version_requirements: !ruby/object:Gem::Requirement
150
150
  requirements:
151
151
  - - "~>"
152
152
  - !ruby/object:Gem::Version
153
- version: 0.1.9
153
+ version: 0.2.3
154
154
  description: 首趣微店核心模块,包含结算项的创建、更新、删除,微店主积分的更改等信息
155
155
  email:
156
156
  - 15201280641@qq.com