vnpay 0.0.1 → 0.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: 305b30b9a2b6b8c2c0cd6ed08ce2f926c48531131db2da26119c77b4e2ac88bf
4
- data.tar.gz: d7e8e3abfd2aaab69f0d1d7b4082d54dfa5c52a98053544cf2452e7d7c4a2743
3
+ metadata.gz: a1cfaf461ce01c3cec27cb39139e07386d13e7242a122336b68f15e8f61ddcb6
4
+ data.tar.gz: 718b20676b4b9e578a32dcc9dcee2afe09c15e727fe594b8b8bf7553459e579b
5
5
  SHA512:
6
- metadata.gz: 01eaa52fabc8099305e7195b413b3d25414aff4b22c4f2f414b2eaa690f5c9730e9b79304d0b2c7f52b1da352c818139dc7d2a3237c4d2ac48e443a8e55f82b1
7
- data.tar.gz: 292033e4dd1227ff117b31cb12cf2451428e2937eacef0b39bff6f2e81eebcfcd0619933f324a25adf3540f6f4127cc150534670d06a304cdea69a561b3fe3b8
6
+ metadata.gz: 81330b3a293f8f247290138ced86bd2f19a8a99ba7883149c0b2f04c790ab1bdc1b262500268116abec8f9f18b8fd18585a4b3b03d863dd4856ff37fec8452e2
7
+ data.tar.gz: 316fab10bd1381897a54def919d25850041001933375978da328cc60b93096af755fd0a7375fa3723b2937793ccf7b4abe26cffd632244f6ed826a00d9041461
@@ -1,13 +1,4 @@
1
1
  require 'order_info'
2
- require 'vnpay/url'
2
+ require 'vnpay/config'
3
3
  require 'vnpay/verify'
4
-
5
- class Vnpay
6
- def self.configuration
7
- @configuration ||= OpenStruct.new
8
- end
9
-
10
- def self.configure
11
- yield(configuration)
12
- end
13
- end
4
+ require 'vnpay/url'
@@ -0,0 +1,11 @@
1
+ module Vnpay
2
+ class Config
3
+ def self.configuration
4
+ @configuration ||= OpenStruct.new
5
+ end
6
+
7
+ def self.configure
8
+ yield(configuration)
9
+ end
10
+ end
11
+ end
@@ -41,7 +41,7 @@ module Vnpay
41
41
  end
42
42
 
43
43
  def config
44
- @config ||= Vnpay.configuration
44
+ @config ||= Vnpay::Config.configuration
45
45
  end
46
46
 
47
47
  def url_encode(string)
@@ -31,7 +31,7 @@ module Vnpay
31
31
  def calculated_secure_hash
32
32
  REJECTED_PARAMS.each { |key| params.delete(key) }
33
33
  data = params.sort.map { |k, v| "#{k}=#{v}" }.join('&')
34
- Digest::MD5.hexdigest(Vnpay.configuration.secret_key + data)
34
+ Digest::MD5.hexdigest(Vnpay::Config.configuration.secret_key + data)
35
35
  end
36
36
 
37
37
  def normalize_params
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vnpay
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - nhannvu19
@@ -35,6 +35,7 @@ files:
35
35
  - Rakefile
36
36
  - lib/order_info.rb
37
37
  - lib/vnpay.rb
38
+ - lib/vnpay/config.rb
38
39
  - lib/vnpay/url.rb
39
40
  - lib/vnpay/verify.rb
40
41
  homepage: https://github.com/nhannvu19/vnpay