wechat_payment 2.0.13 → 2.0.14

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: 6f80eae6a4f7482e85fb59eb39fabf6a4d48b44c75020030f3df92e714af92dd
4
- data.tar.gz: f93e93c6aa13ad0bc7f175a21e0ae0042466f85e1add3ecfdc66d6f4d4945857
3
+ metadata.gz: 383f51dd9ca42a1ef6dd1231871e604fc7d985fba7990b5750759e698c5b9e8b
4
+ data.tar.gz: 4adbdbfbc709dc96cf6df6a038f721589fa7f11b7dfb8d744685b01bc16060b1
5
5
  SHA512:
6
- metadata.gz: d6a462950e6339c60ffe909b9e18e344e21fc26e0235510651269f8dbb099ddcef604bc0611023d0c36ab9e82e9a8d2dc4f5bb75dd2999a4ed3096308ff08cec
7
- data.tar.gz: f9a7f2d102f2bd681a3b408ffb4111a8e68c7ebca95472e8ed0487f299ccf4f1d432fdd5333a0a940553a13b4d35bcaf8ba9cacae3dcd237dbab0326fe2131e7
6
+ metadata.gz: 90b55232826903f31a1aca89a4d67e620ff3a9ba73f62c7d53916f2da30b12fe3612827c5883974f8cec8a1c7bd6efad715988f3c732baa333f8c690985b32cd
7
+ data.tar.gz: aa71fc09c2d6fe3e8b0db85758c3a9aa4a42a0f1d38fa01691357171590b8608db3635b6240a224110f95830f512cd58a9307e71f9f0f8a49ff2820ef7151152
@@ -28,7 +28,7 @@ module WechatPayment
28
28
  # 生成交易编号
29
29
  def gen_out_trade_no
30
30
  loop do
31
- out_trade_no = "#{Time.current.to_i}#{SecureRandom.random_number(999_999_999)}"
31
+ out_trade_no = "#{WechatPayment.order_no_prefix}#{Time.current.to_i}#{SecureRandom.random_number(999_999_999)}"
32
32
  records_count = WechatPayment::PaymentOrder.where(out_trade_no: out_trade_no).count
33
33
  if records_count == 0
34
34
  self.out_trade_no = out_trade_no
@@ -16,4 +16,7 @@ WechatPayment.setup do |config|
16
16
  config.sub_appid = "wx8f9f912623456789"
17
17
  config.sub_mch_id = "1234911291"
18
18
  config.sub_app_secret = "88888231e2f3a21152d163f61b99999"
19
+
20
+ # 生成的订单编号前缀
21
+ # config.order_no_prefix = "wx_"
19
22
  end
@@ -1,3 +1,3 @@
1
1
  module WechatPayment
2
- VERSION = '2.0.13'
2
+ VERSION = '2.0.14'
3
3
  end
@@ -5,7 +5,7 @@ module WechatPayment
5
5
 
6
6
  class << self
7
7
  attr_reader :apiclient_cert, :apiclient_key
8
- attr_accessor :appid, :app_secret, :mch_id, :sub_appid, :sub_app_secret, :sub_mch_id, :key, :cert_path, :host
8
+ attr_accessor :appid, :app_secret, :mch_id, :sub_appid, :sub_app_secret, :sub_mch_id, :key, :cert_path, :host, :order_no_prefix
9
9
  end
10
10
 
11
11
  def self.setup
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wechat_payment
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.13
4
+ version: 2.0.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - ian