Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
payjpv2 (1.0.1)
payjpv2 (1.0.2)
typhoeus (~> 1.0, >= 1.0.1)

GEM
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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:
Expand Down Expand Up @@ -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)
Expand Down
18 changes: 18 additions & 0 deletions docs/ApplePayConfigRequest.md
Original file line number Diff line number Diff line change
@@ -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
)
```

2 changes: 1 addition & 1 deletion docs/PaymentFlowCancelRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions docs/PaymentFlowConfirmRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion docs/PaymentFlowCreateRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions docs/PaymentFlowDataRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -14,6 +15,7 @@ require 'payjpv2'

instance = PAYJPv2::PaymentFlowDataRequest.new(
capture_method: null,
description: null,
metadata: null
)
```
Expand Down
2 changes: 1 addition & 1 deletion docs/PaymentFlowUpdateRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion docs/PaymentMethodConfigurationDetailsResponse.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
| **name** | **String** | | |
| **paypay** | [**PaymentMethodConfigurationSettingResponse**](PaymentMethodConfigurationSettingResponse.md) | PayPay の設定 | |
| **card** | [**PaymentMethodConfigurationSettingResponse**](PaymentMethodConfigurationSettingResponse.md) | カードの設定 | |
| **apple_pay** | [**PaymentMethodConfigurationSettingResponse**](PaymentMethodConfigurationSettingResponse.md) | Apple Pay の設定 | |

## Example

Expand All @@ -24,7 +25,8 @@ instance = PAYJPv2::PaymentMethodConfigurationDetailsResponse.new(
active: null,
name: null,
paypay: null,
card: null
card: null,
apple_pay: null
)
```

4 changes: 3 additions & 1 deletion docs/PaymentMethodConfigurationUpdateRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
| **name** | **String** | | [optional] |
| **card** | [**CardConfigRequest**](CardConfigRequest.md) | | [optional] |
| **paypay** | [**PayPayConfigRequest**](PayPayConfigRequest.md) | | [optional] |
| **apple_pay** | [**ApplePayConfigRequest**](ApplePayConfigRequest.md) | | [optional] |

## Example

Expand All @@ -18,7 +19,8 @@ instance = PAYJPv2::PaymentMethodConfigurationUpdateRequest.new(
active: null,
name: null,
card: null,
paypay: null
paypay: null,
apple_pay: null
)
```

2 changes: 1 addition & 1 deletion docs/SetupFlowCreateRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions docs/SetupFlowDataRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -12,6 +13,7 @@
require 'payjpv2'

instance = PAYJPv2::SetupFlowDataRequest.new(
description: null,
metadata: null
)
```
Expand Down
2 changes: 1 addition & 1 deletion docs/SetupFlowUpdateRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions lib/payjpv2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
206 changes: 206 additions & 0 deletions lib/payjpv2/models/apple_pay_config_request.rb
Original file line number Diff line number Diff line change
@@ -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<(?<inner_type>.+)>\z/
inner_type = Regexp.last_match[:inner_type]
value.map { |v| _deserialize(inner_type, v) }
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\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
Loading
Loading