checkout_sdk 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +3 -0
- data/lib/checkout_sdk/accounts/accounts.rb +5 -0
- data/lib/checkout_sdk/accounts/accounts_client.rb +25 -1
- data/lib/checkout_sdk/accounts/instrument_details.rb +9 -0
- data/lib/checkout_sdk/accounts/instrument_details_faster_payments.rb +14 -0
- data/lib/checkout_sdk/accounts/instrument_details_sepa.rb +14 -0
- data/lib/checkout_sdk/accounts/payment_instrument_request.rb +33 -0
- data/lib/checkout_sdk/accounts/payment_instruments_query.rb +11 -0
- data/lib/checkout_sdk/api_client.rb +2 -2
- data/lib/checkout_sdk/apm/previous/sepa/sepa_client.rb +4 -3
- data/lib/checkout_sdk/version.rb +1 -1
- metadata +15 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2847132422e096016b86e44a865cc8954e8fc705b26a0493f9e38328c2c21c06
|
4
|
+
data.tar.gz: cd129fd4091e1d82ff0b5237a559fcd5e99360c44da151ec8dae13fc1074cbf3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b93ffff597f3e273da665aea9a805434593514222c8c77f6c72491489d1fc098ff132745df41c6fcf9282baa682750100be9239cda2e9e7a7b7ab256715d3e2b
|
7
|
+
data.tar.gz: c0d81d308824a5f991fa67cad30d1e019d40446cbb813be7315ab8df579144d3d9c950978182826ca2e56fd2902a157a48b6ac5b225a3f3fa2335f95083ae808
|
data/.rubocop.yml
CHANGED
@@ -28,3 +28,8 @@ require 'checkout_sdk/accounts/schedule_request'
|
|
28
28
|
require 'checkout_sdk/accounts/schedule_frequency_weekly'
|
29
29
|
require 'checkout_sdk/accounts/schedule_frequency_daily'
|
30
30
|
require 'checkout_sdk/accounts/schedule_frequency_monthly'
|
31
|
+
require 'checkout_sdk/accounts/instrument_details'
|
32
|
+
require 'checkout_sdk/accounts/instrument_details_faster_payments'
|
33
|
+
require 'checkout_sdk/accounts/instrument_details_sepa'
|
34
|
+
require 'checkout_sdk/accounts/payment_instrument_request'
|
35
|
+
require 'checkout_sdk/accounts/payment_instruments_query'
|
@@ -10,7 +10,8 @@ module CheckoutSdk
|
|
10
10
|
INSTRUMENT = 'instruments'
|
11
11
|
PAYOUT_SCHEDULE = 'payout-schedules'
|
12
12
|
FILES = 'files'
|
13
|
-
|
13
|
+
PAYMENT_INSTRUMENTS = 'payment-instruments'
|
14
|
+
private_constant :ACCOUNTS, :ENTITIES, :INSTRUMENT, :PAYOUT_SCHEDULE, :FILES, :PAYMENT_INSTRUMENTS
|
14
15
|
|
15
16
|
# @param [ApiClient] api_client
|
16
17
|
# @param [ApiClient] files_client
|
@@ -36,6 +37,7 @@ module CheckoutSdk
|
|
36
37
|
api_client.invoke_put(build_path(ACCOUNTS, ENTITIES, entity_id), sdk_authorization, entity_request)
|
37
38
|
end
|
38
39
|
|
40
|
+
# @deprecated Please use {#add_payment_instrument} instead
|
39
41
|
# @param [String] entity_id
|
40
42
|
# @param [PaymentInstrument] payment_instrument
|
41
43
|
def create_payment_instrument(entity_id, payment_instrument)
|
@@ -43,6 +45,28 @@ module CheckoutSdk
|
|
43
45
|
payment_instrument)
|
44
46
|
end
|
45
47
|
|
48
|
+
# @param [String] entity_id
|
49
|
+
# @param [PaymentInstrumentRequest] payment_instrument
|
50
|
+
def add_payment_instrument(entity_id, payment_instrument)
|
51
|
+
api_client.invoke_post(build_path(ACCOUNTS, ENTITIES, entity_id, PAYMENT_INSTRUMENTS), sdk_authorization,
|
52
|
+
payment_instrument)
|
53
|
+
end
|
54
|
+
|
55
|
+
# @param [String] entity_id
|
56
|
+
# @param [PaymentInstrumentsQuery,nil] payment_instruments_query
|
57
|
+
def query_payment_instruments(entity_id, payment_instruments_query = nil)
|
58
|
+
api_client.invoke_get(build_path(ACCOUNTS, ENTITIES, entity_id, PAYMENT_INSTRUMENTS),
|
59
|
+
sdk_authorization,
|
60
|
+
payment_instruments_query)
|
61
|
+
end
|
62
|
+
|
63
|
+
# @param [String] entity_id
|
64
|
+
# @param [String] payment_instrument_id
|
65
|
+
def retrieve_payment_instrument_details(entity_id, payment_instrument_id)
|
66
|
+
api_client.invoke_get(build_path(ACCOUNTS, ENTITIES, entity_id, PAYMENT_INSTRUMENTS, payment_instrument_id),
|
67
|
+
sdk_authorization)
|
68
|
+
end
|
69
|
+
|
46
70
|
# @param [String] entity_id
|
47
71
|
# @param [String] currency {CheckoutSdk::Common::Currency}
|
48
72
|
# @param [UpdateSchedule] update_schedule
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module CheckoutSdk
|
4
|
+
module Accounts
|
5
|
+
# @!attribute account_number
|
6
|
+
# @return [String]
|
7
|
+
# @!attribute bank_code
|
8
|
+
# @return [String]
|
9
|
+
class InstrumentDetailsFasterPayments < InstrumentDetails
|
10
|
+
attr_accessor :account_number,
|
11
|
+
:bank_code
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module CheckoutSdk
|
4
|
+
module Accounts
|
5
|
+
# @!attribute iban
|
6
|
+
# @return [String]
|
7
|
+
# @!attribute swift_bic
|
8
|
+
# @return [String]
|
9
|
+
class InstrumentDetailsSepa < InstrumentDetails
|
10
|
+
attr_accessor :iban,
|
11
|
+
:swift_bic
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module CheckoutSdk
|
4
|
+
module Accounts
|
5
|
+
# @!attribute label
|
6
|
+
# @return [String]
|
7
|
+
# @!attribute type
|
8
|
+
# @return [String] {CheckoutSdk::Common::InstrumentType}
|
9
|
+
# @!attribute currency
|
10
|
+
# @return [String] {CheckoutSdk::Common::Currency}
|
11
|
+
# @!attribute country
|
12
|
+
# @return [String] {CheckoutSdk::Common::Country}
|
13
|
+
# @!attribute default
|
14
|
+
# @return [TrueClass, FalseClass]
|
15
|
+
# @!attribute document
|
16
|
+
# @return [InstrumentDocument]
|
17
|
+
# @!attribute instrument_details
|
18
|
+
# @return [InstrumentDetails]
|
19
|
+
class PaymentInstrumentRequest
|
20
|
+
attr_accessor :label,
|
21
|
+
:type,
|
22
|
+
:currency,
|
23
|
+
:country,
|
24
|
+
:default,
|
25
|
+
:document,
|
26
|
+
:instrument_details
|
27
|
+
|
28
|
+
def initialize
|
29
|
+
@type = CheckoutSdk::Common::InstrumentType::BANK_ACCOUNT
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -50,7 +50,7 @@ module CheckoutSdk
|
|
50
50
|
def submit_file(path,
|
51
51
|
authorization,
|
52
52
|
request)
|
53
|
-
|
53
|
+
upload(path, authorization, request)
|
54
54
|
end
|
55
55
|
|
56
56
|
private
|
@@ -107,7 +107,7 @@ module CheckoutSdk
|
|
107
107
|
}
|
108
108
|
end
|
109
109
|
|
110
|
-
def
|
110
|
+
def upload(path, authorization, file_request)
|
111
111
|
headers = get_default_headers authorization
|
112
112
|
|
113
113
|
file = File.open(file_request.file)
|
@@ -4,10 +4,11 @@ module CheckoutSdk
|
|
4
4
|
module Previous
|
5
5
|
module Apm
|
6
6
|
class SepaClient < Client
|
7
|
+
APMS = 'apms'
|
7
8
|
SEPA_MANDATES = 'sepa/mandates'
|
8
9
|
PPRO = 'ppro'
|
9
10
|
CANCEL = 'cancel'
|
10
|
-
private_constant :SEPA_MANDATES, :PPRO, :CANCEL
|
11
|
+
private_constant :APMS, :SEPA_MANDATES, :PPRO, :CANCEL
|
11
12
|
|
12
13
|
# @param [ApiClient] api_client
|
13
14
|
# @param [CheckoutConfiguration] configuration
|
@@ -27,12 +28,12 @@ module CheckoutSdk
|
|
27
28
|
|
28
29
|
# @param mandate_id [String]
|
29
30
|
def get_mandate_via_ppro(mandate_id)
|
30
|
-
api_client.invoke_get(build_path(PPRO, SEPA_MANDATES, mandate_id), sdk_authorization)
|
31
|
+
api_client.invoke_get(build_path(APMS, PPRO, SEPA_MANDATES, mandate_id), sdk_authorization)
|
31
32
|
end
|
32
33
|
|
33
34
|
# @param mandate_id [String]
|
34
35
|
def cancel_mandate_via_ppro(mandate_id)
|
35
|
-
api_client.invoke_post(build_path(PPRO, SEPA_MANDATES, mandate_id, CANCEL), sdk_authorization)
|
36
|
+
api_client.invoke_post(build_path(APMS, PPRO, SEPA_MANDATES, mandate_id, CANCEL), sdk_authorization)
|
36
37
|
end
|
37
38
|
end
|
38
39
|
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.0.
|
4
|
+
version: 1.0.2
|
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: 2023-01-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -58,42 +58,42 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
61
|
+
version: 1.10.0
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version:
|
68
|
+
version: 1.10.0
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
|
-
name: faraday-
|
70
|
+
name: faraday-follow_redirects
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version:
|
75
|
+
version: 0.3.0
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version:
|
82
|
+
version: 0.3.0
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
|
-
name: faraday-
|
84
|
+
name: faraday-multipart
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
87
|
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: 0.
|
89
|
+
version: 1.0.4
|
90
90
|
type: :runtime
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: 0.
|
96
|
+
version: 1.0.4
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: mime-types
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -142,9 +142,14 @@ files:
|
|
142
142
|
- lib/checkout_sdk/accounts/file_request.rb
|
143
143
|
- lib/checkout_sdk/accounts/identification.rb
|
144
144
|
- lib/checkout_sdk/accounts/individual.rb
|
145
|
+
- lib/checkout_sdk/accounts/instrument_details.rb
|
146
|
+
- lib/checkout_sdk/accounts/instrument_details_faster_payments.rb
|
147
|
+
- lib/checkout_sdk/accounts/instrument_details_sepa.rb
|
145
148
|
- lib/checkout_sdk/accounts/instrument_document.rb
|
146
149
|
- lib/checkout_sdk/accounts/onboard_entity.rb
|
147
150
|
- lib/checkout_sdk/accounts/payment_instrument.rb
|
151
|
+
- lib/checkout_sdk/accounts/payment_instrument_request.rb
|
152
|
+
- lib/checkout_sdk/accounts/payment_instruments_query.rb
|
148
153
|
- lib/checkout_sdk/accounts/phone.rb
|
149
154
|
- lib/checkout_sdk/accounts/place_of_birth.rb
|
150
155
|
- lib/checkout_sdk/accounts/profile.rb
|