checkout_sdk 1.1.4 → 1.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -2
- data/lib/checkout_sdk/api_client.rb +1 -1
- data/lib/checkout_sdk/checkout_api.rb +9 -1
- data/lib/checkout_sdk/payments/contexts/payment_contexts_client.rb +25 -0
- data/lib/checkout_sdk/payments/payment_request.rb +10 -1
- data/lib/checkout_sdk/payments/payment_retry_request.rb +17 -0
- data/lib/checkout_sdk/payments/payment_segment.rb +17 -0
- data/lib/checkout_sdk/payments/payments.rb +6 -0
- data/lib/checkout_sdk/payments/sessions/payment_sessions_client.rb +20 -0
- data/lib/checkout_sdk/payments/source/apm/giropay_source.rb +4 -0
- data/lib/checkout_sdk/version.rb +1 -1
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bd0bda6ae88b783a419a908bda378b4f88da4fd067e48633e6c0e8ff7e9ffcd5
|
4
|
+
data.tar.gz: e9b88917a378973ec8c7154a6929647d419e4e0e0e20cd343d3e03897b81fc18
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d2c55bb4d0ea1799a2cb5bef18a1a6a1439f7f36d16d78726b19d0a65542360059a977ef773843b4c6719d433cef1e2a597085dac3bd328f738c838db0bd182e
|
7
|
+
data.tar.gz: c6c7716ff91038b94fccebbbb5e0f853ce7dcd8033b9e38c3bfa70e08f0bd9153274fe9dfc91404901306302b905cb4e45efb1f563b448138ad28f4915dd75e2
|
data/README.md
CHANGED
@@ -1,10 +1,13 @@
|
|
1
1
|
# Checkout.com Ruby SDK
|
2
|
+
[![build-status](https://github.com/checkout/checkout-sdk-ruby/workflows/build-master/badge.svg)](https://github.com/checkout/checkout-sdk-ruby/actions/workflows/build-master.yml)
|
3
|
+
![CodeQL](https://github.com/checkout/checkout-sdk-ruby/workflows/CodeQL/badge.svg)
|
2
4
|
|
3
|
-
![build-status](https://github.com/checkout/checkout-sdk-ruby/workflows/build-
|
4
|
-
[![GitHub license](https://img.shields.io/github/license/checkout/checkout-sdk-ruby.svg)](https://github.com/checkout/checkout-sdk-ruby/blob/master/LICENSE)
|
5
|
+
[![build-status](https://github.com/checkout/checkout-sdk-ruby/workflows/build-release/badge.svg)](https://github.com/checkout/checkout-sdk-ruby/actions/workflows/build-release.yml)
|
5
6
|
[![GitHub release](https://img.shields.io/github/release/checkout/checkout-sdk-ruby.svg)](https://GitHub.com/checkout/checkout-sdk-ruby/releases/)
|
6
7
|
[![Gem Version](https://badge.fury.io/rb/checkout_sdk.svg)](https://badge.fury.io/rb/checkout_sdk)
|
7
8
|
|
9
|
+
[![GitHub license](https://img.shields.io/github/license/checkout/checkout-sdk-ruby.svg)](https://github.com/checkout/checkout-sdk-ruby/blob/master/LICENSE.md)
|
10
|
+
|
8
11
|
## Getting started
|
9
12
|
|
10
13
|
> **Version 1.0.0 is here!**
|
@@ -127,7 +127,7 @@ module CheckoutSdk
|
|
127
127
|
end
|
128
128
|
|
129
129
|
def parse_response(response)
|
130
|
-
raise CheckoutApiException, response if response.status < 200 || response.status >=
|
130
|
+
raise CheckoutApiException, response if response.status < 200 || response.status >= 400
|
131
131
|
|
132
132
|
metadata = CheckoutUtils.map_to_http_metadata(response)
|
133
133
|
body = parse_json_or_contents(response)
|
@@ -39,6 +39,10 @@ module CheckoutSdk
|
|
39
39
|
# @return [CheckoutSdk::Financial::FinancialClient]
|
40
40
|
# @!attribute issuing
|
41
41
|
# @return [CheckoutSdk::Issuing::IssuingClient]
|
42
|
+
# @!attribute contexts
|
43
|
+
# @return [CheckoutSdk::Payments::PaymentContextsClient]
|
44
|
+
# @!attribute payment_sessions
|
45
|
+
# @return [CheckoutSdk::Payments::PaymentSessionsClient]
|
42
46
|
class CheckoutApi
|
43
47
|
attr_reader :customers,
|
44
48
|
:disputes,
|
@@ -58,7 +62,9 @@ module CheckoutSdk
|
|
58
62
|
:transfers,
|
59
63
|
:metadata,
|
60
64
|
:financial,
|
61
|
-
:issuing
|
65
|
+
:issuing,
|
66
|
+
:contexts,
|
67
|
+
:payment_sessions
|
62
68
|
|
63
69
|
# @param [CheckoutConfiguration] configuration
|
64
70
|
def initialize(configuration)
|
@@ -82,6 +88,8 @@ module CheckoutSdk
|
|
82
88
|
@metadata = CheckoutSdk::Metadata::MetadataClient.new api_client, configuration
|
83
89
|
@financial = CheckoutSdk::Financial::FinancialClient.new api_client, configuration
|
84
90
|
@issuing = CheckoutSdk::Issuing::IssuingClient.new api_client, configuration
|
91
|
+
@contexts = CheckoutSdk::Payments::PaymentContextsClient.new api_client, configuration
|
92
|
+
@payment_sessions = CheckoutSdk::Payments::PaymentSessionsClient.new api_client, configuration
|
85
93
|
end
|
86
94
|
|
87
95
|
private
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module CheckoutSdk
|
4
|
+
module Payments
|
5
|
+
class PaymentContextsClient < Client
|
6
|
+
PAYMENT_CONTEXTS = 'payment-contexts'
|
7
|
+
|
8
|
+
# @param [ApiClient] api_client
|
9
|
+
# @param [CheckoutConfiguration] configuration
|
10
|
+
def initialize(api_client, configuration)
|
11
|
+
super api_client, configuration, CheckoutSdk::AuthorizationType::SECRET_KEY_OR_OAUTH
|
12
|
+
end
|
13
|
+
|
14
|
+
# @param [Hash] payment_contexts
|
15
|
+
def create_payment_contexts(payment_contexts)
|
16
|
+
api_client.invoke_post(PAYMENT_CONTEXTS, sdk_authorization, payment_contexts)
|
17
|
+
end
|
18
|
+
|
19
|
+
# @param [String] payment_context_id
|
20
|
+
def get_payment_context_details(payment_context_id)
|
21
|
+
api_client.invoke_get(build_path(PAYMENT_CONTEXTS, payment_context_id), sdk_authorization)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -2,6 +2,8 @@
|
|
2
2
|
|
3
3
|
module CheckoutSdk
|
4
4
|
module Payments
|
5
|
+
# @!attribute payment_context_id
|
6
|
+
# @return [String]
|
5
7
|
# @!attribute source
|
6
8
|
# @return [PaymentSource]
|
7
9
|
# @!attribute amount
|
@@ -28,6 +30,8 @@ module CheckoutSdk
|
|
28
30
|
# @return [BillingDescriptor]
|
29
31
|
# @!attribute shipping
|
30
32
|
# @return [ShippingDetails]
|
33
|
+
# @!attribute segment
|
34
|
+
# @return [PaymentSegment]
|
31
35
|
# @!attribute three_ds
|
32
36
|
# @return [ThreeDSRequest]
|
33
37
|
# @!attribute processing_channel_id
|
@@ -55,10 +59,13 @@ module CheckoutSdk
|
|
55
59
|
# @return [ProcessingSettings]
|
56
60
|
# @!attribute items
|
57
61
|
# @return [Array(Product)]
|
62
|
+
# @!attribute retry
|
63
|
+
# @return [PaymentRetryRequest]
|
58
64
|
# @!attribute metadata
|
59
65
|
# @return [Hash{String => Object}]
|
60
66
|
class PaymentRequest
|
61
|
-
attr_accessor :
|
67
|
+
attr_accessor :payment_context_id,
|
68
|
+
:source,
|
62
69
|
:amount,
|
63
70
|
:currency,
|
64
71
|
:payment_type,
|
@@ -71,6 +78,7 @@ module CheckoutSdk
|
|
71
78
|
:customer,
|
72
79
|
:billing_descriptor,
|
73
80
|
:shipping,
|
81
|
+
:segment,
|
74
82
|
:three_ds,
|
75
83
|
:processing_channel_id,
|
76
84
|
:previous_payment_id,
|
@@ -84,6 +92,7 @@ module CheckoutSdk
|
|
84
92
|
:amount_allocations,
|
85
93
|
:processing,
|
86
94
|
:items,
|
95
|
+
:retry,
|
87
96
|
:metadata
|
88
97
|
end
|
89
98
|
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module CheckoutSdk
|
4
|
+
module Payments
|
5
|
+
# @!attribute enabled
|
6
|
+
# @return [TrueClass, FalseClass]
|
7
|
+
# @!attribute max_attempts
|
8
|
+
# @return [Integer]
|
9
|
+
# @!attribute end_after_days
|
10
|
+
# @return [Integer]
|
11
|
+
class PaymentRetryRequest
|
12
|
+
attr_accessor :enabled,
|
13
|
+
:max_attempts,
|
14
|
+
:end_after_day
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module CheckoutSdk
|
4
|
+
module Payments
|
5
|
+
# @!attribute brand
|
6
|
+
# @return [String]
|
7
|
+
# @!attribute business_category
|
8
|
+
# @return [String]
|
9
|
+
# @!attribute market
|
10
|
+
# @return [String]
|
11
|
+
class PaymentSegment
|
12
|
+
attr_accessor :brand,
|
13
|
+
:business_category,
|
14
|
+
:market
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -155,3 +155,9 @@ require 'checkout_sdk/payments/hosted/hosted_payments_client'
|
|
155
155
|
# Payment Links
|
156
156
|
require 'checkout_sdk/payments/links/payment_link'
|
157
157
|
require 'checkout_sdk/payments/links/payments_links_client'
|
158
|
+
|
159
|
+
# Payment Contexts
|
160
|
+
require 'checkout_sdk/payments/contexts/payment_contexts_client'
|
161
|
+
|
162
|
+
# Payment Sessions
|
163
|
+
require 'checkout_sdk/payments/sessions/payment_sessions_client'
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module CheckoutSdk
|
4
|
+
module Payments
|
5
|
+
class PaymentSessionsClient < Client
|
6
|
+
PAYMENT_SESSIONS = 'payment-sessions'
|
7
|
+
|
8
|
+
# @param [ApiClient] api_client
|
9
|
+
# @param [CheckoutConfiguration] configuration
|
10
|
+
def initialize(api_client, configuration)
|
11
|
+
super api_client, configuration, CheckoutSdk::AuthorizationType::SECRET_KEY
|
12
|
+
end
|
13
|
+
|
14
|
+
# @param [Hash] payment_sessions
|
15
|
+
def create_payment_sessions(payment_sessions)
|
16
|
+
api_client.invoke_post(PAYMENT_SESSIONS, sdk_authorization, payment_sessions)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -2,7 +2,11 @@
|
|
2
2
|
|
3
3
|
module CheckoutSdk
|
4
4
|
module Payments
|
5
|
+
# @!attribute account_holder
|
6
|
+
# @return [CheckoutSdk::Common::AccountHolder]
|
5
7
|
class GiropaySource < PaymentSource
|
8
|
+
attr_accessor :account_holder
|
9
|
+
|
6
10
|
def initialize
|
7
11
|
super CheckoutSdk::Common::PaymentSourceType::GIROPAY
|
8
12
|
end
|
data/lib/checkout_sdk/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: checkout_sdk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Checkout
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-02-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -270,6 +270,7 @@ files:
|
|
270
270
|
- lib/checkout_sdk/payments/capture_request.rb
|
271
271
|
- lib/checkout_sdk/payments/capture_type.rb
|
272
272
|
- lib/checkout_sdk/payments/charge_bearer.rb
|
273
|
+
- lib/checkout_sdk/payments/contexts/payment_contexts_client.rb
|
273
274
|
- lib/checkout_sdk/payments/d_local_installments.rb
|
274
275
|
- lib/checkout_sdk/payments/d_local_processing_settings.rb
|
275
276
|
- lib/checkout_sdk/payments/destination/bank_account_destination.rb
|
@@ -294,6 +295,8 @@ files:
|
|
294
295
|
- lib/checkout_sdk/payments/payment_instruction.rb
|
295
296
|
- lib/checkout_sdk/payments/payment_recipient.rb
|
296
297
|
- lib/checkout_sdk/payments/payment_request.rb
|
298
|
+
- lib/checkout_sdk/payments/payment_retry_request.rb
|
299
|
+
- lib/checkout_sdk/payments/payment_segment.rb
|
297
300
|
- lib/checkout_sdk/payments/payment_type.rb
|
298
301
|
- lib/checkout_sdk/payments/payments.rb
|
299
302
|
- lib/checkout_sdk/payments/payments_client.rb
|
@@ -352,6 +355,7 @@ files:
|
|
352
355
|
- lib/checkout_sdk/payments/sender/sender_type.rb
|
353
356
|
- lib/checkout_sdk/payments/sender/source_of_funds.rb
|
354
357
|
- lib/checkout_sdk/payments/sender/ticket.rb
|
358
|
+
- lib/checkout_sdk/payments/sessions/payment_sessions_client.rb
|
355
359
|
- lib/checkout_sdk/payments/shipping_details.rb
|
356
360
|
- lib/checkout_sdk/payments/shipping_preference.rb
|
357
361
|
- lib/checkout_sdk/payments/source/apm/after_pay_source.rb
|