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 +4 -4
- data/Gemfile.lock +2 -2
- data/lib/stp/version.rb +1 -1
- data/lib/stp.rb +35 -2
- data/spec/spec_helper.rb +22 -20
- data/stp_client.gemspec +1 -1
- metadata +3 -4
- data/lib/stp/config.rb +0 -35
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 92f39a09bc38016be4b17b5567ea273a06ddd7c487e34502fe1527e03ce34d05
|
4
|
+
data.tar.gz: 9961705cbdff5fc21f85325d46f06b9c31176b08f314cc704d7d4cfafa8924d0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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.
|
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
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.
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
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.
|
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.
|
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.
|
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.
|
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
|