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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4dbf32713b437c8a46d0d53b7aa9677e086bacba9a420c51469f7a11e4e0db03
4
- data.tar.gz: f78e849f1a5ec86fc16fb09934d5151aa03bd43dd34b7a8d1da96ca18311154f
3
+ metadata.gz: 2847132422e096016b86e44a865cc8954e8fc705b26a0493f9e38328c2c21c06
4
+ data.tar.gz: cd129fd4091e1d82ff0b5237a559fcd5e99360c44da151ec8dae13fc1074cbf3
5
5
  SHA512:
6
- metadata.gz: f163f3cdd0d48d1198c6f914ccc0fc20850f357e79ca5355dc8ddc8931d5cbb255196d822c20c785a2740f53e9b5fbcd71273cf9b1f4e26c526fd937bef2b5f4
7
- data.tar.gz: 8cee0c1831036c54e8143e33db10495a443ec15b2d564ac246c7c7a81d7f0db2534d77fe151f062b5a1dc717cf185895994e595cb0323475f11462730946c39f
6
+ metadata.gz: b93ffff597f3e273da665aea9a805434593514222c8c77f6c72491489d1fc098ff132745df41c6fcf9282baa682750100be9239cda2e9e7a7b7ab256715d3e2b
7
+ data.tar.gz: c0d81d308824a5f991fa67cad30d1e019d40446cbb813be7315ab8df579144d3d9c950978182826ca2e56fd2902a157a48b6ac5b225a3f3fa2335f95083ae808
data/.rubocop.yml CHANGED
@@ -7,6 +7,9 @@ Metrics/AbcSize:
7
7
  Lint/MissingSuper:
8
8
  Enabled: false
9
9
 
10
+ Lint/EmptyClass:
11
+ Enabled: false
12
+
10
13
  Layout/LineLength:
11
14
  Max: 120
12
15
 
@@ -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
- private_constant :ACCOUNTS, :ENTITIES, :INSTRUMENT, :PAYOUT_SCHEDULE, :FILES
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,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CheckoutSdk
4
+ module Accounts
5
+ # @abstract
6
+ class InstrumentDetails
7
+ end
8
+ end
9
+ end
@@ -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
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CheckoutSdk
4
+ module Accounts
5
+ # @!attribute status
6
+ # @return [String]
7
+ class PaymentInstrumentsQuery
8
+ attr_accessor :status
9
+ end
10
+ end
11
+ end
@@ -50,7 +50,7 @@ module CheckoutSdk
50
50
  def submit_file(path,
51
51
  authorization,
52
52
  request)
53
- upload_file(path, authorization, request)
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 upload_file(path, authorization, file_request)
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CheckoutSdk
4
- VERSION = '1.0.1'
4
+ VERSION = '1.0.2'
5
5
  end
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.1
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: 2022-12-28 00:00:00.000000000 Z
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: 2.0.0
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: 2.0.0
68
+ version: 1.10.0
69
69
  - !ruby/object:Gem::Dependency
70
- name: faraday-multipart
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: 1.0.4
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: 1.0.4
82
+ version: 0.3.0
83
83
  - !ruby/object:Gem::Dependency
84
- name: faraday-follow_redirects
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.3.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.3.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