checkout_sdk 0.1.0 → 0.1.1
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/README.md +6 -6
- data/bin/console +1 -1
- data/checkout.gemspec +2 -2
- data/lib/{checkout.rb → checkout_sdk.rb} +5 -5
- data/lib/{checkout → checkout_sdk}/api_resource.rb +4 -4
- data/lib/{checkout → checkout_sdk}/configuration.rb +1 -1
- data/lib/{checkout → checkout_sdk}/data/capture_payment.rb +1 -1
- data/lib/{checkout → checkout_sdk}/data/payment_request_source.rb +1 -1
- data/lib/{checkout → checkout_sdk}/data/payment_source.rb +1 -1
- data/lib/{checkout → checkout_sdk}/data/refund_payment.rb +1 -1
- data/lib/{checkout → checkout_sdk}/data/request_token.rb +1 -1
- data/lib/{checkout → checkout_sdk}/data/void_payment.rb +1 -1
- data/lib/checkout_sdk/version.rb +3 -0
- metadata +11 -11
- data/lib/checkout/version.rb +0 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 75baa606a4ecfc3ffbf1bade0c9b0c486dac075d7c300eb1c6d8a4a38aac852f
|
4
|
+
data.tar.gz: 83d0eac9ca0a6917764f17810e368a43493ae3d5caa0cec5e81ab03fa1417e21
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d7d385205bf6bb151f199e68c0a7dec74a3c7857d4c5556194a747b82909c68950a3d77a817eac253b4dea620cf6527a4d8a7fb092859bcf8daf1fa185941b66
|
7
|
+
data.tar.gz: 06502a2bee8cc90d2114c4da9bdc17b0ba8fae953f9c7f0e2779c703137e6af6f6512186b8a8414ea8af60b8a703a7defe432e8578d615268f1917e86377a3fb
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
#
|
1
|
+
# CheckoutSdk
|
2
2
|
|
3
|
-
You are reading documentation for version: 0.1.
|
3
|
+
You are reading documentation for version: 0.1.1
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
@@ -23,7 +23,7 @@ Or install it yourself as:
|
|
23
23
|
API keys must be configured in the gem setup. You can do this anywhere in your application before you make API calls using the gem.
|
24
24
|
|
25
25
|
```ruby
|
26
|
-
|
26
|
+
CheckoutSdk.configure do |config|
|
27
27
|
config.secret_key = ENV['SECRET_KEY']
|
28
28
|
config.public_key = ENV['PUBLIC_KEY']
|
29
29
|
config.base_url = ENV['BASE_URL']
|
@@ -33,7 +33,7 @@ end
|
|
33
33
|
## Usage
|
34
34
|
|
35
35
|
```ruby
|
36
|
-
p =
|
36
|
+
p = CheckoutSdk::PaymentRequestSource.new
|
37
37
|
p.type = "card"
|
38
38
|
p.card_number = "4242424242424242"
|
39
39
|
p.card_expiry_month = 6
|
@@ -52,9 +52,9 @@ p.recipient_last_name = "Elmo"
|
|
52
52
|
p.risk_enabled = true
|
53
53
|
p.billing_descriptor_name = "Nancy"
|
54
54
|
p.billing_descriptor_city = "Berlin"
|
55
|
-
p.processing_mid = "
|
55
|
+
p.processing_mid = "CheckoutSdk"
|
56
56
|
|
57
|
-
r =
|
57
|
+
r = CheckoutSdk::ApiResource.new
|
58
58
|
r.request_payments(p)
|
59
59
|
```
|
60
60
|
|
data/bin/console
CHANGED
data/checkout.gemspec
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
lib = File.expand_path("../lib", __FILE__)
|
2
2
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
|
-
require "
|
3
|
+
require "checkout_sdk/version"
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = "checkout_sdk"
|
7
|
-
spec.version =
|
7
|
+
spec.version = CheckoutSdk::VERSION
|
8
8
|
spec.authors = ["Khalid Jazaerly"]
|
9
9
|
spec.email = ["khalid.jaz@gmail.com"]
|
10
10
|
|
@@ -1,9 +1,9 @@
|
|
1
|
-
require "
|
2
|
-
require "
|
3
|
-
require "
|
4
|
-
require "
|
1
|
+
require "checkout_sdk/configuration"
|
2
|
+
require "checkout_sdk/api_resource"
|
3
|
+
require "checkout_sdk/data/capture_payment"
|
4
|
+
require "checkout_sdk/data/payment_request_source"
|
5
5
|
|
6
|
-
module
|
6
|
+
module CheckoutSdk
|
7
7
|
class << self
|
8
8
|
attr_accessor :configuration
|
9
9
|
end
|
@@ -1,10 +1,10 @@
|
|
1
1
|
require "excon"
|
2
2
|
|
3
|
-
class
|
3
|
+
class CheckoutSdk::ApiResource
|
4
4
|
attr_reader :checkout_connection
|
5
5
|
|
6
6
|
def initialize
|
7
|
-
@checkout_connection = Excon.new("#{
|
7
|
+
@checkout_connection = Excon.new("#{CheckoutSdk.configuration.base_url}", persistent: true)
|
8
8
|
end
|
9
9
|
|
10
10
|
def request_payments(data_object)
|
@@ -46,14 +46,14 @@ class Checkout::ApiResource
|
|
46
46
|
path: path,
|
47
47
|
body: data_object.to_json,
|
48
48
|
headers: { "Content-Type" => "application/json",
|
49
|
-
"Authorization" => "#{
|
49
|
+
"Authorization" => "#{CheckoutSdk.configuration.secret_key}" }
|
50
50
|
)
|
51
51
|
end
|
52
52
|
|
53
53
|
def get(path)
|
54
54
|
checkout_connection.get(
|
55
55
|
path: path,
|
56
|
-
headers: { "Authorization" => "#{
|
56
|
+
headers: { "Authorization" => "#{CheckoutSdk.configuration.secret_key}" }
|
57
57
|
)
|
58
58
|
end
|
59
59
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
class
|
1
|
+
class CheckoutSdk::PaymentRequestSource
|
2
2
|
attr_accessor :type, :token, :billing_address_line1, :billing_address_line2, :billing_city, :billing_state,
|
3
3
|
:billing_zip, :billing_country, :phone_country_code, :phone_number, :amount,
|
4
4
|
:currency, :payment_type, :reference, :description, :capture, :capture_on, :customer_id,
|
@@ -1,4 +1,4 @@
|
|
1
|
-
class
|
1
|
+
class CheckoutSdk::RequestToken
|
2
2
|
attr_accessor :type, :token_data_version, :token_data_data, :token_data_signature,
|
3
3
|
:token_data_header, :token_data_signature, :token_data_protocolVersion,
|
4
4
|
:token_data_signedMessage, :card_number, :card_expiry_month, :card_expiry_year,
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: checkout_sdk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Khalid Jazaerly
|
@@ -97,16 +97,16 @@ files:
|
|
97
97
|
- bin/console
|
98
98
|
- bin/setup
|
99
99
|
- checkout.gemspec
|
100
|
-
- lib/
|
101
|
-
- lib/
|
102
|
-
- lib/
|
103
|
-
- lib/
|
104
|
-
- lib/
|
105
|
-
- lib/
|
106
|
-
- lib/
|
107
|
-
- lib/
|
108
|
-
- lib/
|
109
|
-
- lib/
|
100
|
+
- lib/checkout_sdk.rb
|
101
|
+
- lib/checkout_sdk/api_resource.rb
|
102
|
+
- lib/checkout_sdk/configuration.rb
|
103
|
+
- lib/checkout_sdk/data/capture_payment.rb
|
104
|
+
- lib/checkout_sdk/data/payment_request_source.rb
|
105
|
+
- lib/checkout_sdk/data/payment_source.rb
|
106
|
+
- lib/checkout_sdk/data/refund_payment.rb
|
107
|
+
- lib/checkout_sdk/data/request_token.rb
|
108
|
+
- lib/checkout_sdk/data/void_payment.rb
|
109
|
+
- lib/checkout_sdk/version.rb
|
110
110
|
homepage: http://checkout.com
|
111
111
|
licenses: []
|
112
112
|
metadata: {}
|
data/lib/checkout/version.rb
DELETED