From 0de4aa4fc7cbf1a6044198219e50914f76a9793c Mon Sep 17 00:00:00 2001 From: SDK Distribution Bot Date: Thu, 26 Feb 2026 08:17:56 +0000 Subject: [PATCH] feat: Update SDK from generator (2026-02-26) --- Gemfile.lock | 2 +- README.md | 5 +- docs/ApplePayConfigRequest.md | 18 ++ docs/PaymentFlowCancelRequest.md | 2 +- docs/PaymentFlowConfirmRequest.md | 4 +- docs/PaymentFlowCreateRequest.md | 2 +- docs/PaymentFlowDataRequest.md | 2 + docs/PaymentFlowUpdateRequest.md | 2 +- ...ymentMethodConfigurationDetailsResponse.md | 4 +- ...PaymentMethodConfigurationUpdateRequest.md | 4 +- docs/SetupFlowCreateRequest.md | 2 +- docs/SetupFlowDataRequest.md | 2 + docs/SetupFlowUpdateRequest.md | 2 +- lib/payjpv2.rb | 1 + .../models/apple_pay_config_request.rb | 206 ++++++++++++++++++ .../models/payment_flow_cancel_request.rb | 2 +- .../models/payment_flow_confirm_request.rb | 4 +- .../models/payment_flow_create_request.rb | 2 +- .../models/payment_flow_data_request.rb | 12 +- .../models/payment_flow_update_request.rb | 2 +- ...t_method_configuration_details_response.rb | 30 ++- ...ent_method_configuration_update_request.rb | 20 +- .../models/payment_refund_create_request.rb | 4 +- .../models/setup_flow_create_request.rb | 2 +- lib/payjpv2/models/setup_flow_data_request.rb | 12 +- .../models/setup_flow_update_request.rb | 2 +- lib/payjpv2/version.rb | 2 +- spec/models/apple_pay_config_request_spec.rb | 36 +++ spec/models/payment_flow_data_request_spec.rb | 6 + ...hod_configuration_details_response_spec.rb | 6 + ...ethod_configuration_update_request_spec.rb | 6 + spec/models/setup_flow_data_request_spec.rb | 6 + 32 files changed, 379 insertions(+), 33 deletions(-) create mode 100644 docs/ApplePayConfigRequest.md create mode 100644 lib/payjpv2/models/apple_pay_config_request.rb create mode 100644 spec/models/apple_pay_config_request_spec.rb diff --git a/Gemfile.lock b/Gemfile.lock index e37c04a..4aef224 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - payjpv2 (1.0.1) + payjpv2 (1.0.2) typhoeus (~> 1.0, >= 1.0.1) GEM diff --git a/README.md b/README.md index 56c9696..d3f775e 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ A Ruby client library for the PAY.JP v2 API. This SDK provides a convenient way This Ruby gem is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - API version: 2.0.0 -- Package version: 1.0.1 +- Package version: 1.0.2 - Generator version: 7.14.0 - Build package: org.openapitools.codegen.languages.RubyClientCodegen @@ -26,7 +26,7 @@ gem install payjpv2 Add this line to your application's Gemfile: ```ruby -gem 'payjpv2', '~> 1.0.1' +gem 'payjpv2', '~> 1.0.2' ``` Then execute: @@ -261,6 +261,7 @@ Class | Method | HTTP request | Description ## Documentation for Models + - [PAYJPv2::ApplePayConfigRequest](docs/ApplePayConfigRequest.md) - [PAYJPv2::BalanceListResponse](docs/BalanceListResponse.md) - [PAYJPv2::BalanceResponse](docs/BalanceResponse.md) - [PAYJPv2::BalanceState](docs/BalanceState.md) diff --git a/docs/ApplePayConfigRequest.md b/docs/ApplePayConfigRequest.md new file mode 100644 index 0000000..3980391 --- /dev/null +++ b/docs/ApplePayConfigRequest.md @@ -0,0 +1,18 @@ +# PAYJPv2::ApplePayConfigRequest + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **display_preference** | [**DisplayPreferenceRequest**](DisplayPreferenceRequest.md) | | [optional] | + +## Example + +```ruby +require 'payjpv2' + +instance = PAYJPv2::ApplePayConfigRequest.new( + display_preference: null +) +``` + diff --git a/docs/PaymentFlowCancelRequest.md b/docs/PaymentFlowCancelRequest.md index 849a6a6..8de5dde 100644 --- a/docs/PaymentFlowCancelRequest.md +++ b/docs/PaymentFlowCancelRequest.md @@ -4,7 +4,7 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **cancellation_reason** | **String** | この PaymentFlow のキャンセル理由 | 値 | |:---| | **duplicate**: 重複した支払いである場合。 | | **fraudulent**: 不正な利用だと考えられる場合。 | | **requested_by_customer**: 顧客がキャンセルを要求した場合。 | | **abondoned**: 顧客が支払いを完了しなかった場合。 | | [optional] | +| **cancellation_reason** | **String** | この PaymentFlow のキャンセル理由 | 値 | |:---| | **duplicate**: 重複した支払いである場合。 | | **fraudulent**: 不正な利用だと考えられる場合。 | | **requested_by_customer**: 顧客がキャンセルを要求した場合。 | | **abandoned**: 顧客が支払いを完了しなかった場合。 | | [optional] | ## Example diff --git a/docs/PaymentFlowConfirmRequest.md b/docs/PaymentFlowConfirmRequest.md index 77f162c..22731d2 100644 --- a/docs/PaymentFlowConfirmRequest.md +++ b/docs/PaymentFlowConfirmRequest.md @@ -7,9 +7,9 @@ | **payment_method_id** | **String** | 支払い方法 ID。customer_id の指定が必須です。Customer が所持する PaymentMethod のみ指定できます。payment_method_id を指定せず、Customer に default_payment_method_id が設定されている場合はそちらが自動でセットされます。 | [optional] | | **payment_method_options** | [**PaymentFlowPaymentMethodOptionsRequest**](PaymentFlowPaymentMethodOptionsRequest.md) | この PaymentFlow 固有の支払い方法の設定 | [optional] | | **payment_method_types** | [**Array<PaymentMethodTypes>**](PaymentMethodTypes.md) | この PaymentFlow で使用できる支払い方法の種類のリスト。指定しない場合は、PAY.JP は支払い方法の設定から利用可能な支払い方法を動的に表示します。 | [optional] | -| **capture_method** | [**CaptureMethod**](CaptureMethod.md) | 支払いの確定方法を指定します。 | 値 | |:---| | **automatic**: (デフォルト) 顧客が支払いを承認すると、自動的に確定させます。 | | **manual**: 顧客が支払いを承認すると一旦確定を保留し、後で Payment Flow の Capture API を使用して確定します。(すべての支払い方法がこれをサポートしているわけではありません)。 | | [optional] | +| **capture_method** | [**CaptureMethod**](CaptureMethod.md) | | [optional] | | **return_url** | **String** | 顧客が支払いを完了後かキャンセルした後にリダイレクトされる URL。アプリにリダイレクトしたい場合は URI Scheme を指定できます。 | [optional] | -| **description** | **String** | オブジェクトにセットする任意の文字列。ユーザーには表示されません。 | [optional] | +| **description** | **String** | オブジェクトにセットする任意の文字列。 | [optional] | ## Example diff --git a/docs/PaymentFlowCreateRequest.md b/docs/PaymentFlowCreateRequest.md index 7540f1e..05589a2 100644 --- a/docs/PaymentFlowCreateRequest.md +++ b/docs/PaymentFlowCreateRequest.md @@ -13,7 +13,7 @@ | **capture_method** | [**CaptureMethod**](CaptureMethod.md) | 支払いの確定方法を指定します。 | 値 | |:---| | **automatic**: (デフォルト) 顧客が支払いを承認すると、自動的に確定させます。 | | **manual**: 顧客が支払いを承認すると一旦確定を保留し、後で Payment Flow の Capture API を使用して確定します。(すべての支払い方法がこれをサポートしているわけではありません)。 | | [optional] | | **confirm** | **Boolean** | 「true」に設定すると、この PaymentFlow を直ちに確定しようと試みます。 | [optional][default to false] | | **return_url** | **String** | 顧客が支払いを完了後かキャンセルした後にリダイレクトされる URL。アプリにリダイレクトしたい場合は URI Scheme を指定できます。confirm=true の場合のみ指定できます。 | [optional] | -| **description** | **String** | オブジェクトにセットする任意の文字列。ユーザーには表示されません。 | [optional] | +| **description** | **String** | オブジェクトにセットする任意の文字列。 | [optional] | | **metadata** | [**Hash<String, MetadataValue>**](MetadataValue.md) | キーバリューの任意のデータを格納できます。20件まで登録可能で、空文字列を指定するとそのキーを削除できます。<a href=\"https://docs.pay.jp/v2/guide/developers/metadata\">詳細はメタデータのドキュメントを参照してください。</a> | [optional] | ## Example diff --git a/docs/PaymentFlowDataRequest.md b/docs/PaymentFlowDataRequest.md index bba229b..e1437bd 100644 --- a/docs/PaymentFlowDataRequest.md +++ b/docs/PaymentFlowDataRequest.md @@ -5,6 +5,7 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | **capture_method** | [**CaptureMethod**](CaptureMethod.md) | 支払いの確定方法を指定します。 | 指定できる値 | |:---| | **automatic**: 顧客が支払いを承認すると自動的に確定します。 | | **manual**: 顧客が支払いを承認すると一旦確定を保留し、後で Payment Flow の Capture API を使用して確定します。(すべての支払い方法がこれをサポートしているわけではありません)。 | | [optional] | +| **description** | **String** | | [optional] | | **metadata** | [**Hash<String, MetadataValue>**](MetadataValue.md) | キーバリューの任意のデータを格納できます。20件まで登録可能で、空文字列を指定するとそのキーを削除できます。<a href=\"https://docs.pay.jp/v2/guide/developers/metadata\">詳細はメタデータのドキュメントを参照してください。</a> | [optional] | ## Example @@ -14,6 +15,7 @@ require 'payjpv2' instance = PAYJPv2::PaymentFlowDataRequest.new( capture_method: null, + description: null, metadata: null ) ``` diff --git a/docs/PaymentFlowUpdateRequest.md b/docs/PaymentFlowUpdateRequest.md index c1394b2..2c32000 100644 --- a/docs/PaymentFlowUpdateRequest.md +++ b/docs/PaymentFlowUpdateRequest.md @@ -10,7 +10,7 @@ | **payment_method_options** | [**PaymentFlowPaymentMethodOptionsRequest**](PaymentFlowPaymentMethodOptionsRequest.md) | この PaymentFlow 固有の支払い方法の設定 | [optional] | | **payment_method_types** | [**Array<PaymentMethodTypes>**](PaymentMethodTypes.md) | この PaymentFlow で使用できる支払い方法の種類のリスト。指定しない場合は、PAY.JP は支払い方法の設定から利用可能な支払い方法を動的に表示します。 | [optional] | | **return_url** | **String** | 顧客が支払いを完了後かキャンセルした後にリダイレクトされる URL。アプリにリダイレクトしたい場合は URI Scheme を指定できます。 | [optional] | -| **description** | **String** | オブジェクトにセットする任意の文字列。ユーザーには表示されません。 | [optional] | +| **description** | **String** | オブジェクトにセットする任意の文字列。 | [optional] | | **metadata** | [**Hash<String, MetadataValue>**](MetadataValue.md) | キーバリューの任意のデータを格納できます。20件まで登録可能で、空文字列を指定するとそのキーを削除できます。<a href=\"https://docs.pay.jp/v2/guide/developers/metadata\">詳細はメタデータのドキュメントを参照してください。</a> | [optional] | ## Example diff --git a/docs/PaymentMethodConfigurationDetailsResponse.md b/docs/PaymentMethodConfigurationDetailsResponse.md index 38f5aaa..5381b3f 100644 --- a/docs/PaymentMethodConfigurationDetailsResponse.md +++ b/docs/PaymentMethodConfigurationDetailsResponse.md @@ -11,6 +11,7 @@ | **name** | **String** | | | | **paypay** | [**PaymentMethodConfigurationSettingResponse**](PaymentMethodConfigurationSettingResponse.md) | PayPay の設定 | | | **card** | [**PaymentMethodConfigurationSettingResponse**](PaymentMethodConfigurationSettingResponse.md) | カードの設定 | | +| **apple_pay** | [**PaymentMethodConfigurationSettingResponse**](PaymentMethodConfigurationSettingResponse.md) | Apple Pay の設定 | | ## Example @@ -24,7 +25,8 @@ instance = PAYJPv2::PaymentMethodConfigurationDetailsResponse.new( active: null, name: null, paypay: null, - card: null + card: null, + apple_pay: null ) ``` diff --git a/docs/PaymentMethodConfigurationUpdateRequest.md b/docs/PaymentMethodConfigurationUpdateRequest.md index da97670..e76ff17 100644 --- a/docs/PaymentMethodConfigurationUpdateRequest.md +++ b/docs/PaymentMethodConfigurationUpdateRequest.md @@ -8,6 +8,7 @@ | **name** | **String** | | [optional] | | **card** | [**CardConfigRequest**](CardConfigRequest.md) | | [optional] | | **paypay** | [**PayPayConfigRequest**](PayPayConfigRequest.md) | | [optional] | +| **apple_pay** | [**ApplePayConfigRequest**](ApplePayConfigRequest.md) | | [optional] | ## Example @@ -18,7 +19,8 @@ instance = PAYJPv2::PaymentMethodConfigurationUpdateRequest.new( active: null, name: null, card: null, - paypay: null + paypay: null, + apple_pay: null ) ``` diff --git a/docs/SetupFlowCreateRequest.md b/docs/SetupFlowCreateRequest.md index 61b051e..c72c412 100644 --- a/docs/SetupFlowCreateRequest.md +++ b/docs/SetupFlowCreateRequest.md @@ -8,7 +8,7 @@ | **payment_method_options** | [**SetupFlowPaymentMethodOptionsRequest**](SetupFlowPaymentMethodOptionsRequest.md) | この SetupFlow 固有の支払い方法の設定 | [optional] | | **payment_method_types** | **Array<String>** | この SetupFlow で使用できる支払い方法の種類のリスト。 指定しない場合は、PAY.JP は支払い方法の設定から利用可能な支払い方法を動的に表示します。 | [optional] | | **usage** | [**Usage**](Usage.md) | 支払い方法が今後どのように使用されるかを指定します。指定されていない場合、この値はデフォルトで `off_session` になります。 | 値 | |:---| | **off_session**: 定期課金など、顧客がカートなどの決済フローにいるかどうか不明な場合は `off_session` を使用してください。 | | **on_session**: 顧客がカートなどの決済フローにいる場合にのみ支払い方法を利用する場合は `on_session` を使用してください。 | | [optional] | -| **description** | **String** | 説明。顧客に表示されます。 | [optional] | +| **description** | **String** | 説明。 | [optional] | | **metadata** | [**Hash<String, MetadataValue>**](MetadataValue.md) | キーバリューの任意のデータを格納できます。20件まで登録可能で、空文字列を指定するとそのキーを削除できます。<a href=\"https://docs.pay.jp/v2/guide/developers/metadata\">詳細はメタデータのドキュメントを参照してください。</a> | [optional] | ## Example diff --git a/docs/SetupFlowDataRequest.md b/docs/SetupFlowDataRequest.md index 7af169e..bca8cf6 100644 --- a/docs/SetupFlowDataRequest.md +++ b/docs/SetupFlowDataRequest.md @@ -4,6 +4,7 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | +| **description** | **String** | | [optional] | | **metadata** | [**Hash<String, MetadataValue>**](MetadataValue.md) | キーバリューの任意のデータを格納できます。20件まで登録可能で、空文字列を指定するとそのキーを削除できます。<a href=\"https://docs.pay.jp/v2/guide/developers/metadata\">詳細はメタデータのドキュメントを参照してください。</a> | [optional] | ## Example @@ -12,6 +13,7 @@ require 'payjpv2' instance = PAYJPv2::SetupFlowDataRequest.new( + description: null, metadata: null ) ``` diff --git a/docs/SetupFlowUpdateRequest.md b/docs/SetupFlowUpdateRequest.md index 74244d5..2e18a52 100644 --- a/docs/SetupFlowUpdateRequest.md +++ b/docs/SetupFlowUpdateRequest.md @@ -7,7 +7,7 @@ | **customer_id** | **String** | この SetupFlow に関連付ける顧客の ID。SetupFlow により作られた PaymentMethod はこの顧客に紐付きます。 | [optional] | | **payment_method_options** | [**SetupFlowPaymentMethodOptionsRequest**](SetupFlowPaymentMethodOptionsRequest.md) | この SetupFlow 固有の支払い方法の設定 | [optional] | | **payment_method_types** | **Array<String>** | この SetupFlow で使用できる支払い方法の種類のリスト。 指定しない場合は、PAY.JP は支払い方法の設定から利用可能な支払い方法を動的に表示します。 | [optional] | -| **description** | **String** | 説明。顧客に表示されます。 | [optional] | +| **description** | **String** | 説明。 | [optional] | | **metadata** | [**Hash<String, MetadataValue>**](MetadataValue.md) | キーバリューの任意のデータを格納できます。20件まで登録可能で、空文字列を指定するとそのキーを削除できます。<a href=\"https://docs.pay.jp/v2/guide/developers/metadata\">詳細はメタデータのドキュメントを参照してください。</a> | [optional] | ## Example diff --git a/lib/payjpv2.rb b/lib/payjpv2.rb index 13c46ef..0de0e3f 100644 --- a/lib/payjpv2.rb +++ b/lib/payjpv2.rb @@ -17,6 +17,7 @@ require 'payjpv2/configuration' # Models +require 'payjpv2/models/apple_pay_config_request' require 'payjpv2/models/balance_list_response' require 'payjpv2/models/balance_response' require 'payjpv2/models/balance_state' diff --git a/lib/payjpv2/models/apple_pay_config_request.rb b/lib/payjpv2/models/apple_pay_config_request.rb new file mode 100644 index 0000000..9f62935 --- /dev/null +++ b/lib/payjpv2/models/apple_pay_config_request.rb @@ -0,0 +1,206 @@ +=begin +#PAY.JP API v2 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.14.0 + +=end + +require 'date' +require 'time' + +module PAYJPv2 + class ApplePayConfigRequest + attr_accessor :display_preference + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :display_preference => :display_preference + } + end + + # Returns attribute mapping this model knows about + def self.acceptable_attribute_map + attribute_map + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + acceptable_attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :display_preference => :'DisplayPreferenceRequest' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :display_preference + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + raise ArgumentError, "The input argument (attributes) must be a hash in `PAYJPv2::ApplePayConfigRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + acceptable_attribute_map = self.class.acceptable_attribute_map + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!acceptable_attribute_map.key?(k.to_sym)) + raise ArgumentError, "`#{k}` is not a valid attribute in `PAYJPv2::ApplePayConfigRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:display_preference) + self.display_preference = attributes[:display_preference] + end + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + display_preference == o.display_preference + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [display_preference].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + transformed_hash = {} + openapi_types.each_pair do |key, type| + if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = nil + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[attribute_map[key]].is_a?(Array) + transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } + end + elsif !attributes[attribute_map[key]].nil? + transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) + end + end + new(transformed_hash) + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def self._deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = PAYJPv2.const_get(type) + klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/payjpv2/models/payment_flow_cancel_request.rb b/lib/payjpv2/models/payment_flow_cancel_request.rb index 9fa6442..8276c99 100644 --- a/lib/payjpv2/models/payment_flow_cancel_request.rb +++ b/lib/payjpv2/models/payment_flow_cancel_request.rb @@ -15,7 +15,7 @@ module PAYJPv2 class PaymentFlowCancelRequest - # この PaymentFlow のキャンセル理由 | 値 | |:---| | **duplicate**: 重複した支払いである場合。 | | **fraudulent**: 不正な利用だと考えられる場合。 | | **requested_by_customer**: 顧客がキャンセルを要求した場合。 | | **abondoned**: 顧客が支払いを完了しなかった場合。 | + # この PaymentFlow のキャンセル理由 | 値 | |:---| | **duplicate**: 重複した支払いである場合。 | | **fraudulent**: 不正な利用だと考えられる場合。 | | **requested_by_customer**: 顧客がキャンセルを要求した場合。 | | **abandoned**: 顧客が支払いを完了しなかった場合。 | attr_accessor :cancellation_reason class EnumAttributeValidator diff --git a/lib/payjpv2/models/payment_flow_confirm_request.rb b/lib/payjpv2/models/payment_flow_confirm_request.rb index 19e2c4e..63a8150 100644 --- a/lib/payjpv2/models/payment_flow_confirm_request.rb +++ b/lib/payjpv2/models/payment_flow_confirm_request.rb @@ -24,13 +24,12 @@ class PaymentFlowConfirmRequest # この PaymentFlow で使用できる支払い方法の種類のリスト。指定しない場合は、PAY.JP は支払い方法の設定から利用可能な支払い方法を動的に表示します。 attr_accessor :payment_method_types - # 支払いの確定方法を指定します。 | 値 | |:---| | **automatic**: (デフォルト) 顧客が支払いを承認すると、自動的に確定させます。 | | **manual**: 顧客が支払いを承認すると一旦確定を保留し、後で Payment Flow の Capture API を使用して確定します。(すべての支払い方法がこれをサポートしているわけではありません)。 | attr_accessor :capture_method # 顧客が支払いを完了後かキャンセルした後にリダイレクトされる URL。アプリにリダイレクトしたい場合は URI Scheme を指定できます。 attr_accessor :return_url - # オブジェクトにセットする任意の文字列。ユーザーには表示されません。 + # オブジェクトにセットする任意の文字列。 attr_accessor :description class EnumAttributeValidator @@ -92,6 +91,7 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :capture_method, ]) end diff --git a/lib/payjpv2/models/payment_flow_create_request.rb b/lib/payjpv2/models/payment_flow_create_request.rb index b1a499e..f1d59d6 100644 --- a/lib/payjpv2/models/payment_flow_create_request.rb +++ b/lib/payjpv2/models/payment_flow_create_request.rb @@ -42,7 +42,7 @@ class PaymentFlowCreateRequest # 顧客が支払いを完了後かキャンセルした後にリダイレクトされる URL。アプリにリダイレクトしたい場合は URI Scheme を指定できます。confirm=true の場合のみ指定できます。 attr_accessor :return_url - # オブジェクトにセットする任意の文字列。ユーザーには表示されません。 + # オブジェクトにセットする任意の文字列。 attr_accessor :description # キーバリューの任意のデータを格納できます。20件まで登録可能で、空文字列を指定するとそのキーを削除できます。詳細はメタデータのドキュメントを参照してください。 diff --git a/lib/payjpv2/models/payment_flow_data_request.rb b/lib/payjpv2/models/payment_flow_data_request.rb index 7298d84..ef698c2 100644 --- a/lib/payjpv2/models/payment_flow_data_request.rb +++ b/lib/payjpv2/models/payment_flow_data_request.rb @@ -18,6 +18,8 @@ class PaymentFlowDataRequest # 支払いの確定方法を指定します。 | 指定できる値 | |:---| | **automatic**: 顧客が支払いを承認すると自動的に確定します。 | | **manual**: 顧客が支払いを承認すると一旦確定を保留し、後で Payment Flow の Capture API を使用して確定します。(すべての支払い方法がこれをサポートしているわけではありません)。 | attr_accessor :capture_method + attr_accessor :description + # キーバリューの任意のデータを格納できます。20件まで登録可能で、空文字列を指定するとそのキーを削除できます。詳細はメタデータのドキュメントを参照してください。 attr_accessor :metadata @@ -47,6 +49,7 @@ def valid?(value) def self.attribute_map { :capture_method => :capture_method, + :description => :description, :metadata => :metadata } end @@ -65,6 +68,7 @@ def self.acceptable_attributes def self.openapi_types { :capture_method => :'CaptureMethod', + :description => :'String', :metadata => :'Hash' } end @@ -72,6 +76,7 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :description, ]) end @@ -95,6 +100,10 @@ def initialize(attributes = {}) self.capture_method = attributes[:capture_method] end + if attributes.key?(:description) + self.description = attributes[:description] + end + if attributes.key?(:metadata) if (value = attributes[:metadata]).is_a?(Hash) self.metadata = value @@ -108,6 +117,7 @@ def ==(o) return true if self.equal?(o) self.class == o.class && capture_method == o.capture_method && + description == o.description && metadata == o.metadata end @@ -120,7 +130,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [capture_method, metadata].hash + [capture_method, description, metadata].hash end # Builds the object from hash diff --git a/lib/payjpv2/models/payment_flow_update_request.rb b/lib/payjpv2/models/payment_flow_update_request.rb index f11af7b..567a4a1 100644 --- a/lib/payjpv2/models/payment_flow_update_request.rb +++ b/lib/payjpv2/models/payment_flow_update_request.rb @@ -33,7 +33,7 @@ class PaymentFlowUpdateRequest # 顧客が支払いを完了後かキャンセルした後にリダイレクトされる URL。アプリにリダイレクトしたい場合は URI Scheme を指定できます。 attr_accessor :return_url - # オブジェクトにセットする任意の文字列。ユーザーには表示されません。 + # オブジェクトにセットする任意の文字列。 attr_accessor :description # キーバリューの任意のデータを格納できます。20件まで登録可能で、空文字列を指定するとそのキーを削除できます。詳細はメタデータのドキュメントを参照してください。 diff --git a/lib/payjpv2/models/payment_method_configuration_details_response.rb b/lib/payjpv2/models/payment_method_configuration_details_response.rb index 9db6f8b..8314975 100644 --- a/lib/payjpv2/models/payment_method_configuration_details_response.rb +++ b/lib/payjpv2/models/payment_method_configuration_details_response.rb @@ -34,6 +34,9 @@ class PaymentMethodConfigurationDetailsResponse # カードの設定 attr_accessor :card + # Apple Pay の設定 + attr_accessor :apple_pay + class EnumAttributeValidator attr_reader :datatype attr_reader :allowable_values @@ -65,7 +68,8 @@ def self.attribute_map :active => :active, :name => :name, :paypay => :paypay, - :card => :card + :card => :card, + :apple_pay => :apple_pay } end @@ -88,7 +92,8 @@ def self.openapi_types :active => :'Boolean', :name => :'String', :paypay => :'PaymentMethodConfigurationSettingResponse', - :card => :'PaymentMethodConfigurationSettingResponse' + :card => :'PaymentMethodConfigurationSettingResponse', + :apple_pay => :'PaymentMethodConfigurationSettingResponse' } end @@ -156,6 +161,12 @@ def initialize(attributes = {}) else self.card = nil end + + if attributes.key?(:apple_pay) + self.apple_pay = attributes[:apple_pay] + else + self.apple_pay = nil + end end # Custom attribute writer method checking allowed values (enum). @@ -218,6 +229,16 @@ def card=(card) @card = card end + # Custom attribute writer method with validation + # @param [Object] apple_pay Value to be assigned + def apple_pay=(apple_pay) + if apple_pay.nil? + raise ArgumentError, 'apple_pay cannot be nil' + end + + @apple_pay = apple_pay + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) @@ -229,7 +250,8 @@ def ==(o) active == o.active && name == o.name && paypay == o.paypay && - card == o.card + card == o.card && + apple_pay == o.apple_pay end # @see the `==` method @@ -241,7 +263,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [object, id, livemode, active, name, paypay, card].hash + [object, id, livemode, active, name, paypay, card, apple_pay].hash end # Builds the object from hash diff --git a/lib/payjpv2/models/payment_method_configuration_update_request.rb b/lib/payjpv2/models/payment_method_configuration_update_request.rb index 3a8b3db..1b712aa 100644 --- a/lib/payjpv2/models/payment_method_configuration_update_request.rb +++ b/lib/payjpv2/models/payment_method_configuration_update_request.rb @@ -23,13 +23,16 @@ class PaymentMethodConfigurationUpdateRequest attr_accessor :paypay + attr_accessor :apple_pay + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { :active => :active, :name => :name, :card => :card, - :paypay => :paypay + :paypay => :paypay, + :apple_pay => :apple_pay } end @@ -49,7 +52,8 @@ def self.openapi_types :active => :'Boolean', :name => :'String', :card => :'CardConfigRequest', - :paypay => :'PayPayConfigRequest' + :paypay => :'PayPayConfigRequest', + :apple_pay => :'ApplePayConfigRequest' } end @@ -59,7 +63,8 @@ def self.openapi_nullable :active, :name, :card, - :paypay + :paypay, + :apple_pay ]) end @@ -94,6 +99,10 @@ def initialize(attributes = {}) if attributes.key?(:paypay) self.paypay = attributes[:paypay] end + + if attributes.key?(:apple_pay) + self.apple_pay = attributes[:apple_pay] + end end # Checks equality by comparing each attribute. @@ -104,7 +113,8 @@ def ==(o) active == o.active && name == o.name && card == o.card && - paypay == o.paypay + paypay == o.paypay && + apple_pay == o.apple_pay end # @see the `==` method @@ -116,7 +126,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [active, name, card, paypay].hash + [active, name, card, paypay, apple_pay].hash end # Builds the object from hash diff --git a/lib/payjpv2/models/payment_refund_create_request.rb b/lib/payjpv2/models/payment_refund_create_request.rb index 5dd4170..4f3a970 100644 --- a/lib/payjpv2/models/payment_refund_create_request.rb +++ b/lib/payjpv2/models/payment_refund_create_request.rb @@ -139,8 +139,8 @@ def amount=(amount) raise ArgumentError, 'amount cannot be nil' end - if amount < 0 - raise ArgumentError, 'invalid value for "amount", must be greater than or equal to 0.' + if amount < 1 + raise ArgumentError, 'invalid value for "amount", must be greater than or equal to 1.' end @amount = amount diff --git a/lib/payjpv2/models/setup_flow_create_request.rb b/lib/payjpv2/models/setup_flow_create_request.rb index 01aae5c..b3d74eb 100644 --- a/lib/payjpv2/models/setup_flow_create_request.rb +++ b/lib/payjpv2/models/setup_flow_create_request.rb @@ -27,7 +27,7 @@ class SetupFlowCreateRequest # 支払い方法が今後どのように使用されるかを指定します。指定されていない場合、この値はデフォルトで `off_session` になります。 | 値 | |:---| | **off_session**: 定期課金など、顧客がカートなどの決済フローにいるかどうか不明な場合は `off_session` を使用してください。 | | **on_session**: 顧客がカートなどの決済フローにいる場合にのみ支払い方法を利用する場合は `on_session` を使用してください。 | attr_accessor :usage - # 説明。顧客に表示されます。 + # 説明。 attr_accessor :description # キーバリューの任意のデータを格納できます。20件まで登録可能で、空文字列を指定するとそのキーを削除できます。詳細はメタデータのドキュメントを参照してください。 diff --git a/lib/payjpv2/models/setup_flow_data_request.rb b/lib/payjpv2/models/setup_flow_data_request.rb index 55d4b86..ff4ee4d 100644 --- a/lib/payjpv2/models/setup_flow_data_request.rb +++ b/lib/payjpv2/models/setup_flow_data_request.rb @@ -15,12 +15,15 @@ module PAYJPv2 class SetupFlowDataRequest + attr_accessor :description + # キーバリューの任意のデータを格納できます。20件まで登録可能で、空文字列を指定するとそのキーを削除できます。詳細はメタデータのドキュメントを参照してください。 attr_accessor :metadata # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { + :description => :description, :metadata => :metadata } end @@ -38,6 +41,7 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { + :description => :'String', :metadata => :'Hash' } end @@ -45,6 +49,7 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :description, ]) end @@ -64,6 +69,10 @@ def initialize(attributes = {}) h[k.to_sym] = v } + if attributes.key?(:description) + self.description = attributes[:description] + end + if attributes.key?(:metadata) if (value = attributes[:metadata]).is_a?(Hash) self.metadata = value @@ -76,6 +85,7 @@ def initialize(attributes = {}) def ==(o) return true if self.equal?(o) self.class == o.class && + description == o.description && metadata == o.metadata end @@ -88,7 +98,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [metadata].hash + [description, metadata].hash end # Builds the object from hash diff --git a/lib/payjpv2/models/setup_flow_update_request.rb b/lib/payjpv2/models/setup_flow_update_request.rb index 843a190..ddad697 100644 --- a/lib/payjpv2/models/setup_flow_update_request.rb +++ b/lib/payjpv2/models/setup_flow_update_request.rb @@ -24,7 +24,7 @@ class SetupFlowUpdateRequest # この SetupFlow で使用できる支払い方法の種類のリスト。 指定しない場合は、PAY.JP は支払い方法の設定から利用可能な支払い方法を動的に表示します。 attr_accessor :payment_method_types - # 説明。顧客に表示されます。 + # 説明。 attr_accessor :description # キーバリューの任意のデータを格納できます。20件まで登録可能で、空文字列を指定するとそのキーを削除できます。詳細はメタデータのドキュメントを参照してください。 diff --git a/lib/payjpv2/version.rb b/lib/payjpv2/version.rb index a83d833..2c0bb43 100644 --- a/lib/payjpv2/version.rb +++ b/lib/payjpv2/version.rb @@ -11,5 +11,5 @@ =end module PAYJPv2 - VERSION = '1.0.1' + VERSION = '1.0.2' end diff --git a/spec/models/apple_pay_config_request_spec.rb b/spec/models/apple_pay_config_request_spec.rb new file mode 100644 index 0000000..3826f49 --- /dev/null +++ b/spec/models/apple_pay_config_request_spec.rb @@ -0,0 +1,36 @@ +=begin +#PAY.JP API v2 + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.0.0 + +Generated by: https://openapi-generator.tech +Generator version: 7.14.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for PAYJPv2::ApplePayConfigRequest +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe PAYJPv2::ApplePayConfigRequest do + let(:instance) { PAYJPv2::ApplePayConfigRequest.new } + + describe 'test an instance of ApplePayConfigRequest' do + it 'should create an instance of ApplePayConfigRequest' do + # uncomment below to test the instance creation + #expect(instance).to be_instance_of(PAYJPv2::ApplePayConfigRequest) + end + end + + describe 'test attribute "display_preference"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + +end diff --git a/spec/models/payment_flow_data_request_spec.rb b/spec/models/payment_flow_data_request_spec.rb index e8e1142..1762ee2 100644 --- a/spec/models/payment_flow_data_request_spec.rb +++ b/spec/models/payment_flow_data_request_spec.rb @@ -33,6 +33,12 @@ end end + describe 'test attribute "description"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + describe 'test attribute "metadata"' do it 'should work' do # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ diff --git a/spec/models/payment_method_configuration_details_response_spec.rb b/spec/models/payment_method_configuration_details_response_spec.rb index b1dc773..3a5897b 100644 --- a/spec/models/payment_method_configuration_details_response_spec.rb +++ b/spec/models/payment_method_configuration_details_response_spec.rb @@ -73,4 +73,10 @@ end end + describe 'test attribute "apple_pay"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + end diff --git a/spec/models/payment_method_configuration_update_request_spec.rb b/spec/models/payment_method_configuration_update_request_spec.rb index fde3b36..1a5529b 100644 --- a/spec/models/payment_method_configuration_update_request_spec.rb +++ b/spec/models/payment_method_configuration_update_request_spec.rb @@ -51,4 +51,10 @@ end end + describe 'test attribute "apple_pay"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + end diff --git a/spec/models/setup_flow_data_request_spec.rb b/spec/models/setup_flow_data_request_spec.rb index 31b9a11..41445a7 100644 --- a/spec/models/setup_flow_data_request_spec.rb +++ b/spec/models/setup_flow_data_request_spec.rb @@ -27,6 +27,12 @@ end end + describe 'test attribute "description"' do + it 'should work' do + # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/ + end + end + describe 'test attribute "metadata"' do it 'should work' do # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/