checkout_sdk 1.2.2 → 1.3.0

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 (93) hide show
  1. checksums.yaml +4 -4
  2. data/lib/checkout_sdk/accounts/account_holder.rb +10 -2
  3. data/lib/checkout_sdk/accounts/account_holder_corporate.rb +15 -0
  4. data/lib/checkout_sdk/accounts/account_holder_individual.rb +18 -0
  5. data/lib/checkout_sdk/accounts/accounts.rb +23 -0
  6. data/lib/checkout_sdk/accounts/additional_document.rb +11 -0
  7. data/lib/checkout_sdk/accounts/additional_info.rb +17 -0
  8. data/lib/checkout_sdk/accounts/articles_of_association_type.rb +10 -0
  9. data/lib/checkout_sdk/accounts/bank_verification.rb +14 -0
  10. data/lib/checkout_sdk/accounts/bank_verification_type.rb +9 -0
  11. data/lib/checkout_sdk/accounts/company.rb +7 -1
  12. data/lib/checkout_sdk/accounts/contact_details.rb +4 -1
  13. data/lib/checkout_sdk/accounts/date_of_incorporation.rb +14 -0
  14. data/lib/checkout_sdk/accounts/financial_verification.rb +14 -0
  15. data/lib/checkout_sdk/accounts/financial_verification_type.rb +9 -0
  16. data/lib/checkout_sdk/accounts/invitee.rb +11 -0
  17. data/lib/checkout_sdk/accounts/onboard_entity.rb +13 -4
  18. data/lib/checkout_sdk/accounts/onboard_sub_entity_documents.rb +31 -4
  19. data/lib/checkout_sdk/accounts/processing_details.rb +26 -0
  20. data/lib/checkout_sdk/accounts/proof_of_legality.rb +14 -0
  21. data/lib/checkout_sdk/accounts/proof_of_legality_type.rb +9 -0
  22. data/lib/checkout_sdk/accounts/proof_of_principal_address.rb +14 -0
  23. data/lib/checkout_sdk/accounts/proof_of_principal_address_type.rb +9 -0
  24. data/lib/checkout_sdk/accounts/shareholder_structure.rb +14 -0
  25. data/lib/checkout_sdk/accounts/shareholder_structure_type.rb +9 -0
  26. data/lib/checkout_sdk/api_client.rb +59 -50
  27. data/lib/checkout_sdk/client.rb +2 -3
  28. data/lib/checkout_sdk/common/account_change_indicator_type.rb +12 -0
  29. data/lib/checkout_sdk/common/account_holder.rb +12 -9
  30. data/lib/checkout_sdk/common/account_password_change_indicator_type.rb +13 -0
  31. data/lib/checkout_sdk/common/account_type_card_product_type.rb +11 -0
  32. data/lib/checkout_sdk/common/cardholder_account_age_indicator_type.rb +13 -0
  33. data/lib/checkout_sdk/common/common.rb +6 -0
  34. data/lib/checkout_sdk/common/customer_retry.rb +11 -0
  35. data/lib/checkout_sdk/common/destination.rb +38 -0
  36. data/lib/checkout_sdk/common/payment_source_type.rb +8 -0
  37. data/lib/checkout_sdk/common/product.rb +4 -1
  38. data/lib/checkout_sdk/error.rb +24 -8
  39. data/lib/checkout_sdk/payments/applepay.rb +14 -0
  40. data/lib/checkout_sdk/payments/{sessions/card.rb → card.rb} +4 -1
  41. data/lib/checkout_sdk/payments/exemption.rb +2 -0
  42. data/lib/checkout_sdk/payments/googlepay.rb +14 -0
  43. data/lib/checkout_sdk/payments/hosted/hosted_payment_instruction.rb +11 -0
  44. data/lib/checkout_sdk/payments/hosted/hosted_payments_session.rb +44 -23
  45. data/lib/checkout_sdk/payments/hosted/payment_purpose_type.rb +27 -0
  46. data/lib/checkout_sdk/payments/links/payment_link.rb +18 -0
  47. data/lib/checkout_sdk/payments/locale_type.rb +31 -0
  48. data/lib/checkout_sdk/payments/partial_authorization.rb +11 -0
  49. data/lib/checkout_sdk/payments/payment_method_configuration.rb +17 -0
  50. data/lib/checkout_sdk/payments/payment_request.rb +3 -0
  51. data/lib/checkout_sdk/payments/payments.rb +13 -3
  52. data/lib/checkout_sdk/payments/product.rb +3 -0
  53. data/lib/checkout_sdk/payments/refund_order.rb +53 -0
  54. data/lib/checkout_sdk/payments/refund_request.rb +11 -2
  55. data/lib/checkout_sdk/payments/sender/government_sender.rb +3 -0
  56. data/lib/checkout_sdk/payments/sender/individual_sender.rb +3 -0
  57. data/lib/checkout_sdk/payments/sessions/payment_sessions_request.rb +3 -0
  58. data/lib/checkout_sdk/payments/source/apm/ach_source.rb +27 -0
  59. data/lib/checkout_sdk/payments/source/apm/bizum_source.rb +15 -0
  60. data/lib/checkout_sdk/payments/source/apm/octopus_source.rb +11 -0
  61. data/lib/checkout_sdk/payments/source/apm/plaid_source.rb +17 -0
  62. data/lib/checkout_sdk/payments/source/apm/sequra_source.rb +15 -0
  63. data/lib/checkout_sdk/payments/source/card_source.rb +4 -1
  64. data/lib/checkout_sdk/payments/source/customer_source.rb +4 -1
  65. data/lib/checkout_sdk/payments/source/id_source.rb +4 -1
  66. data/lib/checkout_sdk/payments/source/network_token_source.rb +7 -1
  67. data/lib/checkout_sdk/payments/source/token_source.rb +4 -1
  68. data/lib/checkout_sdk/sessions/authentication_method.rb +3 -3
  69. data/lib/checkout_sdk/sessions/authentication_type.rb +3 -3
  70. data/lib/checkout_sdk/sessions/card_holder_account_info.rb +39 -3
  71. data/lib/checkout_sdk/sessions/channel/browser_session.rb +4 -1
  72. data/lib/checkout_sdk/sessions/channel/channel_data_type.rb +1 -0
  73. data/lib/checkout_sdk/sessions/channel/merchant_initiated_session.rb +15 -0
  74. data/lib/checkout_sdk/sessions/channel/request_type.rb +19 -0
  75. data/lib/checkout_sdk/sessions/channel/sdk_interface_type.rb +2 -2
  76. data/lib/checkout_sdk/sessions/initial_transaction.rb +23 -0
  77. data/lib/checkout_sdk/sessions/installment.rb +5 -0
  78. data/lib/checkout_sdk/sessions/merchant_risk_info.rb +20 -2
  79. data/lib/checkout_sdk/sessions/optimization.rb +19 -0
  80. data/lib/checkout_sdk/sessions/optimized_properties.rb +17 -0
  81. data/lib/checkout_sdk/sessions/pre_order_purchase_indicator_type.rb +10 -0
  82. data/lib/checkout_sdk/sessions/recurring.rb +5 -0
  83. data/lib/checkout_sdk/sessions/reorder_items_indicator_type.rb +10 -0
  84. data/lib/checkout_sdk/sessions/session_request.rb +25 -2
  85. data/lib/checkout_sdk/sessions/sessions.rb +9 -0
  86. data/lib/checkout_sdk/sessions/source/card_source.rb +2 -1
  87. data/lib/checkout_sdk/sessions/three_ds_method_completion_request.rb +3 -1
  88. data/lib/checkout_sdk/sessions/three_ds_req_auth_method.rb +16 -0
  89. data/lib/checkout_sdk/sessions/three_ds_requestor_authentication_info.rb +17 -0
  90. data/lib/checkout_sdk/sessions/transaction_type.rb +3 -3
  91. data/lib/checkout_sdk/version.rb +1 -1
  92. metadata +52 -7
  93. data/lib/checkout_sdk/payments/sessions/payment_method_configuration.rb +0 -11
@@ -11,7 +11,8 @@ module CheckoutSdk
11
11
  attr_reader :api_client,
12
12
  :authorization_type,
13
13
  :configuration
14
- protected :api_client, :authorization_type, :configuration
14
+
15
+ protected
15
16
 
16
17
  # @param [CheckoutSdk::ApiClient] api_client
17
18
  # @param [CheckoutConfiguration] configuration
@@ -22,8 +23,6 @@ module CheckoutSdk
22
23
  @configuration = configuration
23
24
  end
24
25
 
25
- protected
26
-
27
26
  # @param [Array] args
28
27
  def build_path(*args)
29
28
  args.join('/')
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CheckoutSdk
4
+ module Common
5
+ class AccountChangeIndicatorType
6
+ THIS_TRANSACTION = 'this_transaction'
7
+ LESS_THAN_THIRTY_DAYS = 'less_than_thirty_days'
8
+ THIRTY_TO_SIXTY_DAYS = 'thirty_to_sixty_days'
9
+ MORE_THAN_SIXTY_DAYS = 'more_than_sixty_days'
10
+ end
11
+ end
12
+ end
@@ -4,7 +4,7 @@ module CheckoutSdk
4
4
  module Common
5
5
  # @!attribute type
6
6
  # @return [String] {AccountHolderType}
7
- # @!attribute title
7
+ # @!attribute full_name
8
8
  # @return [String]
9
9
  # @!attribute first_name
10
10
  # @return [String]
@@ -12,6 +12,10 @@ module CheckoutSdk
12
12
  # @return [String]
13
13
  # @!attribute last_name
14
14
  # @return [String]
15
+ # @!attribute email
16
+ # @return [String]
17
+ # @!attribute gender
18
+ # @return [String]
15
19
  # @!attribute company_name
16
20
  # @return [String]
17
21
  # @!attribute tax_id
@@ -21,23 +25,23 @@ module CheckoutSdk
21
25
  # @!attribute country_of_birth
22
26
  # @return [Country]
23
27
  # @!attribute residential_status
24
- # @return [String]
28
+ # @return [String] {ResidentialStatusType}
25
29
  # @!attribute billing_address
26
30
  # @return [Address]
27
31
  # @!attribute phone
28
32
  # @return [Phone]
29
33
  # @!attribute identification
30
34
  # @return [AccountHolderIdentification]
31
- # @!attribute email
32
- # @return [String]
33
- # @!attribute gender
34
- # @return [String]
35
+ # @!attribute account_name_inquiry
36
+ # @return [Boolean]
35
37
  class AccountHolder
36
38
  attr_accessor :type,
37
- :title,
39
+ :full_name,
38
40
  :first_name,
39
41
  :middle_name,
40
42
  :last_name,
43
+ :email,
44
+ :gender,
41
45
  :company_name,
42
46
  :tax_id,
43
47
  :date_of_birth,
@@ -46,8 +50,7 @@ module CheckoutSdk
46
50
  :billing_address,
47
51
  :phone,
48
52
  :identification,
49
- :email,
50
- :gender
53
+ :account_name_inquiry
51
54
  end
52
55
  end
53
56
  end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CheckoutSdk
4
+ module Common
5
+ class AccountPasswordChangeIndicatorType
6
+ NO_CHANGE = 'no_change'
7
+ THIS_TRANSACTION = 'this_transaction'
8
+ LESS_THAN_THIRTY_DAYS = 'less_than_thirty_days'
9
+ THIRTY_TO_SIXTY_DAYS = 'thirty_to_sixty_days'
10
+ MORE_THAN_SIXTY_DAYS = 'more_than_sixty_days'
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CheckoutSdk
4
+ module Common
5
+ class AccountTypeCardProductType
6
+ CREDIT = 'credit'
7
+ DEBIT = 'debit'
8
+ NOT_APPLICABLE = 'not_applicable'
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CheckoutSdk
4
+ module Common
5
+ class CardholderAccountAgeIndicatorType
6
+ LESS_THAN_THIRTY_DAYS = 'less_than_thirty_days'
7
+ MORE_THAN_SIXTY_DAYS = 'more_than_sixty_days'
8
+ NO_ACCOUNT = 'no_account'
9
+ THIRTY_TO_SIXTY_DAYS = 'thirty_to_sixty_days'
10
+ THIS_TRANSACTION = 'this_transaction'
11
+ end
12
+ end
13
+ end
@@ -23,3 +23,9 @@ require 'checkout_sdk/common/marketplace_data'
23
23
  require 'checkout_sdk/common/shipping_info'
24
24
  require 'checkout_sdk/common/product'
25
25
  require 'checkout_sdk/common/date_range_query_filter'
26
+ require 'checkout_sdk/common/account_change_indicator_type'
27
+ require 'checkout_sdk/common/account_password_change_indicator_type'
28
+ require 'checkout_sdk/common/account_type_card_product_type'
29
+ require 'checkout_sdk/common/cardholder_account_age_indicator_type'
30
+ require 'checkout_sdk/common/customer_retry'
31
+ require 'checkout_sdk/common/destination'
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CheckoutSdk
4
+ module Accounts
5
+ # @!attribute max_attempts
6
+ # @return [Integer]
7
+ class CustomerRetry
8
+ attr_accessor :max_attempts
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,38 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CheckoutSdk
4
+ module Common
5
+ # @!attribute account_type
6
+ # @return [AccountType]
7
+ # @!attribute account_number
8
+ # @return [String]
9
+ # @!attribute bank_code
10
+ # @return [String]
11
+ # @!attribute branch_code
12
+ # @return [String]
13
+ # @!attribute iban
14
+ # @return [String]
15
+ # @!attribute bban
16
+ # @return [String]
17
+ # @!attribute swift_bic
18
+ # @return [String]
19
+ # @!attribute country
20
+ # @return [Country]
21
+ # @!attribute account_holder
22
+ # @return [AccountHolder]
23
+ # @!attribute bank
24
+ # @return [BankDetails]
25
+ class Destination
26
+ attr_accessor :account_type,
27
+ :account_number,
28
+ :bank_code,
29
+ :branch_code,
30
+ :iban,
31
+ :bban,
32
+ :swift_bic,
33
+ :country,
34
+ :account_holder,
35
+ :bank
36
+ end
37
+ end
38
+ end
@@ -52,6 +52,14 @@ module CheckoutSdk
52
52
  TRUSTLY = 'trustly'
53
53
  ILLICADO = 'illicado'
54
54
  SEPA = 'sepa'
55
+ ACH = 'ach'
56
+ BIZUM = 'bizum'
57
+ OCTOPUS = 'octopus'
58
+ PLAID = 'plaid'
59
+ SEQURA = 'sequra'
60
+ TABBY = 'tabby'
61
+ APPLEPAY = 'applepay'
62
+ GOOGLEPAY = 'googlepay'
55
63
  end
56
64
  end
57
65
  end
@@ -8,10 +8,13 @@ module CheckoutSdk
8
8
  # @return [Integer]
9
9
  # @!attribute price
10
10
  # @return [Integer]
11
+ # @!attribute reference
12
+ # @return [String]
11
13
  class Product
12
14
  attr_accessor :name,
13
15
  :quantity,
14
- :price
16
+ :price,
17
+ :reference
15
18
  end
16
19
  end
17
20
  end
@@ -1,30 +1,46 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CheckoutSdk
4
- class CheckoutException < StandardError
5
- end
4
+ class CheckoutException < StandardError; end
6
5
 
7
6
  class CheckoutArgumentException < CheckoutException; end
8
7
 
9
8
  class CheckoutAuthorizationException < CheckoutException
10
9
  def self.invalid_authorization(authorization_type)
11
- CheckoutAuthorizationException.new("Operation requires #{authorization_type} authorization type")
10
+ new("Operation requires #{authorization_type} authorization type.")
12
11
  end
13
12
 
14
13
  def self.invalid_key(key_type)
15
- CheckoutAuthorizationException.new("#{key_type} is required for this operation.")
14
+ new("#{key_type} is required for this operation.")
16
15
  end
17
16
  end
18
17
 
19
18
  class CheckoutApiException < CheckoutException
20
19
  attr_reader :http_metadata, :error_details
21
20
 
22
- def initialize(response)
21
+ def initialize(response, message = nil)
23
22
  @http_metadata = CheckoutUtils.map_to_http_metadata(response)
24
- if !http_metadata.body.nil? && http_metadata.body != ''
25
- @error_details = JSON.parse(http_metadata.body, object_class: OpenStruct)
23
+ @error_details = parse_error_details(http_metadata.body)
24
+ super(message || build_error_message)
25
+ end
26
+
27
+ private
28
+
29
+ def parse_error_details(body)
30
+ return if body.nil? || body.empty?
31
+
32
+ JSON.parse(body, object_class: OpenStruct)
33
+ rescue JSON::ParserError
34
+ nil
35
+ end
36
+
37
+ def build_error_message
38
+ message = "The API response status code (#{http_metadata.status_code}) does not indicate success."
39
+ if @error_details && !@error_details.to_h.empty?
40
+ details = @error_details.to_h.map { |key, value| "#{key}: #{value}" }.join(', ')
41
+ message += " Details: #{details}."
26
42
  end
27
- super("The API response status code (#{http_metadata.status_code}) does not indicate success.")
43
+ message
28
44
  end
29
45
  end
30
46
  end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CheckoutSdk
4
+ module Payments
5
+ # @!attribute account_holder
6
+ # @return [CheckoutSdk::Common::AccountHolder]
7
+ # @!attribute store_payment_details
8
+ # @return [String] {StorePaymentDetailsType}
9
+ class Applepay
10
+ attr_accessor :account_holder,
11
+ :store_payment_details
12
+ end
13
+ end
14
+ end
@@ -2,10 +2,13 @@
2
2
 
3
3
  module CheckoutSdk
4
4
  module Payments
5
+ # @!attribute account_holder
6
+ # @return [CheckoutSdk::Common::AccountHolder]
5
7
  # @!attribute store_payment_details
6
8
  # @return [String] {StorePaymentDetailsType}
7
9
  class Card
8
- attr_accessor :store_payment_details
10
+ attr_accessor :account_holder,
11
+ :store_payment_details
9
12
  end
10
13
  end
11
14
  end
@@ -12,6 +12,8 @@ module CheckoutSdk
12
12
  OUT_OF_SCA_SCOPE = 'out_of_sca_scope'
13
13
  OTHER = 'other'
14
14
  LOW_RISK_PROGRAM = 'low_risk_program'
15
+ DATA_SHARE = 'data_share'
16
+ RECURRING_OPERATION = 'recurring_operation'
15
17
  end
16
18
  end
17
19
  end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CheckoutSdk
4
+ module Payments
5
+ # @!attribute account_holder
6
+ # @return [CheckoutSdk::Common::AccountHolder]
7
+ # @!attribute store_payment_details
8
+ # @return [String] {StorePaymentDetailsType}
9
+ class Googlepay
10
+ attr_accessor :account_holder,
11
+ :store_payment_details
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CheckoutSdk
4
+ module Payments
5
+ # @!attribute purpose
6
+ # @return [String] {PaymentPurposeType}
7
+ class HostedPaymentInstruction
8
+ attr_accessor :purpose
9
+ end
10
+ end
11
+ end
@@ -1,11 +1,21 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'checkout_sdk/payments/payment_type'
4
+
3
5
  module CheckoutSdk
4
6
  module Payments
5
- # @!attribute amount
6
- # @return [Integer]
7
7
  # @!attribute currency
8
8
  # @return [String] {CheckoutSdk::Common::Currency}
9
+ # @!attribute billing
10
+ # @return [BillingInformation]
11
+ # @!attribute success_url
12
+ # @return [String]
13
+ # @!attribute cancel_url
14
+ # @return [String]
15
+ # @!attribute failure_url
16
+ # @return [String]
17
+ # @!attribute amount
18
+ # @return [Integer]
9
19
  # @!attribute payment_type
10
20
  # @return [String] {PaymentType}
11
21
  # @!attribute payment_ip
@@ -16,12 +26,16 @@ module CheckoutSdk
16
26
  # @return [String]
17
27
  # @!attribute description
18
28
  # @return [String]
29
+ # @!attribute display_name
30
+ # @return [String]
31
+ # @!attribute processing_channel_id
32
+ # @return [String]
33
+ # @!attribute amount_allocations
34
+ # @return [Array(CheckoutSdk::Common::AmountAllocations)]
19
35
  # @!attribute customer
20
36
  # @return [CheckoutSdk::Common::CustomerRequest]
21
37
  # @!attribute shipping
22
38
  # @return [ShippingDetails]
23
- # @!attribute billing
24
- # @return [BillingInformation]
25
39
  # @!attribute recipient
26
40
  # @return [PaymentRecipient]
27
41
  # @!attribute processing
@@ -34,53 +48,60 @@ module CheckoutSdk
34
48
  # @return [Array(CheckoutSdk::Common::Product)]
35
49
  # @!attribute risk
36
50
  # @return [RiskRequest]
37
- # @!attribute success_url
38
- # @return [String]
39
- # @!attribute cancel_url
40
- # @return [String]
41
- # @!attribute failure_url
42
- # @return [String]
51
+ # @!attribute customer_retry
52
+ # @return [PaymentRetryRequest]
53
+ # @!attribute sender
54
+ # @return [CheckoutSdk::Payments::Sender]
43
55
  # @!attribute metadata
44
56
  # @return [Hash(String=>Object)]
45
57
  # @!attribute locale
46
- # @return [String]
58
+ # @return [String] {LocaleType}
47
59
  # @!attribute three_ds
48
60
  # @return [ThreeDSRequest]
49
61
  # @!attribute capture
50
62
  # @return [TrueClass, FalseClass]
51
63
  # @!attribute capture_on
52
64
  # @return [Time]
53
- # @!attribute processing_channel_id
54
- # @return [String] - Not available on Previous.
55
- # @!attribute amount_allocations
56
- # @return [Array(CheckoutSdk::Common::AmountAllocations)] - Not available on Previous.
65
+ # @!attribute instruction
66
+ # @return [HostedPaymentInstruction]
67
+ # @!attribute payment_method_configuration
68
+ # @return [PaymentMethodConfiguration]
57
69
  class HostedPaymentsSession
58
- attr_accessor :amount,
59
- :currency,
70
+ attr_accessor :currency,
71
+ :billing,
72
+ :success_url,
73
+ :cancel_url,
74
+ :failure_url,
75
+ :amount,
60
76
  :payment_type,
61
77
  :payment_ip,
62
78
  :billing_descriptor,
63
79
  :reference,
64
80
  :description,
81
+ :display_name,
82
+ :processing_channel_id,
83
+ :amount_allocations,
65
84
  :customer,
66
85
  :shipping,
67
- :billing,
68
86
  :recipient,
69
87
  :processing,
70
88
  :allow_payment_methods,
71
89
  :disabled_payment_methods,
72
90
  :products,
73
91
  :risk,
74
- :success_url,
75
- :cancel_url,
76
- :failure_url,
92
+ :customer_retry,
93
+ :sender,
77
94
  :metadata,
78
95
  :locale,
79
96
  :three_ds,
80
97
  :capture,
81
98
  :capture_on,
82
- :processing_channel_id,
83
- :amount_allocations
99
+ :instruction,
100
+ :payment_method_configuration
101
+
102
+ def initialize(payment_type: CheckoutSdk::Payments::PaymentType::REGULAR)
103
+ @payment_type = payment_type
104
+ end
84
105
  end
85
106
  end
86
107
  end
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CheckoutSdk
4
+ module Payments
5
+ class PaymentPurposeType
6
+ DONATIONS = 'donations'
7
+ EDUCATION = 'education'
8
+ EMERGENCY_NEED = 'emergency_need'
9
+ EXPATRIATION = 'expatriation'
10
+ FAMILY_SUPPORT = 'family_support'
11
+ FINANCIAL_SERVICES = 'financial_services'
12
+ GIFTS = 'gifts'
13
+ INCOME = 'income'
14
+ INSURANCE = 'insurance'
15
+ INVESTMENT = 'investment'
16
+ IT_SERVICES = 'it_services'
17
+ LEISURE = 'leisure'
18
+ LOAN_PAYMENT = 'loan_payment'
19
+ MEDICAL_TREATMENT = 'medical_treatment'
20
+ OTHER = 'other'
21
+ PENSION = 'pension'
22
+ ROYALTIES = 'royalties'
23
+ SAVINGS = 'savings'
24
+ TRAVEL_AND_TOURISM = 'travel_and_tourism'
25
+ end
26
+ end
27
+ end
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'checkout_sdk/payments/payment_type'
4
+
3
5
  module CheckoutSdk
4
6
  module Payments
5
7
  # @!attribute amount
@@ -16,6 +18,8 @@ module CheckoutSdk
16
18
  # @return [String]
17
19
  # @!attribute description
18
20
  # @return [String]
21
+ # @!attribute display_name
22
+ # @return [String]
19
23
  # @!attribute processing_channel_id
20
24
  # @return [String] - Not available on Previous.
21
25
  # @!attribute amount_allocations
@@ -34,6 +38,8 @@ module CheckoutSdk
34
38
  # @return [ProcessingSettings]
35
39
  # @!attribute allow_payment_methods
36
40
  # @return [Array(CheckoutSdk::Common::PaymentSourceType)]
41
+ # @!attribute disabled_payment_methods
42
+ # @return [Array(CheckoutSdk::Common::PaymentSourceType)]
37
43
  # @!attribute products
38
44
  # @return [Array(CheckoutSdk::Common::Product)]
39
45
  # @!attribute metadata
@@ -42,6 +48,10 @@ module CheckoutSdk
42
48
  # @return [ThreeDSRequest]
43
49
  # @!attribute risk
44
50
  # @return [RiskRequest]
51
+ # @!attribute customer_retry
52
+ # @return [CheckoutSdk::Common::CustomerRetry]
53
+ # @!attribute sender
54
+ # @return [CheckoutSdk::Payments::Sender]
45
55
  # @!attribute return_url
46
56
  # @return [String]
47
57
  # @!attribute locale
@@ -58,6 +68,7 @@ module CheckoutSdk
58
68
  :billing_descriptor,
59
69
  :reference,
60
70
  :description,
71
+ :display_name,
61
72
  :processing_channel_id,
62
73
  :amount_allocations,
63
74
  :expires_in,
@@ -67,14 +78,21 @@ module CheckoutSdk
67
78
  :recipient,
68
79
  :processing,
69
80
  :allow_payment_methods,
81
+ :disabled_payment_methods,
70
82
  :products,
71
83
  :metadata,
72
84
  :three_ds,
73
85
  :risk,
86
+ :customer_retry,
87
+ :sender,
74
88
  :return_url,
75
89
  :locale,
76
90
  :capture,
77
91
  :capture_on
92
+
93
+ def initialize(payment_type: CheckoutSdk::Payments::PaymentType::REGULAR)
94
+ @payment_type = payment_type
95
+ end
78
96
  end
79
97
  end
80
98
  end
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CheckoutSdk
4
+ module Payments
5
+ module LocaleType
6
+ AR = 'ar'
7
+ DA_DK = 'da-DK'
8
+ DE_DE = 'de-DE'
9
+ EL = 'el'
10
+ EN_GB = 'en-GB'
11
+ ES_ES = 'es-ES'
12
+ FI_FI = 'fi-FI'
13
+ FIL_PH = 'fil-PH'
14
+ FR_FR = 'fr-FR'
15
+ HI_IN = 'hi-IN'
16
+ ID_ID = 'id-ID'
17
+ IT_IT = 'it-IT'
18
+ JA_JP = 'ja-JP'
19
+ MS_MY = 'ms-MY'
20
+ NB_NO = 'nb-NO'
21
+ NL_NL = 'nl-NL'
22
+ PT_PT = 'pt-PT'
23
+ SV_SE = 'sv-SE'
24
+ TH_TH = 'th-TH'
25
+ VI_VN = 'vi-VN'
26
+ ZH_CN = 'zh-CN'
27
+ ZH_HK = 'zh-HK'
28
+ ZH_TW = 'zh-TW'
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CheckoutSdk
4
+ module Payments
5
+ # @!attribute enabled
6
+ # @return [TrueClass, FalseClass]
7
+ class PartialAuthorization
8
+ attr_accessor :enabled
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CheckoutSdk
4
+ module Payments
5
+ # @!attribute applepay
6
+ # @return [Applepay]
7
+ # @!attribute card
8
+ # @return [Card]
9
+ # @!attribute googlepay
10
+ # @return [Googlepay]
11
+ class PaymentMethodConfiguration
12
+ attr_accessor :applepay,
13
+ :card,
14
+ :googlepay
15
+ end
16
+ end
17
+ end
@@ -18,6 +18,8 @@ module CheckoutSdk
18
18
  # @return [String]
19
19
  # @!attribute description
20
20
  # @return [String]
21
+ # @!attribute partial_authorization
22
+ # @return [PartialAuthorization]
21
23
  # @!attribute authorization_type
22
24
  # @return [String] {AuthorizationType}
23
25
  # @!attribute capture
@@ -74,6 +76,7 @@ module CheckoutSdk
74
76
  :merchant_initiated,
75
77
  :reference,
76
78
  :description,
79
+ :partial_authorization,
77
80
  :authorization_type,
78
81
  :capture,
79
82
  :capture_on,