payjpv2 1.1.0 → 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 (128) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/README.md +13 -2
  4. data/docs/BankAccountStatus.md +15 -0
  5. data/docs/BankInfoResponse.md +2 -2
  6. data/docs/CardBrand.md +15 -0
  7. data/docs/CardFunding.md +15 -0
  8. data/docs/CheckoutSessionCreateRequest.md +3 -1
  9. data/docs/CheckoutSessionDetailsResponse.md +2 -0
  10. data/docs/CheckoutSessionPaymentMethodOptionsCardRequest.md +2 -2
  11. data/docs/CheckoutSessionsApi.md +70 -0
  12. data/docs/DisplayPreferenceRequest.md +1 -1
  13. data/docs/PaymentFlowCancelRequest.md +1 -1
  14. data/docs/PaymentFlowCreateRequest.md +2 -0
  15. data/docs/PaymentFlowPaymentMethodOptionsCardRequest.md +2 -2
  16. data/docs/PaymentFlowResponse.md +2 -0
  17. data/docs/PaymentFlowUpdateRequest.md +2 -0
  18. data/docs/PaymentMethodCardDetailsResponse.md +4 -2
  19. data/docs/PaymentMethodConfigurationDisplayPreference.md +2 -2
  20. data/docs/PaymentMethodConfigurationPreference.md +15 -0
  21. data/docs/PaymentMethodConfigurationValue.md +15 -0
  22. data/docs/PaymentTransactionsApi.md +4 -4
  23. data/docs/ProductCreateRequest.md +1 -1
  24. data/docs/RedirectOptionsRequest.md +18 -0
  25. data/docs/RedirectOptionsResponse.md +18 -0
  26. data/docs/RequestExtendedAuthorization.md +15 -0
  27. data/docs/RequestThreeDSecure.md +15 -0
  28. data/docs/SetupFlowCancelRequest.md +1 -1
  29. data/docs/SetupFlowCreateRequest.md +2 -0
  30. data/docs/SetupFlowPaymentMethodOptionsCardRequest.md +1 -1
  31. data/docs/SetupFlowResponse.md +2 -0
  32. data/docs/SetupFlowUpdateRequest.md +2 -0
  33. data/docs/TaxRateCreateRequest.md +2 -0
  34. data/docs/TaxRateDetailsResponse.md +2 -0
  35. data/docs/TaxRateUpdateRequest.md +2 -0
  36. data/docs/TaxType.md +15 -0
  37. data/lib/payjpv2/api/checkout_sessions_api.rb +60 -0
  38. data/lib/payjpv2/api/payment_transactions_api.rb +2 -2
  39. data/lib/payjpv2/models/balance_state.rb +4 -3
  40. data/lib/payjpv2/models/bank_account_status.rb +42 -0
  41. data/lib/payjpv2/models/bank_info_response.rb +24 -2
  42. data/lib/payjpv2/models/capture_method.rb +4 -3
  43. data/lib/payjpv2/models/card_brand.rb +45 -0
  44. data/lib/payjpv2/models/card_funding.rb +41 -0
  45. data/lib/payjpv2/models/checkout_session_create_request.rb +12 -2
  46. data/lib/payjpv2/models/checkout_session_details_response.rb +23 -1
  47. data/lib/payjpv2/models/checkout_session_mode.rb +4 -3
  48. data/lib/payjpv2/models/checkout_session_payment_method_options_card_request.rb +2 -22
  49. data/lib/payjpv2/models/checkout_session_status.rb +4 -3
  50. data/lib/payjpv2/models/checkout_session_submit_type.rb +4 -3
  51. data/lib/payjpv2/models/checkout_session_ui_mode.rb +4 -3
  52. data/lib/payjpv2/models/country.rb +4 -3
  53. data/lib/payjpv2/models/currency.rb +4 -3
  54. data/lib/payjpv2/models/customer_creation.rb +4 -3
  55. data/lib/payjpv2/models/display_preference_request.rb +6 -6
  56. data/lib/payjpv2/models/line_item_request.rb +14 -0
  57. data/lib/payjpv2/models/locale.rb +4 -3
  58. data/lib/payjpv2/models/payment_dispute_reason.rb +4 -3
  59. data/lib/payjpv2/models/payment_dispute_status.rb +4 -3
  60. data/lib/payjpv2/models/payment_flow_cancel_request.rb +1 -11
  61. data/lib/payjpv2/models/payment_flow_cancellation_reason.rb +4 -3
  62. data/lib/payjpv2/models/payment_flow_create_request.rb +11 -1
  63. data/lib/payjpv2/models/payment_flow_payment_method_options_card_request.rb +2 -22
  64. data/lib/payjpv2/models/payment_flow_response.rb +23 -1
  65. data/lib/payjpv2/models/payment_flow_status.rb +4 -3
  66. data/lib/payjpv2/models/payment_flow_update_request.rb +11 -1
  67. data/lib/payjpv2/models/payment_method_card_details_response.rb +40 -7
  68. data/lib/payjpv2/models/payment_method_configuration_display_preference.rb +2 -22
  69. data/lib/payjpv2/models/payment_method_configuration_preference.rb +42 -0
  70. data/lib/payjpv2/models/payment_method_configuration_value.rb +41 -0
  71. data/lib/payjpv2/models/payment_method_types.rb +4 -3
  72. data/lib/payjpv2/models/payment_refund_reason.rb +4 -3
  73. data/lib/payjpv2/models/payment_refund_status.rb +4 -3
  74. data/lib/payjpv2/models/payment_transaction_type.rb +4 -3
  75. data/lib/payjpv2/models/price_type.rb +4 -3
  76. data/lib/payjpv2/models/product_create_request.rb +15 -1
  77. data/lib/payjpv2/models/redirect_options_request.rb +206 -0
  78. data/lib/payjpv2/models/redirect_options_response.rb +208 -0
  79. data/lib/payjpv2/models/request_extended_authorization.rb +42 -0
  80. data/lib/payjpv2/models/request_three_d_secure.rb +41 -0
  81. data/lib/payjpv2/models/setup_flow_cancel_request.rb +1 -1
  82. data/lib/payjpv2/models/setup_flow_cancellation_reason.rb +6 -4
  83. data/lib/payjpv2/models/setup_flow_create_request.rb +11 -1
  84. data/lib/payjpv2/models/setup_flow_payment_method_options_card_request.rb +1 -11
  85. data/lib/payjpv2/models/setup_flow_response.rb +23 -1
  86. data/lib/payjpv2/models/setup_flow_status.rb +4 -3
  87. data/lib/payjpv2/models/setup_flow_update_request.rb +11 -1
  88. data/lib/payjpv2/models/statement_subject.rb +4 -3
  89. data/lib/payjpv2/models/statement_type.rb +4 -3
  90. data/lib/payjpv2/models/tax_rate_create_request.rb +11 -1
  91. data/lib/payjpv2/models/tax_rate_details_response.rb +13 -1
  92. data/lib/payjpv2/models/tax_rate_update_request.rb +11 -1
  93. data/lib/payjpv2/models/tax_type.rb +40 -0
  94. data/lib/payjpv2/models/usage.rb +4 -3
  95. data/lib/payjpv2/version.rb +1 -1
  96. data/lib/payjpv2.rb +10 -0
  97. data/spec/api/checkout_sessions_api_spec.rb +33 -0
  98. data/spec/api/payment_transactions_api_spec.rb +2 -2
  99. data/spec/integration/anyof_deserialization_spec.rb +8 -1
  100. data/spec/models/bank_account_status_spec.rb +30 -0
  101. data/spec/models/card_brand_spec.rb +30 -0
  102. data/spec/models/card_funding_spec.rb +30 -0
  103. data/spec/models/checkout_session_create_request_spec.rb +6 -0
  104. data/spec/models/checkout_session_details_response_spec.rb +6 -0
  105. data/spec/models/checkout_session_payment_method_options_card_request_spec.rb +0 -8
  106. data/spec/models/display_preference_request_spec.rb +0 -4
  107. data/spec/models/payment_flow_cancel_request_spec.rb +0 -4
  108. data/spec/models/payment_flow_create_request_spec.rb +6 -0
  109. data/spec/models/payment_flow_payment_method_options_card_request_spec.rb +0 -8
  110. data/spec/models/payment_flow_response_spec.rb +6 -0
  111. data/spec/models/payment_flow_update_request_spec.rb +6 -0
  112. data/spec/models/payment_method_card_details_response_spec.rb +6 -0
  113. data/spec/models/payment_method_configuration_display_preference_spec.rb +0 -8
  114. data/spec/models/payment_method_configuration_preference_spec.rb +30 -0
  115. data/spec/models/payment_method_configuration_value_spec.rb +30 -0
  116. data/spec/models/redirect_options_request_spec.rb +36 -0
  117. data/spec/models/redirect_options_response_spec.rb +36 -0
  118. data/spec/models/request_extended_authorization_spec.rb +30 -0
  119. data/spec/models/request_three_d_secure_spec.rb +30 -0
  120. data/spec/models/setup_flow_create_request_spec.rb +6 -0
  121. data/spec/models/setup_flow_payment_method_options_card_request_spec.rb +0 -4
  122. data/spec/models/setup_flow_response_spec.rb +6 -0
  123. data/spec/models/setup_flow_update_request_spec.rb +6 -0
  124. data/spec/models/tax_rate_create_request_spec.rb +6 -0
  125. data/spec/models/tax_rate_details_response_spec.rb +6 -0
  126. data/spec/models/tax_rate_update_request_spec.rb +6 -0
  127. data/spec/models/tax_type_spec.rb +30 -0
  128. metadata +41 -1
@@ -10,6 +10,7 @@
10
10
  | **active** | **Boolean** | この税率が有効であるかどうか。無効にした場合でも、すでに設定されている定期課金などでは使用可能です。 | [optional][default to true] |
11
11
  | **country** | [**Country**](Country.md) | 有効な2文字の <a href=\"https://ja.wikipedia.org/wiki/ISO_3166-1\" target=\"_blank\">ISO 国コード</a> | [optional] |
12
12
  | **description** | **String** | 説明。管理画面内のみで表示され、顧客には表示されません。 | [optional] |
13
+ | **tax_type** | [**TaxType**](TaxType.md) | | [optional] |
13
14
  | **metadata** | [**Hash<String, MetadataValue>**](MetadataValue.md) | キーバリューの任意のデータを格納できます。20件まで登録可能で、空文字列を指定するとそのキーを削除できます。<a href=\"https://docs.pay.jp/v2/guide/developers/metadata\">詳細はメタデータのドキュメントを参照してください。</a> | [optional] |
14
15
 
15
16
  ## Example
@@ -24,6 +25,7 @@ instance = PAYJPv2::TaxRateCreateRequest.new(
24
25
  active: null,
25
26
  country: null,
26
27
  description: null,
28
+ tax_type: null,
27
29
  metadata: null
28
30
  )
29
31
  ```
@@ -13,6 +13,7 @@
13
13
  | **active** | **Boolean** | この税率が有効であるかどうか | |
14
14
  | **country** | [**Country**](Country.md) | | |
15
15
  | **description** | **String** | | |
16
+ | **tax_type** | [**TaxType**](TaxType.md) | | |
16
17
  | **created_at** | **Time** | 作成日時 (UTC, ISO 8601 形式) | |
17
18
  | **updated_at** | **Time** | 更新日時 (UTC, ISO 8601 形式) | |
18
19
  | **metadata** | [**Hash<String, MetadataValue>**](MetadataValue.md) | メタデータ | |
@@ -32,6 +33,7 @@ instance = PAYJPv2::TaxRateDetailsResponse.new(
32
33
  active: null,
33
34
  country: null,
34
35
  description: null,
36
+ tax_type: null,
35
37
  created_at: null,
36
38
  updated_at: null,
37
39
  metadata: null
@@ -8,6 +8,7 @@
8
8
  | **country** | [**Country**](Country.md) | 有効な2文字の <a href=\"https://ja.wikipedia.org/wiki/ISO_3166-1\" target=\"_blank\">ISO 国コード</a> | [optional] |
9
9
  | **description** | **String** | 説明。管理画面内のみで表示され、顧客には表示されません。 | [optional] |
10
10
  | **display_name** | **String** | 表示名。顧客に表示されます。 | [optional] |
11
+ | **tax_type** | [**TaxType**](TaxType.md) | | [optional] |
11
12
  | **metadata** | [**Hash<String, MetadataValue>**](MetadataValue.md) | キーバリューの任意のデータを格納できます。20件まで登録可能で、空文字列を指定するとそのキーを削除できます。<a href=\"https://docs.pay.jp/v2/guide/developers/metadata\">詳細はメタデータのドキュメントを参照してください。</a> | [optional] |
12
13
 
13
14
  ## Example
@@ -20,6 +21,7 @@ instance = PAYJPv2::TaxRateUpdateRequest.new(
20
21
  country: null,
21
22
  description: null,
22
23
  display_name: null,
24
+ tax_type: null,
23
25
  metadata: null
24
26
  )
25
27
  ```
data/docs/TaxType.md ADDED
@@ -0,0 +1,15 @@
1
+ # PAYJPv2::TaxType
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+
8
+ ## Example
9
+
10
+ ```ruby
11
+ require 'payjpv2'
12
+
13
+ instance = PAYJPv2::TaxType.new()
14
+ ```
15
+
@@ -84,6 +84,66 @@ module PAYJPv2
84
84
  end
85
85
  end
86
86
 
87
+ # Expire Checkout Session
88
+ # @param checkout_session_id [String]
89
+ # @param [Hash] opts the optional parameters
90
+ # @option opts [String] :idempotency_key Idempotency key for the request
91
+ # @option opts [Boolean] :include_http_info If true, returns [data, status_code, headers] instead of just data
92
+ # @return [CheckoutSessionDetailsResponse, Array] Returns data or [data, status_code, headers] if include_http_info is true
93
+ def expire_checkout_session(checkout_session_id, opts = {})
94
+ if @api_client.config.debugging
95
+ @api_client.config.logger.debug 'Calling API: CheckoutSessionsApi.expire_checkout_session ...'
96
+ end
97
+ # verify the required parameter 'checkout_session_id' is set
98
+ if @api_client.config.client_side_validation && checkout_session_id.nil?
99
+ raise ArgumentError, "Missing the required parameter 'checkout_session_id' when calling CheckoutSessionsApi.expire_checkout_session"
100
+ end
101
+ # resource path
102
+ local_var_path = '/v2/checkout/sessions/{checkout_session_id}/expire'.sub('{' + 'checkout_session_id' + '}', CGI.escape(checkout_session_id.to_s))
103
+
104
+ # query parameters
105
+ query_params = opts[:query_params] || {}
106
+
107
+ # header parameters
108
+ header_params = opts[:header_params] || {}
109
+ header_params['Idempotency-Key'] = opts[:idempotency_key] if opts[:idempotency_key]
110
+ # HTTP header 'Accept' (if needed)
111
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json']) unless header_params['Accept']
112
+
113
+ # form parameters
114
+ form_params = opts[:form_params] || {}
115
+
116
+ # http body (model)
117
+ post_body = opts[:debug_body]
118
+
119
+ # return_type
120
+ return_type = opts[:debug_return_type] || 'CheckoutSessionDetailsResponse'
121
+
122
+ # auth_names
123
+ auth_names = opts[:debug_auth_names] || ['HTTPBasic', 'HTTPBearer']
124
+
125
+ new_options = opts.merge(
126
+ :operation => :"CheckoutSessionsApi.expire_checkout_session",
127
+ :header_params => header_params,
128
+ :query_params => query_params,
129
+ :form_params => form_params,
130
+ :body => post_body,
131
+ :auth_names => auth_names,
132
+ :return_type => return_type
133
+ )
134
+
135
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
136
+ if @api_client.config.debugging
137
+ @api_client.config.logger.debug "API called: CheckoutSessionsApi#expire_checkout_session\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
138
+ end
139
+
140
+ if opts[:include_http_info]
141
+ [data, status_code, headers]
142
+ else
143
+ data
144
+ end
145
+ end
146
+
87
147
  # Get All Checkout Session Line Items
88
148
  # @param checkout_session_id [String]
89
149
  # @param [Hash] opts the optional parameters
@@ -25,8 +25,8 @@ module PAYJPv2
25
25
  # @option opts [String] :starting_after このIDより後のデータを取得
26
26
  # @option opts [String] :ending_before このIDより前のデータを取得
27
27
  # @option opts [String] :term_id 集計区間 ID
28
- # @option opts [String] :type 取引タイプ
29
- # @option opts [String] :payment_method_type 支払い方法タイプ
28
+ # @option opts [PaymentTransactionType] :type 取引タイプ
29
+ # @option opts [PaymentMethodTypes] :payment_method_type 支払い方法タイプ
30
30
  # @option opts [String] :idempotency_key Idempotency key for the request
31
31
  # @option opts [Boolean] :include_http_info If true, returns [data, status_code, headers] instead of just data
32
32
  # @return [PaymentTransactionListResponse, Array] Returns data or [data, status_code, headers] if include_http_info is true
@@ -27,15 +27,16 @@ module PAYJPv2
27
27
  # @param [String] The enum value in the form of the string
28
28
  # @return [String] The enum value
29
29
  def self.build_from_hash(value)
30
- new.build_from_hash(value)
30
+ # Return unknown values as-is so that enum values added on the API side do not break older clients
31
+ value
31
32
  end
32
33
 
33
34
  # Builds the enum from string
34
35
  # @param [String] The enum value in the form of the string
35
36
  # @return [String] The enum value
36
37
  def build_from_hash(value)
37
- return value if BalanceState.all_vars.include?(value)
38
- raise "Invalid ENUM value #{value} for class #BalanceState"
38
+ # Return unknown values as-is so that enum values added on the API side do not break older clients
39
+ value
39
40
  end
40
41
  end
41
42
  end
@@ -0,0 +1,42 @@
1
+ =begin
2
+ #PAY.JP API v2
3
+
4
+ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
+
6
+ The version of the OpenAPI document: 2.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.14.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module PAYJPv2
17
+ class BankAccountStatus
18
+ SUCCESS = "success".freeze
19
+ FAILED = "failed".freeze
20
+ PENDING = "pending".freeze
21
+
22
+ def self.all_vars
23
+ @all_vars ||= [SUCCESS, FAILED, PENDING].freeze
24
+ end
25
+
26
+ # Builds the enum from string
27
+ # @param [String] The enum value in the form of the string
28
+ # @return [String] The enum value
29
+ def self.build_from_hash(value)
30
+ # Return unknown values as-is so that enum values added on the API side do not break older clients
31
+ value
32
+ end
33
+
34
+ # Builds the enum from string
35
+ # @param [String] The enum value in the form of the string
36
+ # @return [String] The enum value
37
+ def build_from_hash(value)
38
+ # Return unknown values as-is so that enum values added on the API side do not break older clients
39
+ value
40
+ end
41
+ end
42
+ end
@@ -21,7 +21,7 @@ module PAYJPv2
21
21
  # 支店番号
22
22
  attr_accessor :bank_branch_code
23
23
 
24
- # 口座種別
24
+ # 口座種別。`普通` または `当座`
25
25
  attr_accessor :bank_account_type
26
26
 
27
27
  # 口座番号
@@ -33,6 +33,28 @@ module PAYJPv2
33
33
  # 最新振込結果 | 値 | |:---| | **success**: 成功 | | **failed**: 失敗 | | **pending**: 初回振込み前 |
34
34
  attr_accessor :bank_account_status
35
35
 
36
+ class EnumAttributeValidator
37
+ attr_reader :datatype
38
+ attr_reader :allowable_values
39
+
40
+ def initialize(datatype, allowable_values)
41
+ @allowable_values = allowable_values.map do |value|
42
+ case datatype.to_s
43
+ when /Integer/i
44
+ value.to_i
45
+ when /Float/i
46
+ value.to_f
47
+ else
48
+ value
49
+ end
50
+ end
51
+ end
52
+
53
+ def valid?(value)
54
+ !value || allowable_values.include?(value)
55
+ end
56
+ end
57
+
36
58
  # Attribute mapping from ruby-style variable name to JSON key.
37
59
  def self.attribute_map
38
60
  {
@@ -63,7 +85,7 @@ module PAYJPv2
63
85
  :bank_account_type => :'String',
64
86
  :bank_account_number => :'String',
65
87
  :bank_account_holder_name => :'String',
66
- :bank_account_status => :'String'
88
+ :bank_account_status => :'BankAccountStatus'
67
89
  }
68
90
  end
69
91
 
@@ -26,15 +26,16 @@ module PAYJPv2
26
26
  # @param [String] The enum value in the form of the string
27
27
  # @return [String] The enum value
28
28
  def self.build_from_hash(value)
29
- new.build_from_hash(value)
29
+ # Return unknown values as-is so that enum values added on the API side do not break older clients
30
+ value
30
31
  end
31
32
 
32
33
  # Builds the enum from string
33
34
  # @param [String] The enum value in the form of the string
34
35
  # @return [String] The enum value
35
36
  def build_from_hash(value)
36
- return value if CaptureMethod.all_vars.include?(value)
37
- raise "Invalid ENUM value #{value} for class #CaptureMethod"
37
+ # Return unknown values as-is so that enum values added on the API side do not break older clients
38
+ value
38
39
  end
39
40
  end
40
41
  end
@@ -0,0 +1,45 @@
1
+ =begin
2
+ #PAY.JP API v2
3
+
4
+ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
+
6
+ The version of the OpenAPI document: 2.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.14.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module PAYJPv2
17
+ class CardBrand
18
+ VISA = "Visa".freeze
19
+ MASTER_CARD = "MasterCard".freeze
20
+ JCB = "JCB".freeze
21
+ AMERICAN_EXPRESS = "American Express".freeze
22
+ DINERS_CLUB = "Diners Club".freeze
23
+ DISCOVER = "Discover".freeze
24
+
25
+ def self.all_vars
26
+ @all_vars ||= [VISA, MASTER_CARD, JCB, AMERICAN_EXPRESS, DINERS_CLUB, DISCOVER].freeze
27
+ end
28
+
29
+ # Builds the enum from string
30
+ # @param [String] The enum value in the form of the string
31
+ # @return [String] The enum value
32
+ def self.build_from_hash(value)
33
+ # Return unknown values as-is so that enum values added on the API side do not break older clients
34
+ value
35
+ end
36
+
37
+ # Builds the enum from string
38
+ # @param [String] The enum value in the form of the string
39
+ # @return [String] The enum value
40
+ def build_from_hash(value)
41
+ # Return unknown values as-is so that enum values added on the API side do not break older clients
42
+ value
43
+ end
44
+ end
45
+ end
@@ -0,0 +1,41 @@
1
+ =begin
2
+ #PAY.JP API v2
3
+
4
+ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
+
6
+ The version of the OpenAPI document: 2.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.14.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module PAYJPv2
17
+ class CardFunding
18
+ DEBIT = "debit".freeze
19
+ PREPAID = "prepaid".freeze
20
+
21
+ def self.all_vars
22
+ @all_vars ||= [DEBIT, PREPAID].freeze
23
+ end
24
+
25
+ # Builds the enum from string
26
+ # @param [String] The enum value in the form of the string
27
+ # @return [String] The enum value
28
+ def self.build_from_hash(value)
29
+ # Return unknown values as-is so that enum values added on the API side do not break older clients
30
+ value
31
+ end
32
+
33
+ # Builds the enum from string
34
+ # @param [String] The enum value in the form of the string
35
+ # @return [String] The enum value
36
+ def build_from_hash(value)
37
+ # Return unknown values as-is so that enum values added on the API side do not break older clients
38
+ value
39
+ end
40
+ end
41
+ end
@@ -42,10 +42,13 @@ module PAYJPv2
42
42
  # キャンセル時のリダイレクト URL
43
43
  attr_accessor :cancel_url
44
44
 
45
+ # Checkout から success_url へリダイレクトする際のオプション。Checkout が作成する PaymentFlow / SetupFlow に引き継がれます。
46
+ attr_accessor :redirect_options
47
+
45
48
  # 価格の通貨。現在は `jpy` のみサポートしています。
46
49
  attr_accessor :currency
47
50
 
48
- # Checkout Session の有効期限が失効する日時
51
+ # Checkout Session の有効期限が失効する日時<br> 24時間以内の日時を指定できます。未指定の場合は作成時点から24時間後になります。
49
52
  attr_accessor :expires_at
50
53
 
51
54
  # Checkout 画面の表示言語を指定します。 | 指定できる値 | |:---| | **ja**: 日本語で表示します。 |
@@ -103,6 +106,7 @@ module PAYJPv2
103
106
  :metadata => :metadata,
104
107
  :success_url => :success_url,
105
108
  :cancel_url => :cancel_url,
109
+ :redirect_options => :redirect_options,
106
110
  :currency => :currency,
107
111
  :expires_at => :expires_at,
108
112
  :locale => :locale,
@@ -137,6 +141,7 @@ module PAYJPv2
137
141
  :metadata => :'Hash<String, MetadataValue>',
138
142
  :success_url => :'String',
139
143
  :cancel_url => :'String',
144
+ :redirect_options => :'RedirectOptionsRequest',
140
145
  :currency => :'Currency',
141
146
  :expires_at => :'Time',
142
147
  :locale => :'Locale',
@@ -213,6 +218,10 @@ module PAYJPv2
213
218
  self.cancel_url = attributes[:cancel_url]
214
219
  end
215
220
 
221
+ if attributes.key?(:redirect_options)
222
+ self.redirect_options = attributes[:redirect_options]
223
+ end
224
+
216
225
  if attributes.key?(:currency)
217
226
  self.currency = attributes[:currency]
218
227
  end
@@ -290,6 +299,7 @@ module PAYJPv2
290
299
  metadata == o.metadata &&
291
300
  success_url == o.success_url &&
292
301
  cancel_url == o.cancel_url &&
302
+ redirect_options == o.redirect_options &&
293
303
  currency == o.currency &&
294
304
  expires_at == o.expires_at &&
295
305
  locale == o.locale &&
@@ -310,7 +320,7 @@ module PAYJPv2
310
320
  # Calculates hash code according to all attributes.
311
321
  # @return [Integer] Hash code
312
322
  def hash
313
- [mode, client_reference_id, customer_id, customer_email, customer_creation, line_items, metadata, success_url, cancel_url, currency, expires_at, locale, payment_method_types, payment_method_options, payment_flow_data, submit_type, setup_flow_data, ui_mode].hash
323
+ [mode, client_reference_id, customer_id, customer_email, customer_creation, line_items, metadata, success_url, cancel_url, redirect_options, currency, expires_at, locale, payment_method_types, payment_method_options, payment_flow_data, submit_type, setup_flow_data, ui_mode].hash
314
324
  end
315
325
 
316
326
  # Builds the object from hash
@@ -63,6 +63,9 @@ module PAYJPv2
63
63
 
64
64
  attr_accessor :cancel_url
65
65
 
66
+ # success_url へリダイレクトする際のオプション
67
+ attr_accessor :redirect_options
68
+
66
69
  # URL
67
70
  attr_accessor :url
68
71
 
@@ -121,6 +124,7 @@ module PAYJPv2
121
124
  :status => :status,
122
125
  :success_url => :success_url,
123
126
  :cancel_url => :cancel_url,
127
+ :redirect_options => :redirect_options,
124
128
  :url => :url,
125
129
  :metadata => :metadata,
126
130
  :created_at => :created_at,
@@ -162,6 +166,7 @@ module PAYJPv2
162
166
  :status => :'CheckoutSessionStatus',
163
167
  :success_url => :'String',
164
168
  :cancel_url => :'String',
169
+ :redirect_options => :'RedirectOptionsResponse',
165
170
  :url => :'String',
166
171
  :metadata => :'Hash<String, MetadataValue>',
167
172
  :created_at => :'Time',
@@ -329,6 +334,12 @@ module PAYJPv2
329
334
  self.cancel_url = nil
330
335
  end
331
336
 
337
+ if attributes.key?(:redirect_options)
338
+ self.redirect_options = attributes[:redirect_options]
339
+ else
340
+ self.redirect_options = nil
341
+ end
342
+
332
343
  if attributes.key?(:url)
333
344
  self.url = attributes[:url]
334
345
  else
@@ -426,6 +437,16 @@ module PAYJPv2
426
437
  @status = status
427
438
  end
428
439
 
440
+ # Custom attribute writer method with validation
441
+ # @param [Object] redirect_options Value to be assigned
442
+ def redirect_options=(redirect_options)
443
+ if redirect_options.nil?
444
+ raise ArgumentError, 'redirect_options cannot be nil'
445
+ end
446
+
447
+ @redirect_options = redirect_options
448
+ end
449
+
429
450
  # Custom attribute writer method with validation
430
451
  # @param [Object] url Value to be assigned
431
452
  def url=(url)
@@ -492,6 +513,7 @@ module PAYJPv2
492
513
  status == o.status &&
493
514
  success_url == o.success_url &&
494
515
  cancel_url == o.cancel_url &&
516
+ redirect_options == o.redirect_options &&
495
517
  url == o.url &&
496
518
  metadata == o.metadata &&
497
519
  created_at == o.created_at &&
@@ -507,7 +529,7 @@ module PAYJPv2
507
529
  # Calculates hash code according to all attributes.
508
530
  # @return [Integer] Hash code
509
531
  def hash
510
- [object, id, livemode, amount_subtotal, amount_total, customer_id, customer_email, customer_details, expires_at, currency, locale, payment_flow_id, payment_method_types, payment_method_options, setup_flow_id, submit_type, mode, ui_mode, status, success_url, cancel_url, url, metadata, created_at, updated_at].hash
532
+ [object, id, livemode, amount_subtotal, amount_total, customer_id, customer_email, customer_details, expires_at, currency, locale, payment_flow_id, payment_method_types, payment_method_options, setup_flow_id, submit_type, mode, ui_mode, status, success_url, cancel_url, redirect_options, url, metadata, created_at, updated_at].hash
511
533
  end
512
534
 
513
535
  # Builds the object from hash
@@ -26,15 +26,16 @@ module PAYJPv2
26
26
  # @param [String] The enum value in the form of the string
27
27
  # @return [String] The enum value
28
28
  def self.build_from_hash(value)
29
- new.build_from_hash(value)
29
+ # Return unknown values as-is so that enum values added on the API side do not break older clients
30
+ value
30
31
  end
31
32
 
32
33
  # Builds the enum from string
33
34
  # @param [String] The enum value in the form of the string
34
35
  # @return [String] The enum value
35
36
  def build_from_hash(value)
36
- return value if CheckoutSessionMode.all_vars.include?(value)
37
- raise "Invalid ENUM value #{value} for class #CheckoutSessionMode"
37
+ # Return unknown values as-is so that enum values added on the API side do not break older clients
38
+ value
38
39
  end
39
40
  end
40
41
  end
@@ -64,8 +64,8 @@ module PAYJPv2
64
64
  # Attribute type mapping.
65
65
  def self.openapi_types
66
66
  {
67
- :request_extended_authorization => :'String',
68
- :request_three_d_secure => :'String'
67
+ :request_extended_authorization => :'RequestExtendedAuthorization',
68
+ :request_three_d_secure => :'RequestThreeDSecure'
69
69
  }
70
70
  end
71
71
 
@@ -100,26 +100,6 @@ module PAYJPv2
100
100
  end
101
101
  end
102
102
 
103
- # Custom attribute writer method checking allowed values (enum).
104
- # @param [Object] request_extended_authorization Object to be assigned
105
- def request_extended_authorization=(request_extended_authorization)
106
- validator = EnumAttributeValidator.new('String', ["if_available", "must_extend", "never"])
107
- unless validator.valid?(request_extended_authorization)
108
- raise ArgumentError, "invalid value for \"request_extended_authorization\", must be one of #{validator.allowable_values}."
109
- end
110
- @request_extended_authorization = request_extended_authorization
111
- end
112
-
113
- # Custom attribute writer method checking allowed values (enum).
114
- # @param [Object] request_three_d_secure Object to be assigned
115
- def request_three_d_secure=(request_three_d_secure)
116
- validator = EnumAttributeValidator.new('String', ["any", "automatic"])
117
- unless validator.valid?(request_three_d_secure)
118
- raise ArgumentError, "invalid value for \"request_three_d_secure\", must be one of #{validator.allowable_values}."
119
- end
120
- @request_three_d_secure = request_three_d_secure
121
- end
122
-
123
103
  # Checks equality by comparing each attribute.
124
104
  # @param [Object] Object to be compared
125
105
  def ==(o)
@@ -27,15 +27,16 @@ module PAYJPv2
27
27
  # @param [String] The enum value in the form of the string
28
28
  # @return [String] The enum value
29
29
  def self.build_from_hash(value)
30
- new.build_from_hash(value)
30
+ # Return unknown values as-is so that enum values added on the API side do not break older clients
31
+ value
31
32
  end
32
33
 
33
34
  # Builds the enum from string
34
35
  # @param [String] The enum value in the form of the string
35
36
  # @return [String] The enum value
36
37
  def build_from_hash(value)
37
- return value if CheckoutSessionStatus.all_vars.include?(value)
38
- raise "Invalid ENUM value #{value} for class #CheckoutSessionStatus"
38
+ # Return unknown values as-is so that enum values added on the API side do not break older clients
39
+ value
39
40
  end
40
41
  end
41
42
  end
@@ -28,15 +28,16 @@ module PAYJPv2
28
28
  # @param [String] The enum value in the form of the string
29
29
  # @return [String] The enum value
30
30
  def self.build_from_hash(value)
31
- new.build_from_hash(value)
31
+ # Return unknown values as-is so that enum values added on the API side do not break older clients
32
+ value
32
33
  end
33
34
 
34
35
  # Builds the enum from string
35
36
  # @param [String] The enum value in the form of the string
36
37
  # @return [String] The enum value
37
38
  def build_from_hash(value)
38
- return value if CheckoutSessionSubmitType.all_vars.include?(value)
39
- raise "Invalid ENUM value #{value} for class #CheckoutSessionSubmitType"
39
+ # Return unknown values as-is so that enum values added on the API side do not break older clients
40
+ value
40
41
  end
41
42
  end
42
43
  end
@@ -25,15 +25,16 @@ module PAYJPv2
25
25
  # @param [String] The enum value in the form of the string
26
26
  # @return [String] The enum value
27
27
  def self.build_from_hash(value)
28
- new.build_from_hash(value)
28
+ # Return unknown values as-is so that enum values added on the API side do not break older clients
29
+ value
29
30
  end
30
31
 
31
32
  # Builds the enum from string
32
33
  # @param [String] The enum value in the form of the string
33
34
  # @return [String] The enum value
34
35
  def build_from_hash(value)
35
- return value if CheckoutSessionUIMode.all_vars.include?(value)
36
- raise "Invalid ENUM value #{value} for class #CheckoutSessionUIMode"
36
+ # Return unknown values as-is so that enum values added on the API side do not break older clients
37
+ value
37
38
  end
38
39
  end
39
40
  end
@@ -25,15 +25,16 @@ module PAYJPv2
25
25
  # @param [String] The enum value in the form of the string
26
26
  # @return [String] The enum value
27
27
  def self.build_from_hash(value)
28
- new.build_from_hash(value)
28
+ # Return unknown values as-is so that enum values added on the API side do not break older clients
29
+ value
29
30
  end
30
31
 
31
32
  # Builds the enum from string
32
33
  # @param [String] The enum value in the form of the string
33
34
  # @return [String] The enum value
34
35
  def build_from_hash(value)
35
- return value if Country.all_vars.include?(value)
36
- raise "Invalid ENUM value #{value} for class #Country"
36
+ # Return unknown values as-is so that enum values added on the API side do not break older clients
37
+ value
37
38
  end
38
39
  end
39
40
  end
@@ -25,15 +25,16 @@ module PAYJPv2
25
25
  # @param [String] The enum value in the form of the string
26
26
  # @return [String] The enum value
27
27
  def self.build_from_hash(value)
28
- new.build_from_hash(value)
28
+ # Return unknown values as-is so that enum values added on the API side do not break older clients
29
+ value
29
30
  end
30
31
 
31
32
  # Builds the enum from string
32
33
  # @param [String] The enum value in the form of the string
33
34
  # @return [String] The enum value
34
35
  def build_from_hash(value)
35
- return value if Currency.all_vars.include?(value)
36
- raise "Invalid ENUM value #{value} for class #Currency"
36
+ # Return unknown values as-is so that enum values added on the API side do not break older clients
37
+ value
37
38
  end
38
39
  end
39
40
  end