checkout_sdk 1.0.0.beta.0 → 1.0.0.beta.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (197) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +6 -0
  3. data/README.md +57 -0
  4. data/lib/checkout_sdk/abstract_checkout_sdk_builder.rb +25 -4
  5. data/lib/checkout_sdk/accounts/account_holder.rb +35 -0
  6. data/lib/checkout_sdk/accounts/accounts.rb +30 -0
  7. data/lib/checkout_sdk/accounts/accounts_client.rb +65 -0
  8. data/lib/checkout_sdk/accounts/business_type.rb +15 -0
  9. data/lib/checkout_sdk/accounts/company.rb +35 -0
  10. data/lib/checkout_sdk/accounts/contact_details.rb +14 -0
  11. data/lib/checkout_sdk/accounts/date_of_birth.rb +17 -0
  12. data/lib/checkout_sdk/accounts/document.rb +17 -0
  13. data/lib/checkout_sdk/accounts/document_type.rb +14 -0
  14. data/lib/checkout_sdk/accounts/entity_document.rb +14 -0
  15. data/lib/checkout_sdk/accounts/entity_email_addresses.rb +11 -0
  16. data/lib/checkout_sdk/accounts/entity_financial_details.rb +20 -0
  17. data/lib/checkout_sdk/accounts/entity_financial_documents.rb +14 -0
  18. data/lib/checkout_sdk/accounts/file_request.rb +8 -0
  19. data/lib/checkout_sdk/accounts/identification.rb +14 -0
  20. data/lib/checkout_sdk/accounts/individual.rb +38 -0
  21. data/lib/checkout_sdk/accounts/instrument_document.rb +14 -0
  22. data/lib/checkout_sdk/accounts/onboard_entity.rb +23 -0
  23. data/lib/checkout_sdk/accounts/payment_instrument.rb +50 -0
  24. data/lib/checkout_sdk/accounts/phone.rb +11 -0
  25. data/lib/checkout_sdk/accounts/place_of_birth.rb +11 -0
  26. data/lib/checkout_sdk/accounts/profile.rb +17 -0
  27. data/lib/checkout_sdk/accounts/representative.rb +35 -0
  28. data/lib/checkout_sdk/accounts/schedule_frequency_daily.rb +11 -0
  29. data/lib/checkout_sdk/accounts/schedule_frequency_monthly.rb +15 -0
  30. data/lib/checkout_sdk/accounts/schedule_frequency_type.rb +11 -0
  31. data/lib/checkout_sdk/accounts/schedule_frequency_weekly.rb +15 -0
  32. data/lib/checkout_sdk/accounts/schedule_request.rb +19 -0
  33. data/lib/checkout_sdk/accounts/update_schedule.rb +17 -0
  34. data/lib/checkout_sdk/api_client.rb +17 -22
  35. data/lib/checkout_sdk/apm/apm.rb +0 -1
  36. data/lib/checkout_sdk/apm/previous/klarna/credit_session_request.rb +19 -21
  37. data/lib/checkout_sdk/apm/previous/klarna/klarna.rb +13 -15
  38. data/lib/checkout_sdk/apm/previous/klarna/klarna_client.rb +43 -45
  39. data/lib/checkout_sdk/apm/previous/klarna/klarna_product.rb +19 -21
  40. data/lib/checkout_sdk/apm/previous/klarna/order_capture_request.rb +24 -26
  41. data/lib/checkout_sdk/apm/previous/sepa/sepa_client.rb +25 -27
  42. data/lib/checkout_sdk/checkout_api.rb +28 -2
  43. data/lib/checkout_sdk/checkout_configuration.rb +6 -4
  44. data/lib/checkout_sdk/checkout_oauth_sdk_builder.rb +3 -1
  45. data/lib/checkout_sdk/checkout_static_keys_sdk_builder.rb +2 -1
  46. data/lib/checkout_sdk/checkout_utils.rb +28 -4
  47. data/lib/checkout_sdk/common/account_holder.rb +4 -1
  48. data/lib/checkout_sdk/common/common.rb +3 -1
  49. data/lib/checkout_sdk/common/file_request.rb +5 -2
  50. data/lib/checkout_sdk/common/marketplace_data.rb +14 -0
  51. data/lib/checkout_sdk/common/payment_source_type.rb +1 -0
  52. data/lib/checkout_sdk/common/product.rb +17 -0
  53. data/lib/checkout_sdk/common/shipping_info.rb +29 -0
  54. data/lib/checkout_sdk/customers/customer_request.rb +2 -2
  55. data/lib/checkout_sdk/disputes/disputes_client.rb +5 -0
  56. data/lib/checkout_sdk/disputes/disputes_query_filter.rb +3 -3
  57. data/lib/checkout_sdk/instruments/base_instruments_client.rb +20 -0
  58. data/lib/checkout_sdk/instruments/{update/update_instrument_request.rb → create/instrument.rb} +3 -1
  59. data/lib/checkout_sdk/instruments/create/{instrument_bank_account_request.rb → instrument_bank_account.rb} +1 -1
  60. data/lib/checkout_sdk/instruments/create/{instrument_token_request.rb → instrument_token.rb} +1 -1
  61. data/lib/checkout_sdk/instruments/instruments.rb +14 -7
  62. data/lib/checkout_sdk/instruments/instruments_client.rb +4 -15
  63. data/lib/checkout_sdk/instruments/previous/create/instrument.rb +26 -0
  64. data/lib/checkout_sdk/instruments/previous/instruments_client.rb +28 -0
  65. data/lib/checkout_sdk/instruments/previous/update/update_instrument.rb +25 -0
  66. data/lib/checkout_sdk/instruments/{create/instrument_request.rb → update/update_instrument.rb} +3 -1
  67. data/lib/checkout_sdk/instruments/update/{update_instrument_bank_account_request.rb → update_instrument_bank_account.rb} +1 -1
  68. data/lib/checkout_sdk/instruments/update/{update_instrument_card_request.rb → update_instrument_card.rb} +1 -1
  69. data/lib/checkout_sdk/instruments/update/{update_instrument_token_request.rb → update_instrument_token.rb} +1 -1
  70. data/lib/checkout_sdk/oauth_scopes.rb +2 -0
  71. data/lib/checkout_sdk/oauth_sdk_credentials.rb +5 -13
  72. data/lib/checkout_sdk/payments/base_payments_client.rb +46 -0
  73. data/lib/checkout_sdk/payments/billing_information.rb +14 -0
  74. data/lib/checkout_sdk/payments/billing_plan.rb +17 -0
  75. data/lib/checkout_sdk/payments/billing_plan_type.rb +14 -0
  76. data/lib/checkout_sdk/payments/capture_request.rb +4 -0
  77. data/lib/checkout_sdk/payments/destination/destination.rb +1 -1
  78. data/lib/checkout_sdk/payments/hosted/hosted_payments_client.rb +25 -0
  79. data/lib/checkout_sdk/payments/hosted/hosted_payments_session.rb +87 -0
  80. data/lib/checkout_sdk/payments/links/payment_link.rb +84 -0
  81. data/lib/checkout_sdk/payments/links/payments_links_client.rb +25 -0
  82. data/lib/checkout_sdk/payments/payment_request.rb +5 -1
  83. data/lib/checkout_sdk/payments/payment_type.rb +0 -1
  84. data/lib/checkout_sdk/payments/payments.rb +92 -23
  85. data/lib/checkout_sdk/payments/payments_client.rb +1 -36
  86. data/lib/checkout_sdk/payments/payments_query_filter.rb +17 -0
  87. data/lib/checkout_sdk/payments/payout_request.rb +1 -1
  88. data/lib/checkout_sdk/payments/previous/capture_request.rb +19 -0
  89. data/lib/checkout_sdk/payments/previous/destination/card_destination.rb +38 -0
  90. data/lib/checkout_sdk/payments/previous/destination/destination.rb +21 -0
  91. data/lib/checkout_sdk/payments/previous/destination/id_destination.rb +23 -0
  92. data/lib/checkout_sdk/payments/previous/destination/token_destination.rb +29 -0
  93. data/lib/checkout_sdk/payments/previous/fund_transfer_type.rb +17 -0
  94. data/lib/checkout_sdk/payments/previous/payment_request.rb +73 -0
  95. data/lib/checkout_sdk/payments/previous/payments_client.rb +43 -0
  96. data/lib/checkout_sdk/payments/previous/payout_request.rb +70 -0
  97. data/lib/checkout_sdk/payments/previous/source/apm/alipay_source.rb +13 -0
  98. data/lib/checkout_sdk/payments/previous/source/apm/alma_source.rb +23 -0
  99. data/lib/checkout_sdk/payments/previous/source/apm/bancontact_source.rb +26 -0
  100. data/lib/checkout_sdk/payments/previous/source/apm/benefit_pay_source.rb +17 -0
  101. data/lib/checkout_sdk/payments/previous/source/apm/boleto_source.rb +26 -0
  102. data/lib/checkout_sdk/payments/previous/source/apm/eps_source.rb +20 -0
  103. data/lib/checkout_sdk/payments/previous/source/apm/fawry_source.rb +47 -0
  104. data/lib/checkout_sdk/payments/previous/source/apm/giropay_source.rb +32 -0
  105. data/lib/checkout_sdk/payments/previous/source/apm/ideal_source.rb +23 -0
  106. data/lib/checkout_sdk/payments/previous/source/apm/integration_type.rb +12 -0
  107. data/lib/checkout_sdk/payments/previous/source/apm/klarna_source.rb +56 -0
  108. data/lib/checkout_sdk/payments/previous/source/apm/knet_source.rb +38 -0
  109. data/lib/checkout_sdk/payments/previous/source/apm/multi_banco_source.rb +23 -0
  110. data/lib/checkout_sdk/payments/previous/source/apm/oxxo_source.rb +26 -0
  111. data/lib/checkout_sdk/payments/previous/source/apm/p24_source.rb +26 -0
  112. data/lib/checkout_sdk/payments/previous/source/apm/pago_facil_source.rb +26 -0
  113. data/lib/checkout_sdk/payments/previous/source/apm/paypal_source.rb +26 -0
  114. data/lib/checkout_sdk/payments/previous/source/apm/poli_source.rb +13 -0
  115. data/lib/checkout_sdk/payments/previous/source/apm/qpay_source.rb +26 -0
  116. data/lib/checkout_sdk/payments/previous/source/apm/rapi_pago_source.rb +26 -0
  117. data/lib/checkout_sdk/payments/previous/source/apm/sofort_source.rb +20 -0
  118. data/lib/checkout_sdk/payments/previous/source/card_source.rb +41 -0
  119. data/lib/checkout_sdk/payments/previous/source/customer_source.rb +17 -0
  120. data/lib/checkout_sdk/payments/previous/source/d_local_source.rb +41 -0
  121. data/lib/checkout_sdk/payments/previous/source/id_source.rb +20 -0
  122. data/lib/checkout_sdk/payments/previous/source/network_token_source.rb +47 -0
  123. data/lib/checkout_sdk/payments/previous/source/payment_source.rb +21 -0
  124. data/lib/checkout_sdk/payments/previous/source/token_source.rb +26 -0
  125. data/lib/checkout_sdk/payments/processing_settings.rb +15 -0
  126. data/lib/checkout_sdk/payments/sender/corporate_sender.rb +1 -1
  127. data/lib/checkout_sdk/payments/sender/government_sender.rb +1 -1
  128. data/lib/checkout_sdk/payments/sender/individual_sender.rb +1 -1
  129. data/lib/checkout_sdk/payments/sender/sender.rb +2 -2
  130. data/lib/checkout_sdk/payments/source/apm/after_pay_source.rb +1 -1
  131. data/lib/checkout_sdk/payments/source/apm/alipay_plus_source.rb +1 -1
  132. data/lib/checkout_sdk/payments/source/apm/alma_source.rb +15 -0
  133. data/lib/checkout_sdk/payments/source/apm/bancontact_source.rb +1 -1
  134. data/lib/checkout_sdk/payments/source/apm/benefit_source.rb +1 -1
  135. data/lib/checkout_sdk/payments/source/apm/eps_source.rb +1 -1
  136. data/lib/checkout_sdk/payments/source/apm/fawry_product.rb +20 -0
  137. data/lib/checkout_sdk/payments/source/apm/fawry_source.rb +30 -0
  138. data/lib/checkout_sdk/payments/source/apm/giropay_source.rb +1 -1
  139. data/lib/checkout_sdk/payments/source/apm/ideal_source.rb +1 -1
  140. data/lib/checkout_sdk/payments/source/apm/klarna_source.rb +15 -0
  141. data/lib/checkout_sdk/payments/source/apm/knet_source.rb +1 -1
  142. data/lib/checkout_sdk/payments/source/apm/mbway_source.rb +1 -1
  143. data/lib/checkout_sdk/payments/source/apm/multi_banco_source.rb +1 -1
  144. data/lib/checkout_sdk/payments/source/apm/p24_source.rb +1 -1
  145. data/lib/checkout_sdk/payments/source/apm/paypal_source.rb +5 -1
  146. data/lib/checkout_sdk/payments/source/apm/post_finance_source.rb +1 -1
  147. data/lib/checkout_sdk/payments/source/apm/qpay_source.rb +1 -1
  148. data/lib/checkout_sdk/payments/source/apm/sofort_source.rb +1 -1
  149. data/lib/checkout_sdk/payments/source/apm/stcpay_source.rb +1 -1
  150. data/lib/checkout_sdk/payments/source/apm/tamara_source.rb +1 -1
  151. data/lib/checkout_sdk/payments/source/apm/we_chat_pay_source.rb +1 -1
  152. data/lib/checkout_sdk/payments/source/bank_account_source.rb +1 -1
  153. data/lib/checkout_sdk/payments/source/card_source.rb +3 -3
  154. data/lib/checkout_sdk/payments/source/currency_account_source.rb +1 -1
  155. data/lib/checkout_sdk/payments/source/customer_source.rb +15 -0
  156. data/lib/checkout_sdk/payments/source/id_source.rb +1 -1
  157. data/lib/checkout_sdk/payments/source/network_token_source.rb +1 -1
  158. data/lib/checkout_sdk/payments/source/{payment_request_source.rb → payment_source.rb} +2 -1
  159. data/lib/checkout_sdk/payments/source/{payout_request_source.rb → payout_source.rb} +3 -3
  160. data/lib/checkout_sdk/payments/source/provider_token_source.rb +1 -1
  161. data/lib/checkout_sdk/payments/source/token_source.rb +1 -1
  162. data/lib/checkout_sdk/payments/three_ds_request.rb +7 -1
  163. data/lib/checkout_sdk/previous/checkout_api.rb +37 -5
  164. data/lib/checkout_sdk/previous/checkout_previous_static_keys_sdk_builder.rb +2 -1
  165. data/lib/checkout_sdk/reports/reports.rb +4 -0
  166. data/lib/checkout_sdk/reports/reports_client.rb +26 -0
  167. data/lib/checkout_sdk/reports/reports_query.rb +23 -0
  168. data/lib/checkout_sdk/sources/mandate_type.rb +12 -0
  169. data/lib/checkout_sdk/sources/sepa_source_request.rb +20 -0
  170. data/lib/checkout_sdk/sources/source_data.rb +28 -0
  171. data/lib/checkout_sdk/sources/source_request.rb +30 -0
  172. data/lib/checkout_sdk/sources/source_type.rb +11 -0
  173. data/lib/checkout_sdk/sources/sources.rb +9 -0
  174. data/lib/checkout_sdk/sources/sources_client.rb +23 -0
  175. data/lib/checkout_sdk/tokens/card_token_request.rb +2 -2
  176. data/lib/checkout_sdk/tokens/wallet_token_request.rb +1 -1
  177. data/lib/checkout_sdk/version.rb +1 -1
  178. data/lib/checkout_sdk/workflows/create_workflow.rb +20 -0
  179. data/lib/checkout_sdk/workflows/entity_workflow_condition.rb +15 -0
  180. data/lib/checkout_sdk/workflows/event_workflow_condition.rb +15 -0
  181. data/lib/checkout_sdk/workflows/patch_workflow.rb +14 -0
  182. data/lib/checkout_sdk/workflows/processing_channel_workflow_condition.rb +15 -0
  183. data/lib/checkout_sdk/workflows/reflow.rb +11 -0
  184. data/lib/checkout_sdk/workflows/reflow_by_events.rb +11 -0
  185. data/lib/checkout_sdk/workflows/reflow_by_subjects.rb +11 -0
  186. data/lib/checkout_sdk/workflows/webhook_signature.rb +14 -0
  187. data/lib/checkout_sdk/workflows/webhook_workflow_action.rb +21 -0
  188. data/lib/checkout_sdk/workflows/workflow_action.rb +19 -0
  189. data/lib/checkout_sdk/workflows/workflow_action_type.rb +9 -0
  190. data/lib/checkout_sdk/workflows/workflow_condition.rb +19 -0
  191. data/lib/checkout_sdk/workflows/workflow_condition_type.rb +11 -0
  192. data/lib/checkout_sdk/workflows/workflows.rb +18 -0
  193. data/lib/checkout_sdk/workflows/workflows_client.rb +115 -0
  194. data/lib/checkout_sdk.rb +6 -0
  195. metadata +124 -13
  196. data/lib/checkout_sdk/apm/previous/klarna/klarna_shipping_info.rb +0 -33
  197. data/lib/checkout_sdk/common/abstract_file_request.rb +0 -11
@@ -17,10 +17,10 @@ module CheckoutSdk
17
17
  # @!attribute store_for_future_use
18
18
  # @return [TrueClass, FalseClass]
19
19
  # @!attribute billing_address
20
- # @return [String] {CheckoutSdk::Common::Address}
20
+ # @return [CheckoutSdk::Common::Address]
21
21
  # @!attribute phone
22
- # @return [String] {CheckoutSdk::Common::Phone}
23
- class CardSource < PaymentRequestSource
22
+ # @return [CheckoutSdk::Common::Phone]
23
+ class CardSource < PaymentSource
24
24
  attr_accessor :number,
25
25
  :expiry_month,
26
26
  :expiry_year,
@@ -4,7 +4,7 @@ module CheckoutSdk
4
4
  module Payments
5
5
  # @!attribute id
6
6
  # @return [String]
7
- class CurrencyAccountSource < PayoutRequestSource
7
+ class CurrencyAccountSource < PayoutSource
8
8
  attr_accessor :id
9
9
 
10
10
  def initialize
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CheckoutSdk
4
+ module Payments
5
+ # @!attribute id
6
+ # @return [String]
7
+ class CustomerSource < PaymentSource
8
+ attr_accessor :id
9
+
10
+ def initialize
11
+ super CheckoutSdk::Common::PaymentSourceType::CUSTOMER
12
+ end
13
+ end
14
+ end
15
+ end
@@ -8,7 +8,7 @@ module CheckoutSdk
8
8
  # @return [String]
9
9
  # @!attribute payment_method
10
10
  # @return [String]
11
- class IdSource < PaymentRequestSource
11
+ class IdSource < PaymentSource
12
12
  attr_accessor :id,
13
13
  :cvv,
14
14
  :payment_method
@@ -24,7 +24,7 @@ module CheckoutSdk
24
24
  # @return [CheckoutSdk::Common::Address]
25
25
  # @!attribute phone
26
26
  # @return [CheckoutSdk::Common::Phone]
27
- class NetworkTokenSource < PaymentRequestSource
27
+ class NetworkTokenSource < PaymentSource
28
28
  attr_accessor :token,
29
29
  :expiry_month,
30
30
  :expiry_year,
@@ -4,11 +4,12 @@ module CheckoutSdk
4
4
  module Payments
5
5
  # @!attribute type
6
6
  # @return [String] {CheckoutSdk::Common::PaymentSourceType}
7
- class PaymentRequestSource
7
+ class PaymentSource
8
8
  attr_reader :type
9
9
 
10
10
  protected
11
11
 
12
+ # @abstract
12
13
  # @param [String] type {CheckoutSdk::Common::PaymentSourceType}
13
14
  def initialize(type)
14
15
  @type = type
@@ -6,9 +6,9 @@ module CheckoutSdk
6
6
  # @return [String] {PayoutSourceType}
7
7
  # @!attribute amount
8
8
  # @return [String]
9
- class PayoutRequestSource
10
- attr_accessor :type,
11
- :amount
9
+ class PayoutSource
10
+ attr_reader :type
11
+ attr_accessor :amount
12
12
 
13
13
  protected
14
14
 
@@ -8,7 +8,7 @@ module CheckoutSdk
8
8
  # @return [String]
9
9
  # @!attribute account_holder
10
10
  # @return [CheckoutSdk::Common::AccountHolder]
11
- class ProviderTokenSource < PaymentRequestSource
11
+ class ProviderTokenSource < PaymentSource
12
12
  attr_accessor :payment_method,
13
13
  :token,
14
14
  :account_holder
@@ -10,7 +10,7 @@ module CheckoutSdk
10
10
  # @return [CheckoutSdk::Common::Phone]
11
11
  # @!attribute store_for_future_use
12
12
  # @return [TrueClass, FalseClass]
13
- class TokenSource < PaymentRequestSource
13
+ class TokenSource < PaymentSource
14
14
  attr_accessor :token,
15
15
  :billing_address,
16
16
  :phone,
@@ -18,6 +18,8 @@ module CheckoutSdk
18
18
  # @return [String] {Exemption}
19
19
  # @!attribute challenge_indicator
20
20
  # @return [String] {ChallengeIndicator}
21
+ # @!attribute allow_upgrade
22
+ # @return [TrueClass, FalseClass]
21
23
  # @!attribute status
22
24
  # @return [String]
23
25
  # @!attribute authentication_date
@@ -34,6 +36,8 @@ module CheckoutSdk
34
36
  # @return [String]
35
37
  # @!attribute cryptogram_algorithm
36
38
  # @return [String]
39
+ # @!attribute authentication_id
40
+ # @return [String]
37
41
  class ThreeDSRequest
38
42
  attr_accessor :enabled,
39
43
  :attempt_n3d,
@@ -43,6 +47,7 @@ module CheckoutSdk
43
47
  :version,
44
48
  :exemption,
45
49
  :challenge_indicator,
50
+ :allow_upgrade,
46
51
  :status,
47
52
  :authentication_date,
48
53
  :authentication_amount,
@@ -50,7 +55,8 @@ module CheckoutSdk
50
55
  :status_reason_code,
51
56
  :challenge_cancel_reason,
52
57
  :score,
53
- :cryptogram_algorithm
58
+ :cryptogram_algorithm,
59
+ :authentication_id
54
60
  end
55
61
  end
56
62
  end
@@ -2,19 +2,51 @@
2
2
 
3
3
  module CheckoutSdk
4
4
  module Previous
5
+ # @!attribute customers
6
+ # @return [CheckoutSdk::Customers::CustomerClient]
7
+ # @!attribute disputes
8
+ # @return [CheckoutSdk::Disputes::DisputesClient]
9
+ # @!attribute payments
10
+ # @return [CheckoutSdk::Payments::HostedPaymentsClient]
11
+ # @!attribute instruments
12
+ # @return [CheckoutSdk::Previous::Instruments::InstrumentsClient]
13
+ # @!attribute links
14
+ # @return [CheckoutSdk::Payments::PaymentsLinksClient]
15
+ # @!attribute payments
16
+ # @return [CheckoutSdk::Payments::PaymentsClient]
17
+ # @!attribute sources
18
+ # @return [CheckoutSdk::Previous::Sources::SourcesClient]
19
+ # @!attribute tokens
20
+ # @return [CheckoutSdk::Tokens::TokensClient]
5
21
  # @!attribute klarna
6
- # @return [CheckoutSdk::Previous::Apm::Klarna::KlarnaClient]
22
+ # @return [CheckoutSdk::Previous::Apm::KlarnaClient]
7
23
  # @!attribute sepa
8
- # @return [CheckoutSdk::Previous::Apm::Sepa::SepaClient]
24
+ # @return [CheckoutSdk::Previous::Apm::SepaClient]
9
25
  class CheckoutApi
10
- attr_reader :klarna,
26
+ attr_reader :customers,
27
+ :disputes,
28
+ :hosted,
29
+ :instruments,
30
+ :links,
31
+ :payments,
32
+ :sources,
33
+ :tokens,
34
+ :klarna,
11
35
  :sepa
12
36
 
13
37
  # @param [CheckoutConfiguration] configuration
14
38
  def initialize(configuration)
15
39
  api_client = base_api_client configuration
16
- @klarna = CheckoutSdk::Previous::Apm::Klarna::KlarnaClient.new api_client, configuration
17
- @sepa = CheckoutSdk::Previous::Apm::Sepa::SepaClient.new api_client, configuration
40
+ @customers = CheckoutSdk::Customers::CustomersClient.new api_client, configuration
41
+ @disputes = CheckoutSdk::Disputes::DisputesClient.new api_client, configuration
42
+ @hosted = CheckoutSdk::Payments::HostedPaymentsClient.new api_client, configuration
43
+ @instruments = CheckoutSdk::Previous::Instruments::InstrumentsClient.new api_client, configuration
44
+ @links = CheckoutSdk::Payments::PaymentsLinksClient.new api_client, configuration
45
+ @payments = CheckoutSdk::Previous::Payments::PaymentsClient.new api_client, configuration
46
+ @sources = CheckoutSdk::Previous::Sources::SourcesClient.new api_client, configuration
47
+ @tokens = CheckoutSdk::Tokens::TokensClient.new api_client, configuration
48
+ @klarna = CheckoutSdk::Previous::Apm::KlarnaClient.new api_client, configuration
49
+ @sepa = CheckoutSdk::Previous::Apm::SepaClient.new api_client, configuration
18
50
  end
19
51
 
20
52
  private
@@ -15,7 +15,8 @@ module CheckoutSdk
15
15
  CheckoutConfiguration.new(
16
16
  PreviousStaticKeysSdkCredentials.new(secret_key, public_key),
17
17
  environment,
18
- http_client
18
+ http_client,
19
+ multipart_http_client
19
20
  )
20
21
  )
21
22
  end
@@ -0,0 +1,4 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'checkout_sdk/reports/reports_query'
4
+ require 'checkout_sdk/reports/reports_client'
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CheckoutSdk
4
+ module Reports
5
+ class ReportsClient < Client
6
+ REPORTS = 'reports'
7
+ FILES = 'files'
8
+
9
+ # @param [ApiClient] api_client
10
+ # @param [CheckoutConfiguration] configuration
11
+ def initialize(api_client, configuration)
12
+ super api_client, configuration, CheckoutSdk::AuthorizationType::SECRET_KEY_OR_OAUTH
13
+ end
14
+
15
+ # @param [ReportsQuery] query_filter
16
+ def get_all_reports(query_filter)
17
+ api_client.invoke_get(REPORTS, sdk_authorization, query_filter)
18
+ end
19
+
20
+ # @param [String] report_id
21
+ def get_report_details(report_id)
22
+ api_client.invoke_get(build_path(REPORTS, report_id), sdk_authorization)
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CheckoutSdk
4
+ module Reports
5
+ # @!attribute created_after
6
+ # @return [DateTime]
7
+ # @!attribute created_before
8
+ # @return [DateTime]
9
+ # @!attribute entity_id
10
+ # @return [String]
11
+ # @!attribute limit
12
+ # @return [Integer]
13
+ # @!attribute pagination_token
14
+ # @return [String]
15
+ class ReportsQuery
16
+ attr_accessor :created_after,
17
+ :created_before,
18
+ :entity_id,
19
+ :limit,
20
+ :pagination_token
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CheckoutSdk
4
+ module Previous
5
+ module Sources
6
+ module MandateType
7
+ SINGLE = 'single'
8
+ RECURRING = 'recurring'
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CheckoutSdk
4
+ module Previous
5
+ module Sources
6
+ # @!attribute billing_address
7
+ # @return [CheckoutSdk::Common::Address]
8
+ # @!attribute source_data
9
+ # @return [SourceData]
10
+ class SepaSourceRequest < SourceRequest
11
+ attr_accessor :billing_address,
12
+ :source_data
13
+
14
+ def initialize
15
+ super CheckoutSdk::Previous::Sources::SourceType::SEPA
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CheckoutSdk
4
+ module Previous
5
+ module Sources
6
+ # @!attribute first_name
7
+ # @return [String]
8
+ # @!attribute last_name
9
+ # @return [String]
10
+ # @!attribute account_iban
11
+ # @return [String]
12
+ # @!attribute bic
13
+ # @return [String]
14
+ # @!attribute billing_descriptor
15
+ # @return [String]
16
+ # @!attribute mandate_type
17
+ # @return [SourceData]
18
+ class SourceData
19
+ attr_accessor :first_name,
20
+ :last_name,
21
+ :account_iban,
22
+ :bic,
23
+ :billing_descriptor,
24
+ :mandate_type
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,30 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CheckoutSdk
4
+ module Previous
5
+ module Sources
6
+ # @!attribute type
7
+ # @return [String] {SourceType}
8
+ # @!attribute reference
9
+ # @return [String]
10
+ # @!attribute phone
11
+ # @return [CheckoutSdk::Common::Phone]
12
+ # @!attribute customer
13
+ # @return [CheckoutSdk::Common::CustomerRequest]
14
+ class SourceRequest
15
+ attr_reader :type
16
+ attr_accessor :reference,
17
+ :phone,
18
+ :customer
19
+
20
+ protected
21
+
22
+ # @abstract
23
+ # @param [String] {SourceType}
24
+ def initialize(type)
25
+ @type = type
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CheckoutSdk
4
+ module Previous
5
+ module Sources
6
+ module SourceType
7
+ SEPA = 'sepa'
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'checkout_sdk/sources/source_type'
4
+ require 'checkout_sdk/sources/mandate_type'
5
+ require 'checkout_sdk/sources/source_data'
6
+ require 'checkout_sdk/sources/source_request'
7
+ require 'checkout_sdk/sources/sepa_source_request'
8
+
9
+ require 'checkout_sdk/sources/sources_client'
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CheckoutSdk
4
+ module Previous
5
+ module Sources
6
+ class SourcesClient < Client
7
+ SOURCES = 'sources'
8
+ private_constant :SOURCES
9
+
10
+ # @param [ApiClient] api_client
11
+ # @param [CheckoutConfiguration] configuration
12
+ def initialize(api_client, configuration)
13
+ super api_client, configuration, CheckoutSdk::AuthorizationType::SECRET_KEY
14
+ end
15
+
16
+ # @param [SepaSourceRequest] sepa_source_request
17
+ def create_sepa_source(sepa_source_request)
18
+ api_client.invoke_post(SOURCES, sdk_authorization, sepa_source_request)
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
@@ -15,9 +15,9 @@ module CheckoutSdk
15
15
  # @!attribute cvv
16
16
  # @return [String]
17
17
  # @!attribute billing_address
18
- # @return [String] {CheckoutSdk::Common::Address}
18
+ # @return [CheckoutSdk::Common::Address]
19
19
  # @!attribute phone
20
- # @return [String] {CheckoutSdk::Common::Phone}
20
+ # @return [CheckoutSdk::Common::Phone]
21
21
  class CardTokenRequest
22
22
  attr_accessor :type,
23
23
  :number,
@@ -5,7 +5,7 @@ module CheckoutSdk
5
5
  # @!attribute type
6
6
  # @return [String] {TokenType}
7
7
  class WalletTokenRequest
8
- attr_accessor :type
8
+ attr_reader :type
9
9
 
10
10
  protected
11
11
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CheckoutSdk
4
- VERSION = '1.0.0.beta.0'
4
+ VERSION = '1.0.0.beta.2'
5
5
  end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CheckoutSdk
4
+ module Workflows
5
+ # @!attribute name
6
+ # @return [String]
7
+ # @!attribute active
8
+ # @return [TrueClass, FalseClass]
9
+ # @!attribute conditions
10
+ # @return [Array(WorkflowCondition)]
11
+ # @!attribute actions
12
+ # @return [Array(WorkflowAction)]
13
+ class CreateWorkflow
14
+ attr_accessor :name,
15
+ :active,
16
+ :conditions,
17
+ :actions
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CheckoutSdk
4
+ module Workflows
5
+ # @!attribute entities
6
+ # @return [Array(String)]
7
+ class EntityWorkflowCondition < WorkflowCondition
8
+ attr_accessor :entities
9
+
10
+ def initialize
11
+ super CheckoutSdk::Workflows::WorkflowConditionType::ENTITY
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CheckoutSdk
4
+ module Workflows
5
+ # @!attribute events
6
+ # @return [Hash(String=>Array(String))]
7
+ class EventWorkflowCondition < WorkflowCondition
8
+ attr_accessor :events
9
+
10
+ def initialize
11
+ super CheckoutSdk::Workflows::WorkflowConditionType::EVENT
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CheckoutSdk
4
+ module Workflows
5
+ # @!attribute name
6
+ # @return [String]
7
+ # @!attribute active
8
+ # @return [TrueClass, FalseClass]
9
+ class PatchWorkflow
10
+ attr_accessor :name,
11
+ :active
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CheckoutSdk
4
+ module Workflows
5
+ # @!attribute processing_channels
6
+ # @return [Array(String)]
7
+ class ProcessingChannelWorkflowCondition < WorkflowCondition
8
+ attr_accessor :processing_channels
9
+
10
+ def initialize
11
+ super CheckoutSdk::Workflows::WorkflowConditionType::PROCESSING_CHANNEL
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CheckoutSdk
4
+ module Workflows
5
+ # @!attribute workflows
6
+ # @return [Array(String)]
7
+ class Reflow
8
+ attr_accessor :workflows
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CheckoutSdk
4
+ module Workflows
5
+ # @!attribute events
6
+ # @return [Array(String)]
7
+ class ReflowByEvents < Reflow
8
+ attr_accessor :events
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CheckoutSdk
4
+ module Workflows
5
+ # @!attribute subjects
6
+ # @return [Array(String)]
7
+ class ReflowBySubjects < Reflow
8
+ attr_accessor :subjects
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CheckoutSdk
4
+ module Workflows
5
+ # @!attribute method
6
+ # @return [String]
7
+ # @!attribute key
8
+ # @return [String]
9
+ class WebhookSignature
10
+ attr_accessor :method,
11
+ :key
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CheckoutSdk
4
+ module Workflows
5
+ # @!attribute url
6
+ # @return [String]
7
+ # @!attribute headers
8
+ # @return [Hash{String => String}]
9
+ # @!attribute signature
10
+ # @return [WebhookSignature]
11
+ class WebhookWorkflowAction < WorkflowAction
12
+ attr_accessor :url,
13
+ :headers,
14
+ :signature
15
+
16
+ def initialize
17
+ super CheckoutSdk::Workflows::WorkflowActionType::WEBHOOK
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CheckoutSdk
4
+ module Workflows
5
+ # @!attribute type
6
+ # @return [String] {WorkflowActionType}
7
+ class WorkflowAction
8
+ attr_reader :type
9
+
10
+ protected
11
+
12
+ # @abstract
13
+ # @param [String] {WorkflowActionType}
14
+ def initialize(type)
15
+ @type = type
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CheckoutSdk
4
+ module Workflows
5
+ module WorkflowActionType
6
+ WEBHOOK = 'webhook'
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CheckoutSdk
4
+ module Workflows
5
+ # @!attribute type
6
+ # @return [String] {WorkflowConditionType}
7
+ class WorkflowCondition
8
+ attr_reader :type
9
+
10
+ protected
11
+
12
+ # @abstract
13
+ # @param [String] {WorkflowConditionType}
14
+ def initialize(type)
15
+ @type = type
16
+ end
17
+ end
18
+ end
19
+ end