smartpay 0.2.2 → 0.2.3
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0c6d6af18ab67f641631f6e67525ae39c64286ae716819fa2d96658b0571f83b
|
4
|
+
data.tar.gz: 64a89a61dd9cfec7fffad3735bea54ad22c5387e2b68bc8caa54148803aea394
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7f2ca92bd0867e03a3f2ab3f2c964bfdb1ead71ade148ea753b28aec3ee57aed4d7ab394041620bba30a02055839b214f164e562ed6281e96bf53968a958e6b4
|
7
|
+
data.tar.gz: 1426c5205f369b614791c2b8277df030f8f693e31b1caf9ac36f8cfef017a95570599ee957c2f615401fb57a6b95f38720d9cdf4296b3cdf8563dc4a5110dde0
|
data/README.md
CHANGED
@@ -64,7 +64,7 @@ bundle exec rails generate smartpay:install
|
|
64
64
|
|
65
65
|
This introduces 4 changes for a pre-built Smartpay Checkout example:
|
66
66
|
|
67
|
-
> 1. A new initializer - `config/initializers/smartpay.rb`. You will have to update the `config.
|
67
|
+
> 1. A new initializer - `config/initializers/smartpay.rb`. You will have to update the `config.public_api_key` and `config.private_api_key` with your own credentials to make this work.
|
68
68
|
> 2. A new controller - `app/controllers/smartpays_controller.rb`. This is where you can see how a Checkout session is configured & created.
|
69
69
|
> 3. A new view - `app/views/smartpays/index.html.erb`. The minimum frontend required.
|
70
70
|
> 4. A new route in config/routes.rb.
|
@@ -75,8 +75,8 @@ Edit the keys with your own credentials in `config/initializers/smartpay.rb`.
|
|
75
75
|
|
76
76
|
```ruby
|
77
77
|
...
|
78
|
-
config.
|
79
|
-
config.
|
78
|
+
config.public_api_key = '<YOUR_PUBLIC_API_KEY>' # the one starts with pk_test_
|
79
|
+
config.private_api_key = '<YOUR_PRIVATE_API_KEY>' # the one starts with sk_test_
|
80
80
|
...
|
81
81
|
```
|
82
82
|
|
@@ -3,6 +3,6 @@
|
|
3
3
|
Smartpay.configure do |config|
|
4
4
|
config.api_url = 'https://api.smartpay.co/smartpayments'
|
5
5
|
config.checkout_url = 'https://checkout.smartpay.co'
|
6
|
-
config.
|
7
|
-
config.
|
6
|
+
config.public_api_key = 'pk_test_'
|
7
|
+
config.private_api_key = 'sk_test_'
|
8
8
|
end
|
data/lib/smartpay/client.rb
CHANGED
@@ -24,12 +24,12 @@ module Smartpay
|
|
24
24
|
{
|
25
25
|
accept: :json,
|
26
26
|
content_type: :json,
|
27
|
-
Authorization: "Basic #{
|
27
|
+
Authorization: "Basic #{private_api_key}"
|
28
28
|
}
|
29
29
|
end
|
30
30
|
|
31
|
-
def
|
32
|
-
Smartpay.configuration.
|
31
|
+
def private_api_key
|
32
|
+
Smartpay.configuration.private_api_key
|
33
33
|
end
|
34
34
|
end
|
35
35
|
end
|
@@ -3,7 +3,7 @@
|
|
3
3
|
module Smartpay
|
4
4
|
class Configuration
|
5
5
|
attr_accessor :post_timeout
|
6
|
-
attr_accessor :
|
6
|
+
attr_accessor :public_api_key, :private_api_key, :api_url, :checkout_url
|
7
7
|
|
8
8
|
DEFAULT_TIMEOUT_SETTING = 30
|
9
9
|
DEFAULT_API_URL = 'https://api.smartpay.co'
|
@@ -10,7 +10,7 @@ module Smartpay
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def redirect_url
|
13
|
-
URI.escape("#{checkout_url}/login?session-id=#{response[:id]}&public-key=#{
|
13
|
+
URI.escape("#{checkout_url}/login?session-id=#{response[:id]}&public-key=#{public_api_key}")
|
14
14
|
end
|
15
15
|
|
16
16
|
private
|
@@ -19,8 +19,8 @@ module Smartpay
|
|
19
19
|
Smartpay.configuration.checkout_url
|
20
20
|
end
|
21
21
|
|
22
|
-
def
|
23
|
-
Smartpay.configuration.
|
22
|
+
def public_api_key
|
23
|
+
Smartpay.configuration.public_api_key
|
24
24
|
end
|
25
25
|
end
|
26
26
|
end
|
data/lib/smartpay/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: smartpay
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Smartpay
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-10-
|
11
|
+
date: 2021-10-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|