wechat_payment 2.0.1 → 2.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b44bb7536575ad7bc8160b621db67776152c256c0bfe9ef3ea3b5b538097385f
4
- data.tar.gz: 6c5b38ea0075671aaabe84294ed3bacbfe2d7dbfeff5eb7f7dc05a53b8f8814a
3
+ metadata.gz: c61c4ab32413e5389896bde1f772149d3df02e74c4cdcd76973ed942c6e25009
4
+ data.tar.gz: b5d53616d2f40fa7c112ca57319f5d4c29606053ae291fb09aee8a8280674ea5
5
5
  SHA512:
6
- metadata.gz: 56c0da01b6bc6d44076616ea80cad48deb6bd68372743aff0b5defccb0394edc4f0990f814d21c698e4d763fe2a0a4a14260da153685526e326a38e5bbc89786
7
- data.tar.gz: cae818ffdb7fa29099a1d1565b2c8e29a76f1d019ad8bf097d75ee3992c8b01e54a9d80e66a45e8af9d04511eeb17fc1202279a18a56d5fe68df9d34e6964e27
6
+ metadata.gz: 9265a884ffd5b9a544644400bac0e2c89c75b87803fb95d9542e8e0cbfce76c8688928b9aad3aeaf54c67b261a0c7cb99d0f2021a749a7207cd4a35a40380c0c
7
+ data.tar.gz: 95e24b9a3941112ad5698a3cbbdf313c38f4755d0a2ecc0dcaca0c2ce4ddf62b4045bddac81b7fcdf24b394a4ede23d512b5db232436975f0165c60c08490df8
@@ -1,7 +1,9 @@
1
1
 
2
2
  class PaymentOrdersController < ApplicationController
3
3
  def index
4
+ @payment_orders = WechatPayment::PaymentOrder.by_state(params[:state])
4
5
 
6
+ render json: @payment_orders
5
7
  end
6
8
 
7
9
  end
@@ -25,8 +25,7 @@ module WechatPayment
25
25
  # 售出
26
26
  # @param [User] user
27
27
  # @return [WechatPaymentOrder]
28
- def sell_to(user)
29
-
28
+ def sell_to(user, with_info = {})
30
29
  persist_goods_data = {}.tap do |h|
31
30
  self.class.persist_goods_attrs.each do |attr|
32
31
  h[attr] = send(attr)
@@ -36,7 +35,8 @@ module WechatPayment
36
35
  user_goods = self.class.user_goods_model.constantize.create(
37
36
  self.class.goods_ref_field => self,
38
37
  self.class.user_ref_field => user,
39
- **persist_goods_data
38
+ **with_info,
39
+ **persist_goods_data,
40
40
  )
41
41
 
42
42
  user_goods.payment_orders.create(
@@ -14,8 +14,8 @@ module WechatPayment
14
14
  end
15
15
  end
16
16
 
17
- def buy(goods)
18
- goods.sell_to(me)
17
+ def buy(goods, with_info = {})
18
+ goods.sell_to(me, with_info)
19
19
  end
20
20
  end
21
21
  end
@@ -1,3 +1,3 @@
1
1
  module WechatPayment
2
- VERSION = '2.0.1'
2
+ VERSION = '2.0.2'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wechat_payment
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1
4
+ version: 2.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - ian
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-01-18 00:00:00.000000000 Z
11
+ date: 2022-01-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails