stp_client 0.1.0 → 0.2.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
  SHA256:
3
- metadata.gz: f762d76df1ac396cf8b3deac83f0735bec22d06e541883276225809bc43ca59c
4
- data.tar.gz: b2d8660f373cd6a84fdca4599b30bd310f9ddd4df7185f7cbd1119eced4e3f66
3
+ metadata.gz: 92f39a09bc38016be4b17b5567ea273a06ddd7c487e34502fe1527e03ce34d05
4
+ data.tar.gz: 9961705cbdff5fc21f85325d46f06b9c31176b08f314cc704d7d4cfafa8924d0
5
5
  SHA512:
6
- metadata.gz: 4e2a979387cbc82f6a55722ec6e3f15e3129bc9eeb7a66f3729d19abadc105e5c42536e242f47511c240dfe342daa71cd0f8d826f78bd81172d463884f1f3c44
7
- data.tar.gz: 4e232fc32b0f086c9089d1712209aefb2ecd06dc075b0e77e21a1e04522a03edbba7163c5dbbadb86375b40d0a437f811bbf64cd1313168bacbac22e26e6af9a
6
+ metadata.gz: 841bd000d01547c03fc5bcf6df46d238e381160807c355d3062d721bff664bffb0f1f6818a4ba4fc4e49d0333b840ed1e849390a09352d2df3c11713f2d44c64
7
+ data.tar.gz: 6e9e2d08f9f5932664e61c739271165481d825a629c2a6b104b3143075b3b7d1d5567c7ca20b6521d47bfa1823972fa6d7c9de7c818e27488ccd6ab9a0cbf8bc
data/Gemfile.lock CHANGED
@@ -2,7 +2,7 @@ PATH
2
2
  remote: .
3
3
  specs:
4
4
  stp_client (0.1.0)
5
- crypto_yellowme (~> 0.3)
5
+ crypto_yellowme (~> 0.4)
6
6
  faraday (~> 1.0)
7
7
 
8
8
  GEM
@@ -17,7 +17,7 @@ GEM
17
17
  tzinfo (~> 1.1)
18
18
  bcrypt (3.1.13)
19
19
  concurrent-ruby (1.1.5)
20
- crypto_yellowme (0.3.0)
20
+ crypto_yellowme (0.4.0)
21
21
  activemodel (~> 5.2)
22
22
  activesupport (~> 5.0)
23
23
  bcrypt (~> 3.1.7)
data/lib/stp/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module STP
2
- VERSION = '0.1.0'
2
+ VERSION = '0.2.0'
3
3
  end
data/lib/stp.rb CHANGED
@@ -1,12 +1,45 @@
1
1
  require 'crypto'
2
2
  require 'faraday'
3
3
 
4
- require 'stp/config'
5
-
6
4
  require 'stp/structs/account'
7
5
  require 'stp/structs/payment_order'
8
6
  require 'stp/account'
9
7
  require 'stp/payment_order'
10
8
 
11
9
  module STP
10
+ def self.config
11
+ yield self
12
+ end
13
+
14
+ def self.api_uri=(api_uri)
15
+ @api_uri = api_uri
16
+ end
17
+
18
+ def self.api_uri
19
+ @api_uri
20
+ end
21
+
22
+ def self.private_key=(private_key)
23
+ @private_key = private_key
24
+ end
25
+
26
+ def self.private_key
27
+ @private_key
28
+ end
29
+
30
+ def self.private_key_password=(private_key_password)
31
+ @private_key_password = private_key_password
32
+ end
33
+
34
+ def self.private_key_password
35
+ @private_key_password
36
+ end
37
+
38
+ def self.company=(company)
39
+ @company = company
40
+ end
41
+
42
+ def self.company
43
+ @company
44
+ end
12
45
  end
data/spec/spec_helper.rb CHANGED
@@ -4,25 +4,27 @@ require 'faker'
4
4
 
5
5
  require 'stp'
6
6
 
7
- STP.api_uri = 'xxxxx'
8
- STP.private_key = %q(
9
- -----BEGIN RSA PRIVATE KEY-----
10
- MIICXgIBAAKBgQDO6dcS4k8Sz//09ISLLCIqHjCYNpHUbtauyu4+N3bvTOxgyX9R
11
- fC9hQ0HyL6VjcAoY67BNF1gvLPTRB0ijwMPpl2uEyv2y1pPwxmDoH4dH0aoRrWUW
12
- zSejnfVn4NoHIchiu8umIofDFuGb/cIDnVBikKNFBTf6HxPePUW2p35Q9wIDAQAB
13
- AoGBAJm4jqmf6mEumJkyw/nlauhhj3a2K/dn9STc7MzaRgkY3BA4AtfV7BlVb3vv
14
- O+85QLcs+sj7S++YdbWJtMS7pI/jYQPEiR2pQ9aHx/Hacor92Oi7zEzn6QLr/VKA
15
- K2qPAiRicPItrY4zWkrEwmwX0SBUPjAD3Ffjf8T6cETE8puxAkEA7aijTnkK8FzM
16
- TxXDl6UMxSwjcJeP/vJcN+im+aphliIGJykL1kcXT5B9R3OUyqsbySgmjsG2yNEm
17
- psCEd/rZKQJBAN7hxnVGAeVl1q2NWgL+lCgvgwaoPqE2NzcFsIxs5EOpKXn0fZuR
18
- oH7l09Giv61NmdNAJT1oMxdLVQ9QJ1UNfR8CQQC9ACr3Yk2vv6z/i+hjte/E8ogw
19
- p2ftsaJjGBOKY9R9yAsqo3r1as4ACYGIDEQdNRzAybx4NVf+tk5NuLbgj86ZAkEA
20
- h3BpmgA1zMHK5+H6rdEoFRdyJsx8api4it4RP/Q37gnQ44Q4BB5Find89WpR0i1S
21
- 6bWUK7GzQleL0+dgT2YH/wJAByKN5rEvP/XLiwSu68lQtloDAJxQfD4CSHlC97Mw
22
- 9bIAmsKrvYVL4B40Nb3jPNXCKm8zRqFu//WX/G1uy5Q6nQ==
23
- -----END RSA PRIVATE KEY-----
24
- )
25
- STP.private_key_password = '12345678'
26
- STP.company = 'xxxxx'
7
+ STP.config do |c|
8
+ c.api_uri = 'xxxxx'
9
+ c.private_key = %q(
10
+ -----BEGIN RSA PRIVATE KEY-----
11
+ MIICXgIBAAKBgQDO6dcS4k8Sz//09ISLLCIqHjCYNpHUbtauyu4+N3bvTOxgyX9R
12
+ fC9hQ0HyL6VjcAoY67BNF1gvLPTRB0ijwMPpl2uEyv2y1pPwxmDoH4dH0aoRrWUW
13
+ zSejnfVn4NoHIchiu8umIofDFuGb/cIDnVBikKNFBTf6HxPePUW2p35Q9wIDAQAB
14
+ AoGBAJm4jqmf6mEumJkyw/nlauhhj3a2K/dn9STc7MzaRgkY3BA4AtfV7BlVb3vv
15
+ O+85QLcs+sj7S++YdbWJtMS7pI/jYQPEiR2pQ9aHx/Hacor92Oi7zEzn6QLr/VKA
16
+ K2qPAiRicPItrY4zWkrEwmwX0SBUPjAD3Ffjf8T6cETE8puxAkEA7aijTnkK8FzM
17
+ TxXDl6UMxSwjcJeP/vJcN+im+aphliIGJykL1kcXT5B9R3OUyqsbySgmjsG2yNEm
18
+ psCEd/rZKQJBAN7hxnVGAeVl1q2NWgL+lCgvgwaoPqE2NzcFsIxs5EOpKXn0fZuR
19
+ oH7l09Giv61NmdNAJT1oMxdLVQ9QJ1UNfR8CQQC9ACr3Yk2vv6z/i+hjte/E8ogw
20
+ p2ftsaJjGBOKY9R9yAsqo3r1as4ACYGIDEQdNRzAybx4NVf+tk5NuLbgj86ZAkEA
21
+ h3BpmgA1zMHK5+H6rdEoFRdyJsx8api4it4RP/Q37gnQ44Q4BB5Find89WpR0i1S
22
+ 6bWUK7GzQleL0+dgT2YH/wJAByKN5rEvP/XLiwSu68lQtloDAJxQfD4CSHlC97Mw
23
+ 9bIAmsKrvYVL4B40Nb3jPNXCKm8zRqFu//WX/G1uy5Q6nQ==
24
+ -----END RSA PRIVATE KEY-----
25
+ )
26
+ c.private_key_password = '12345678'
27
+ c.company = 'xxxxx'
28
+ end
27
29
 
28
30
  SimpleCov.start
data/stp_client.gemspec CHANGED
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
19
19
  spec.license = 'MIT'
20
20
 
21
21
  spec.add_dependency "faraday", "~> 1.0"
22
- spec.add_dependency "crypto_yellowme", "~> 0.3"
22
+ spec.add_dependency "crypto_yellowme", "~> 0.4"
23
23
 
24
24
  spec.add_development_dependency "rspec", "~> 3.8"
25
25
  spec.add_development_dependency "faker", "~> 2.0"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stp_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yellowme
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0.3'
33
+ version: '0.4'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '0.3'
40
+ version: '0.4'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -95,7 +95,6 @@ files:
95
95
  - Rakefile
96
96
  - lib/stp.rb
97
97
  - lib/stp/account.rb
98
- - lib/stp/config.rb
99
98
  - lib/stp/payment_order.rb
100
99
  - lib/stp/structs/account.rb
101
100
  - lib/stp/structs/payment_order.rb
data/lib/stp/config.rb DELETED
@@ -1,35 +0,0 @@
1
- module STP
2
- class << self
3
- def api_uri=(api_uri)
4
- @api_uri = api_uri
5
- end
6
-
7
- def api_uri
8
- @api_uri
9
- end
10
-
11
- def private_key=(private_key)
12
- @private_key = private_key
13
- end
14
-
15
- def private_key
16
- @private_key
17
- end
18
-
19
- def private_key_password=(private_key_password)
20
- @private_key_password = private_key_password
21
- end
22
-
23
- def private_key_password
24
- @private_key_password
25
- end
26
-
27
- def company=(company)
28
- @company = company
29
- end
30
-
31
- def company
32
- @company
33
- end
34
- end
35
- end