checkout_sdk 1.0.0.beta.1 → 1.0.0.beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (89) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +3 -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 +11 -20
  35. data/lib/checkout_sdk/checkout_api.rb +28 -2
  36. data/lib/checkout_sdk/checkout_configuration.rb +6 -4
  37. data/lib/checkout_sdk/checkout_oauth_sdk_builder.rb +3 -1
  38. data/lib/checkout_sdk/checkout_static_keys_sdk_builder.rb +2 -1
  39. data/lib/checkout_sdk/checkout_utils.rb +15 -0
  40. data/lib/checkout_sdk/common/common.rb +1 -1
  41. data/lib/checkout_sdk/common/file_request.rb +5 -2
  42. data/lib/checkout_sdk/common/product.rb +17 -0
  43. data/lib/checkout_sdk/instruments/create/instrument.rb +2 -0
  44. data/lib/checkout_sdk/instruments/update/update_instrument.rb +2 -0
  45. data/lib/checkout_sdk/oauth_scopes.rb +2 -0
  46. data/lib/checkout_sdk/oauth_sdk_credentials.rb +5 -13
  47. data/lib/checkout_sdk/payments/base_payments_client.rb +5 -0
  48. data/lib/checkout_sdk/payments/billing_information.rb +14 -0
  49. data/lib/checkout_sdk/payments/hosted/hosted_payments_client.rb +25 -0
  50. data/lib/checkout_sdk/payments/hosted/hosted_payments_session.rb +87 -0
  51. data/lib/checkout_sdk/payments/links/payment_link.rb +84 -0
  52. data/lib/checkout_sdk/payments/links/payments_links_client.rb +25 -0
  53. data/lib/checkout_sdk/payments/payment_type.rb +0 -1
  54. data/lib/checkout_sdk/payments/payments.rb +12 -1
  55. data/lib/checkout_sdk/payments/payments_query_filter.rb +17 -0
  56. data/lib/checkout_sdk/payments/previous/source/payment_source.rb +1 -0
  57. data/lib/checkout_sdk/payments/sender/corporate_sender.rb +1 -1
  58. data/lib/checkout_sdk/payments/sender/government_sender.rb +1 -1
  59. data/lib/checkout_sdk/payments/sender/individual_sender.rb +1 -1
  60. data/lib/checkout_sdk/payments/source/card_source.rb +2 -2
  61. data/lib/checkout_sdk/payments/source/customer_source.rb +15 -0
  62. data/lib/checkout_sdk/payments/source/payment_source.rb +1 -0
  63. data/lib/checkout_sdk/payments/three_ds_request.rb +3 -0
  64. data/lib/checkout_sdk/previous/checkout_api.rb +8 -0
  65. data/lib/checkout_sdk/previous/checkout_previous_static_keys_sdk_builder.rb +2 -1
  66. data/lib/checkout_sdk/reports/reports.rb +4 -0
  67. data/lib/checkout_sdk/reports/reports_client.rb +26 -0
  68. data/lib/checkout_sdk/reports/reports_query.rb +23 -0
  69. data/lib/checkout_sdk/tokens/card_token_request.rb +2 -2
  70. data/lib/checkout_sdk/version.rb +1 -1
  71. data/lib/checkout_sdk/workflows/create_workflow.rb +20 -0
  72. data/lib/checkout_sdk/workflows/entity_workflow_condition.rb +15 -0
  73. data/lib/checkout_sdk/workflows/event_workflow_condition.rb +15 -0
  74. data/lib/checkout_sdk/workflows/patch_workflow.rb +14 -0
  75. data/lib/checkout_sdk/workflows/processing_channel_workflow_condition.rb +15 -0
  76. data/lib/checkout_sdk/workflows/reflow.rb +11 -0
  77. data/lib/checkout_sdk/workflows/reflow_by_events.rb +11 -0
  78. data/lib/checkout_sdk/workflows/reflow_by_subjects.rb +11 -0
  79. data/lib/checkout_sdk/workflows/webhook_signature.rb +14 -0
  80. data/lib/checkout_sdk/workflows/webhook_workflow_action.rb +21 -0
  81. data/lib/checkout_sdk/workflows/workflow_action.rb +19 -0
  82. data/lib/checkout_sdk/workflows/workflow_action_type.rb +9 -0
  83. data/lib/checkout_sdk/workflows/workflow_condition.rb +19 -0
  84. data/lib/checkout_sdk/workflows/workflow_condition_type.rb +11 -0
  85. data/lib/checkout_sdk/workflows/workflows.rb +18 -0
  86. data/lib/checkout_sdk/workflows/workflows_client.rb +115 -0
  87. data/lib/checkout_sdk.rb +3 -0
  88. metadata +58 -3
  89. data/lib/checkout_sdk/common/abstract_file_request.rb +0 -11
@@ -0,0 +1,84 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CheckoutSdk
4
+ module Payments
5
+ # @!attribute amount
6
+ # @return [Integer]
7
+ # @!attribute currency
8
+ # @return [String] {CheckoutSdk::Common::Currency}
9
+ # @!attribute payment_type
10
+ # @return [String] {PaymentType}
11
+ # @!attribute payment_ip
12
+ # @return [String]
13
+ # @!attribute billing_descriptor
14
+ # @return [BillingDescriptor]
15
+ # @!attribute reference
16
+ # @return [String]
17
+ # @!attribute description
18
+ # @return [String]
19
+ # @!attribute processing_channel_id
20
+ # @return [String] - Not available on Previous.
21
+ # @!attribute marketplace
22
+ # @deprecated Please use {#amount_allocations} instead
23
+ # @return [CheckoutSdk::Common::MarketplaceData] - Not available on Previous.
24
+ # @!attribute amount_allocations
25
+ # @return [Array(CheckoutSdk::Common::AmountAllocations)] - Not available on Previous.
26
+ # @!attribute expires_in
27
+ # @return [Integer]
28
+ # @!attribute customer
29
+ # @return [CheckoutSdk::Common::CustomerRequest]
30
+ # @!attribute shipping
31
+ # @return [ShippingDetails]
32
+ # @!attribute billing
33
+ # @return [BillingInformation]
34
+ # @!attribute recipient
35
+ # @return [PaymentRecipient]
36
+ # @!attribute processing
37
+ # @return [ProcessingSettings]
38
+ # @!attribute allow_payment_methods
39
+ # @return [Array(CheckoutSdk::Common::PaymentSourceType)]
40
+ # @!attribute products
41
+ # @return [Array(CheckoutSdk::Common::Product)]
42
+ # @!attribute metadata
43
+ # @return [Hash(String=>Object)]
44
+ # @!attribute three_ds
45
+ # @return [ThreeDSRequest]
46
+ # @!attribute risk
47
+ # @return [RiskRequest]
48
+ # @!attribute return_url
49
+ # @return [String]
50
+ # @!attribute locale
51
+ # @return [String]
52
+ # @!attribute capture
53
+ # @return [TrueClass, FalseClass]
54
+ # @!attribute capture_on
55
+ # @return [Time]
56
+ class PaymentLink
57
+ attr_accessor :amount,
58
+ :currency,
59
+ :payment_type,
60
+ :payment_ip,
61
+ :billing_descriptor,
62
+ :reference,
63
+ :description,
64
+ :processing_channel_id,
65
+ :marketplace,
66
+ :amount_allocations,
67
+ :expires_in,
68
+ :customer,
69
+ :shipping,
70
+ :billing,
71
+ :recipient,
72
+ :processing,
73
+ :allow_payment_methods,
74
+ :products,
75
+ :metadata,
76
+ :three_ds,
77
+ :risk,
78
+ :return_url,
79
+ :locale,
80
+ :capture,
81
+ :capture_on
82
+ end
83
+ end
84
+ end
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CheckoutSdk
4
+ module Payments
5
+ class PaymentsLinksClient < Client
6
+ PAYMENT_LINKS = 'payment-links'
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 [PaymentLink] payment_link
15
+ def create_payment_link(payment_link)
16
+ api_client.invoke_post(PAYMENT_LINKS, sdk_authorization, payment_link)
17
+ end
18
+
19
+ # @param [String] payment_link_id
20
+ def get_payment_link(payment_link_id)
21
+ api_client.invoke_get(build_path(PAYMENT_LINKS, payment_link_id), sdk_authorization)
22
+ end
23
+ end
24
+ end
25
+ end
@@ -7,7 +7,6 @@ module CheckoutSdk
7
7
  RECURRING = 'Recurring'
8
8
  MOTO = 'Moto'
9
9
  INSTALLMENT = 'Installment'
10
- UNSCHEDULED = 'Unscheduled'
11
10
  end
12
11
  end
13
12
  end
@@ -39,6 +39,8 @@ require 'checkout_sdk/payments/terminal_type'
39
39
  require 'checkout_sdk/payments/flight_leg_details'
40
40
  require 'checkout_sdk/payments/billing_plan'
41
41
  require 'checkout_sdk/payments/billing_plan_type'
42
+ require 'checkout_sdk/payments/billing_information'
43
+ require 'checkout_sdk/payments/payments_query_filter'
42
44
 
43
45
  # Source
44
46
  require 'checkout_sdk/payments/source/payment_source'
@@ -47,6 +49,7 @@ require 'checkout_sdk/payments/source/network_token_source'
47
49
  require 'checkout_sdk/payments/source/token_source'
48
50
  require 'checkout_sdk/payments/source/provider_token_source'
49
51
  require 'checkout_sdk/payments/source/bank_account_source'
52
+ require 'checkout_sdk/payments/source/customer_source'
50
53
  require 'checkout_sdk/payments/source/payout_source_type'
51
54
  require 'checkout_sdk/payments/source/currency_account_source'
52
55
  require 'checkout_sdk/payments/source/id_source'
@@ -92,7 +95,7 @@ require 'checkout_sdk/payments/destination/card_destination'
92
95
  require 'checkout_sdk/payments/destination/destination_type'
93
96
  require 'checkout_sdk/payments/destination/id_destination'
94
97
 
95
- ## Previous
98
+ # Previous
96
99
  require 'checkout_sdk/payments/previous/fund_transfer_type'
97
100
  require 'checkout_sdk/payments/previous/capture_request'
98
101
  require 'checkout_sdk/payments/previous/payout_request'
@@ -138,3 +141,11 @@ require 'checkout_sdk/payments/previous/destination/id_destination'
138
141
  require 'checkout_sdk/payments/base_payments_client'
139
142
  require 'checkout_sdk/payments/payments_client'
140
143
  require 'checkout_sdk/payments/previous/payments_client'
144
+
145
+ # Hosted Payments
146
+ require 'checkout_sdk/payments/hosted/hosted_payments_session'
147
+ require 'checkout_sdk/payments/hosted/hosted_payments_client'
148
+
149
+ # Payment Links
150
+ require 'checkout_sdk/payments/links/payment_link'
151
+ require 'checkout_sdk/payments/links/payments_links_client'
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CheckoutSdk
4
+ module Payments
5
+ # @!attribute limit
6
+ # @return [Integer]
7
+ # @!attribute skip
8
+ # @return [Integer]
9
+ # @!attribute reference
10
+ # @return [String]
11
+ class PaymentsQueryFilter
12
+ attr_accessor :limit,
13
+ :skip,
14
+ :reference
15
+ end
16
+ end
17
+ end
@@ -10,6 +10,7 @@ module CheckoutSdk
10
10
 
11
11
  protected
12
12
 
13
+ # @abstract
13
14
  # @param [String] type {CheckoutSdk::Common::PaymentSourceType}
14
15
  def initialize(type)
15
16
  @type = type
@@ -5,7 +5,7 @@ module CheckoutSdk
5
5
  # @!attribute company_name
6
6
  # @return [String]
7
7
  # @!attribute address
8
- # @return [String] {CheckoutSdk::Common::Address}
8
+ # @return [CheckoutSdk::Common::Address]
9
9
  # @!attribute reference_type
10
10
  # @return [String]
11
11
  # @!attribute source_of_funds
@@ -5,7 +5,7 @@ module CheckoutSdk
5
5
  # @!attribute company_name
6
6
  # @return [String]
7
7
  # @!attribute address
8
- # @return [String] {CheckoutSdk::Common::Address}
8
+ # @return [CheckoutSdk::Common::Address]
9
9
  # @!attribute reference_type
10
10
  # @return [String]
11
11
  # @!attribute source_of_funds
@@ -7,7 +7,7 @@ module CheckoutSdk
7
7
  # @!attribute last_name
8
8
  # @return [String]
9
9
  # @!attribute address
10
- # @return [String] {CheckoutSdk::Common::Address}
10
+ # @return [CheckoutSdk::Common::Address]
11
11
  # @!attribute identification
12
12
  # @return [CheckoutSdk::Common::AccountHolderIdentification]
13
13
  # @!attribute middle_name
@@ -17,9 +17,9 @@ 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}
22
+ # @return [CheckoutSdk::Common::Phone]
23
23
  class CardSource < PaymentSource
24
24
  attr_accessor :number,
25
25
  :expiry_month,
@@ -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
@@ -9,6 +9,7 @@ module CheckoutSdk
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
@@ -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
@@ -45,6 +47,7 @@ module CheckoutSdk
45
47
  :version,
46
48
  :exemption,
47
49
  :challenge_indicator,
50
+ :allow_upgrade,
48
51
  :status,
49
52
  :authentication_date,
50
53
  :authentication_amount,
@@ -6,8 +6,12 @@ module CheckoutSdk
6
6
  # @return [CheckoutSdk::Customers::CustomerClient]
7
7
  # @!attribute disputes
8
8
  # @return [CheckoutSdk::Disputes::DisputesClient]
9
+ # @!attribute payments
10
+ # @return [CheckoutSdk::Payments::HostedPaymentsClient]
9
11
  # @!attribute instruments
10
12
  # @return [CheckoutSdk::Previous::Instruments::InstrumentsClient]
13
+ # @!attribute links
14
+ # @return [CheckoutSdk::Payments::PaymentsLinksClient]
11
15
  # @!attribute payments
12
16
  # @return [CheckoutSdk::Payments::PaymentsClient]
13
17
  # @!attribute sources
@@ -21,7 +25,9 @@ module CheckoutSdk
21
25
  class CheckoutApi
22
26
  attr_reader :customers,
23
27
  :disputes,
28
+ :hosted,
24
29
  :instruments,
30
+ :links,
25
31
  :payments,
26
32
  :sources,
27
33
  :tokens,
@@ -33,7 +39,9 @@ module CheckoutSdk
33
39
  api_client = base_api_client configuration
34
40
  @customers = CheckoutSdk::Customers::CustomersClient.new api_client, configuration
35
41
  @disputes = CheckoutSdk::Disputes::DisputesClient.new api_client, configuration
42
+ @hosted = CheckoutSdk::Payments::HostedPaymentsClient.new api_client, configuration
36
43
  @instruments = CheckoutSdk::Previous::Instruments::InstrumentsClient.new api_client, configuration
44
+ @links = CheckoutSdk::Payments::PaymentsLinksClient.new api_client, configuration
37
45
  @payments = CheckoutSdk::Previous::Payments::PaymentsClient.new api_client, configuration
38
46
  @sources = CheckoutSdk::Previous::Sources::SourcesClient.new api_client, configuration
39
47
  @tokens = CheckoutSdk::Tokens::TokensClient.new api_client, configuration
@@ -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
@@ -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,
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CheckoutSdk
4
- VERSION = '1.0.0.beta.1'
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
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CheckoutSdk
4
+ module Workflows
5
+ module WorkflowConditionType
6
+ EVENT = 'event'
7
+ ENTITY = 'entity'
8
+ PROCESSING_CHANNEL = 'processing_channel'
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'checkout_sdk/workflows/reflow'
4
+ require 'checkout_sdk/workflows/workflow_condition'
5
+ require 'checkout_sdk/workflows/workflow_condition_type'
6
+ require 'checkout_sdk/workflows/event_workflow_condition'
7
+ require 'checkout_sdk/workflows/workflow_action'
8
+ require 'checkout_sdk/workflows/workflows'
9
+ require 'checkout_sdk/workflows/workflows_client'
10
+ require 'checkout_sdk/workflows/entity_workflow_condition'
11
+ require 'checkout_sdk/workflows/create_workflow'
12
+ require 'checkout_sdk/workflows/processing_channel_workflow_condition'
13
+ require 'checkout_sdk/workflows/webhook_workflow_action'
14
+ require 'checkout_sdk/workflows/reflow_by_events'
15
+ require 'checkout_sdk/workflows/webhook_signature'
16
+ require 'checkout_sdk/workflows/patch_workflow'
17
+ require 'checkout_sdk/workflows/workflow_action_type'
18
+ require 'checkout_sdk/workflows/reflow_by_subjects'