payjpv2 1.0.10 → 1.1.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 763b163bb9ca0ca64ab5680c2ce6a4692b23ba7adfe6565bfa9c7af5d69503c3
4
- data.tar.gz: 6ea914a0427bcf2fbafd02f1605545229c3320169d5324f1a590999ea4c583b0
3
+ metadata.gz: 56b88fd18889958097f5e7e121adfb3525c0df32c2c248653b686753b6ec90d2
4
+ data.tar.gz: 7d022140ae970e85dffb8a88f91abdb0633d9c07909e5b83deaf06e1ff290332
5
5
  SHA512:
6
- metadata.gz: 1b8a6fa2ca6a2736cb7490326aa9592276c9163d7a068de1c451d02dea05271d012336a0625650fe281c84d77cb30092d7047dbb0e85a89ef3ac82b79812b24b
7
- data.tar.gz: 14ecb925bd10aa5494c46d1035ab7233f4ecc2246f8ac13a65f229b1dadd604a0161837c0ba700fbe43e74d041258bbf9453aa903151622497069081750d7b46
6
+ metadata.gz: cf3ba18464531a698a3e0f8353d3f3a85a958f743c3aca94ce96b1b86cbf73065324893521ef39b7d05076c259501336882cb841fb832829ce7b12bd4e735d23
7
+ data.tar.gz: a56d69719517c149a0918f879f52170c51a5d645eebfa24530426045aabeb61c4612c6d1a2431cda384cded5ba129d1cbae52b8c4b2eecccb101a0acece00fae
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- payjpv2 (1.0.10)
4
+ payjpv2 (1.1.0)
5
5
  typhoeus (~> 1.0, >= 1.0.1)
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -5,7 +5,7 @@ A Ruby client library for the PAY.JP v2 API. This SDK provides a convenient way
5
5
  This Ruby gem is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
6
6
 
7
7
  - API version: 2.0.0
8
- - Package version: 1.0.10
8
+ - Package version: 1.1.0
9
9
  - Generator version: 7.14.0
10
10
  - Build package: org.openapitools.codegen.languages.RubyClientCodegen
11
11
 
@@ -26,7 +26,7 @@ gem install payjpv2
26
26
  Add this line to your application's Gemfile:
27
27
 
28
28
  ```ruby
29
- gem 'payjpv2', '~> 1.0.10'
29
+ gem 'payjpv2', '~> 1.1.0'
30
30
  ```
31
31
 
32
32
  Then execute:
@@ -350,11 +350,13 @@ Class | Method | HTTP request | Description
350
350
  - [PAYJPv2::PaymentTransactionResponse](docs/PaymentTransactionResponse.md)
351
351
  - [PAYJPv2::PaymentTransactionType](docs/PaymentTransactionType.md)
352
352
  - [PAYJPv2::PriceCreateRequest](docs/PriceCreateRequest.md)
353
+ - [PAYJPv2::PriceDataRequest](docs/PriceDataRequest.md)
353
354
  - [PAYJPv2::PriceDetailsResponse](docs/PriceDetailsResponse.md)
354
355
  - [PAYJPv2::PriceListResponse](docs/PriceListResponse.md)
355
356
  - [PAYJPv2::PriceType](docs/PriceType.md)
356
357
  - [PAYJPv2::PriceUpdateRequest](docs/PriceUpdateRequest.md)
357
358
  - [PAYJPv2::ProductCreateRequest](docs/ProductCreateRequest.md)
359
+ - [PAYJPv2::ProductDataRequest](docs/ProductDataRequest.md)
358
360
  - [PAYJPv2::ProductDeletedResponse](docs/ProductDeletedResponse.md)
359
361
  - [PAYJPv2::ProductDetailsResponse](docs/ProductDetailsResponse.md)
360
362
  - [PAYJPv2::ProductListResponse](docs/ProductListResponse.md)
@@ -4,7 +4,7 @@
4
4
 
5
5
  | Name | Type | Description | Notes |
6
6
  | ---- | ---- | ----------- | ----- |
7
- | **default_payment_method_id** | **String** | | [optional] |
7
+ | **default_payment_method_id** | **String** | 支払いにデフォルトで使用される支払い方法 ID | [optional] |
8
8
  | **email** | **String** | 顧客のメールアドレス。メールアドレスの形式が正しいかどうかは検証されます。 | [optional] |
9
9
  | **description** | **String** | 顧客オブジェクトに付加できる任意の文字列です。管理画面で顧客と一緒に表示されます。 | [optional] |
10
10
  | **metadata** | [**Hash<String, MetadataValue>**](MetadataValue.md) | キーバリューの任意のデータを格納できます。20件まで登録可能で、空文字列を指定するとそのキーを削除できます。<a href=\"https://docs.pay.jp/v2/guide/developers/metadata\">詳細はメタデータのドキュメントを参照してください。</a> | [optional] |
@@ -4,7 +4,8 @@
4
4
 
5
5
  | Name | Type | Description | Notes |
6
6
  | ---- | ---- | ----------- | ----- |
7
- | **price_id** | **String** | 料金 ID | |
7
+ | **price_id** | **String** | | [optional] |
8
+ | **price_data** | [**PriceDataRequest**](PriceDataRequest.md) | | [optional] |
8
9
  | **quantity** | **Integer** | 購入する商品の数量 | |
9
10
  | **tax_rates** | **Array<String>** | 税率 ID | [optional] |
10
11
 
@@ -15,6 +16,7 @@ require 'payjpv2'
15
16
 
16
17
  instance = PAYJPv2::LineItemRequest.new(
17
18
  price_id: null,
19
+ price_data: null,
18
20
  quantity: null,
19
21
  tax_rates: null
20
22
  )
@@ -0,0 +1,24 @@
1
+ # PAYJPv2::PriceDataRequest
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **currency** | [**Currency**](Currency.md) | 通貨。現在は `jpy` のみサポートしています。 | |
8
+ | **unit_amount** | **Integer** | 単価(0以上の整数) | |
9
+ | **product_id** | **String** | | [optional] |
10
+ | **product_data** | [**ProductDataRequest**](ProductDataRequest.md) | | [optional] |
11
+
12
+ ## Example
13
+
14
+ ```ruby
15
+ require 'payjpv2'
16
+
17
+ instance = PAYJPv2::PriceDataRequest.new(
18
+ currency: null,
19
+ unit_amount: null,
20
+ product_id: null,
21
+ product_data: null
22
+ )
23
+ ```
24
+
@@ -0,0 +1,20 @@
1
+ # PAYJPv2::ProductDataRequest
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **name** | **String** | Checkout などで顧客に表示される商品名 | |
8
+ | **description** | **String** | | [optional] |
9
+
10
+ ## Example
11
+
12
+ ```ruby
13
+ require 'payjpv2'
14
+
15
+ instance = PAYJPv2::ProductDataRequest.new(
16
+ name: null,
17
+ description: null
18
+ )
19
+ ```
20
+
data/example.rb CHANGED
@@ -21,6 +21,7 @@ api_instance = PAYJPv2::CustomersApi.new
21
21
  checkout_sessions_api = PAYJPv2::CheckoutSessionsApi.new
22
22
  products_api = PAYJPv2::ProductsApi.new
23
23
  prices_api = PAYJPv2::PricesApi.new
24
+ payment_methods_api = PAYJPv2::PaymentMethodsApi.new
24
25
 
25
26
  customer_create_request = PAYJPv2::CustomerCreateRequest.new(
26
27
  email: 'jennyrosen@example.com',
@@ -73,16 +74,65 @@ begin
73
74
  end
74
75
  puts "\n"
75
76
 
76
- # 5. Delete Customer
77
- puts "=== 5. Delete Customer ==="
77
+ # 5. PaymentMethod operations
78
+ # Note: create_payment_method is available only in test mode. In production,
79
+ # a PaymentMethod is created by tokenizing card details on the client side
80
+ # (e.g. payment.js) and then attaching the resulting token to a Customer.
81
+ puts "=== 5. PaymentMethod operations ==="
82
+
83
+ # 5a. Create PaymentMethod (test mode)
84
+ puts "\n--- 5a. Create PaymentMethod (test mode) ---"
85
+ payment_method_request = PAYJPv2::PaymentMethodCardCreateRequest.new(
86
+ type: 'card',
87
+ card: PAYJPv2::PaymentMethodCreateCardDetailsRequest.new(
88
+ number: '4242424242424242',
89
+ exp_month: 12,
90
+ exp_year: 2030,
91
+ cvc: '123'
92
+ ),
93
+ billing_details: PAYJPv2::PaymentMethodCardBillingDetailsRequest.new(
94
+ email: 'billing@example.com'
95
+ )
96
+ )
97
+ payment_method = payment_methods_api.create_payment_method(payment_method_request)
98
+ payment_method_id = payment_method.id
99
+ puts "Created PaymentMethod: #{payment_method_id}"
100
+ puts "Type: #{payment_method.type}"
101
+
102
+ # 5b. Attach PaymentMethod to Customer
103
+ puts "\n--- 5b. Attach PaymentMethod ---"
104
+ attached = payment_methods_api.attach_payment_method(
105
+ payment_method_id,
106
+ PAYJPv2::PaymentMethodAttachRequest.new(customer_id: customer_id)
107
+ )
108
+ puts "Attached PaymentMethod: #{attached.id}"
109
+ puts "Customer: #{attached.customer_id}"
110
+
111
+ # 5c. Retrieve PaymentMethod (active)
112
+ puts "\n--- 5c. Retrieve PaymentMethod ---"
113
+ retrieved_pm = payment_methods_api.get_payment_method(payment_method_id)
114
+ puts "PaymentMethod ID: #{retrieved_pm.id}"
115
+ puts "Customer: #{retrieved_pm.customer_id}"
116
+ puts "Detached at: #{retrieved_pm.detached_at || '(active)'}"
117
+
118
+ # 5d. Detach PaymentMethod
119
+ # The API marks the PaymentMethod with `detached_at` while keeping
120
+ # `customer_id` for historical reference.
121
+ puts "\n--- 5d. Detach PaymentMethod ---"
122
+ detached = payment_methods_api.detach_payment_method(payment_method_id)
123
+ puts "Detached PaymentMethod: #{detached.id}"
124
+ puts "Detached at: #{detached.detached_at}\n\n"
125
+
126
+ # 6. Delete Customer
127
+ puts "=== 6. Delete Customer ==="
78
128
  api_instance.delete_customer(customer_id)
79
129
  puts "Deleted customer: #{customer_id}\n\n"
80
130
 
81
- # 6. Create Product, Price, and Checkout Session
82
- puts "=== 6. Create Product, Price, and Checkout Session ==="
131
+ # 7. Create Product, Price, and Checkout Session
132
+ puts "=== 7. Create Product, Price, and Checkout Session ==="
83
133
 
84
- # 6a. Create Product
85
- puts "\n--- 6a. Create Product ---"
134
+ # 7a. Create Product
135
+ puts "\n--- 7a. Create Product ---"
86
136
  product_request = PAYJPv2::ProductCreateRequest.new(
87
137
  name: 'Sample Product',
88
138
  description: 'A sample product for checkout session demo',
@@ -100,8 +150,8 @@ begin
100
150
  puts "Created product: #{product_id}"
101
151
  puts "Product name: #{product.name}"
102
152
 
103
- # 6b. Create Price
104
- puts "\n--- 6b. Create Price ---"
153
+ # 7b. Create Price
154
+ puts "\n--- 7b. Create Price ---"
105
155
  price_request = PAYJPv2::PriceCreateRequest.new(
106
156
  currency: 'jpy',
107
157
  product_id: product_id,
@@ -121,8 +171,8 @@ begin
121
171
  puts "Created price: #{price_id}"
122
172
  puts "Unit amount: #{price.unit_amount} JPY"
123
173
 
124
- # 6c. Create Checkout Session
125
- puts "\n--- 6c. Create Checkout Session ---"
174
+ # 7c. Create Checkout Session
175
+ puts "\n--- 7c. Create Checkout Session ---"
126
176
  line_items = [
127
177
  PAYJPv2::LineItemRequest.new(
128
178
  price_id: price_id, # Use the actual price ID we just created
@@ -158,5 +208,5 @@ begin
158
208
  puts "=== All tests passed! ==="
159
209
 
160
210
  rescue PAYJPv2::ApiError => e
161
- puts "Exception when calling CustomersApi->create_customer: #{e}"
211
+ puts "Exception when calling PAYJPv2 API: #{e}"
162
212
  end
@@ -280,9 +280,9 @@ module PAYJPv2
280
280
  data.each { |k, v| hash[k] = convert_to_type(v, sub_type) }
281
281
  end
282
282
  else
283
- # models (e.g. Pet) or oneOf
283
+ # models (e.g. Pet) or oneOf / anyOf
284
284
  klass = PAYJPv2.const_get(return_type)
285
- klass.respond_to?(:openapi_one_of) ? klass.build(data) : klass.build_from_hash(data)
285
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(data) : klass.build_from_hash(data)
286
286
  end
287
287
  end
288
288
 
@@ -15,6 +15,7 @@ require 'time'
15
15
 
16
16
  module PAYJPv2
17
17
  class CustomerUpdateRequest
18
+ # 支払いにデフォルトで使用される支払い方法 ID
18
19
  attr_accessor :default_payment_method_id
19
20
 
20
21
  # 顧客のメールアドレス。メールアドレスの形式が正しいかどうかは検証されます。
@@ -59,7 +60,6 @@ module PAYJPv2
59
60
  # List of attributes with nullable: true
60
61
  def self.openapi_nullable
61
62
  Set.new([
62
- :default_payment_method_id,
63
63
  ])
64
64
  end
65
65
 
@@ -15,9 +15,10 @@ require 'time'
15
15
 
16
16
  module PAYJPv2
17
17
  class LineItemRequest
18
- # 料金 ID
19
18
  attr_accessor :price_id
20
19
 
20
+ attr_accessor :price_data
21
+
21
22
  # 購入する商品の数量
22
23
  attr_accessor :quantity
23
24
 
@@ -28,6 +29,7 @@ module PAYJPv2
28
29
  def self.attribute_map
29
30
  {
30
31
  :price_id => :price_id,
32
+ :price_data => :price_data,
31
33
  :quantity => :quantity,
32
34
  :tax_rates => :tax_rates
33
35
  }
@@ -47,6 +49,7 @@ module PAYJPv2
47
49
  def self.openapi_types
48
50
  {
49
51
  :price_id => :'String',
52
+ :price_data => :'PriceDataRequest',
50
53
  :quantity => :'Integer',
51
54
  :tax_rates => :'Array<String>'
52
55
  }
@@ -55,6 +58,8 @@ module PAYJPv2
55
58
  # List of attributes with nullable: true
56
59
  def self.openapi_nullable
57
60
  Set.new([
61
+ :price_id,
62
+ :price_data,
58
63
  ])
59
64
  end
60
65
 
@@ -76,8 +81,10 @@ module PAYJPv2
76
81
 
77
82
  if attributes.key?(:price_id)
78
83
  self.price_id = attributes[:price_id]
79
- else
80
- self.price_id = nil
84
+ end
85
+
86
+ if attributes.key?(:price_data)
87
+ self.price_data = attributes[:price_data]
81
88
  end
82
89
 
83
90
  if attributes.key?(:quantity)
@@ -93,16 +100,6 @@ module PAYJPv2
93
100
  end
94
101
  end
95
102
 
96
- # Custom attribute writer method with validation
97
- # @param [Object] price_id Value to be assigned
98
- def price_id=(price_id)
99
- if price_id.nil?
100
- raise ArgumentError, 'price_id cannot be nil'
101
- end
102
-
103
- @price_id = price_id
104
- end
105
-
106
103
  # Custom attribute writer method with validation
107
104
  # @param [Object] quantity Value to be assigned
108
105
  def quantity=(quantity)
@@ -119,6 +116,7 @@ module PAYJPv2
119
116
  return true if self.equal?(o)
120
117
  self.class == o.class &&
121
118
  price_id == o.price_id &&
119
+ price_data == o.price_data &&
122
120
  quantity == o.quantity &&
123
121
  tax_rates == o.tax_rates
124
122
  end
@@ -132,7 +130,7 @@ module PAYJPv2
132
130
  # Calculates hash code according to all attributes.
133
131
  # @return [Integer] Hash code
134
132
  def hash
135
- [price_id, quantity, tax_rates].hash
133
+ [price_id, price_data, quantity, tax_rates].hash
136
134
  end
137
135
 
138
136
  # Builds the object from hash
@@ -88,7 +88,8 @@ module PAYJPv2
88
88
  return model if model
89
89
  else
90
90
  # raise if data contains keys that are not known to the model
91
- raise if const.respond_to?(:acceptable_attributes) && !(data.keys - const.acceptable_attributes).empty?
91
+ # NOTE: acceptable_attributes returns symbols while data keys are strings (from JSON.parse), so symbolize before diff
92
+ raise if const.respond_to?(:acceptable_attributes) && !(data.keys.map(&:to_sym) - const.acceptable_attributes).empty?
92
93
  model = const.build_from_hash(data)
93
94
  return model if model
94
95
  end
@@ -87,7 +87,8 @@ module PAYJPv2
87
87
  return model if model
88
88
  else
89
89
  # raise if data contains keys that are not known to the model
90
- raise if const.respond_to?(:acceptable_attributes) && !(data.keys - const.acceptable_attributes).empty?
90
+ # NOTE: acceptable_attributes returns symbols while data keys are strings (from JSON.parse), so symbolize before diff
91
+ raise if const.respond_to?(:acceptable_attributes) && !(data.keys.map(&:to_sym) - const.acceptable_attributes).empty?
91
92
  model = const.build_from_hash(data)
92
93
  return model if model
93
94
  end
@@ -0,0 +1,286 @@
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 PriceDataRequest
18
+ # 通貨。現在は `jpy` のみサポートしています。
19
+ attr_accessor :currency
20
+
21
+ # 単価(0以上の整数)
22
+ attr_accessor :unit_amount
23
+
24
+ attr_accessor :product_id
25
+
26
+ attr_accessor :product_data
27
+
28
+ class EnumAttributeValidator
29
+ attr_reader :datatype
30
+ attr_reader :allowable_values
31
+
32
+ def initialize(datatype, allowable_values)
33
+ @allowable_values = allowable_values.map do |value|
34
+ case datatype.to_s
35
+ when /Integer/i
36
+ value.to_i
37
+ when /Float/i
38
+ value.to_f
39
+ else
40
+ value
41
+ end
42
+ end
43
+ end
44
+
45
+ def valid?(value)
46
+ !value || allowable_values.include?(value)
47
+ end
48
+ end
49
+
50
+ # Attribute mapping from ruby-style variable name to JSON key.
51
+ def self.attribute_map
52
+ {
53
+ :currency => :currency,
54
+ :unit_amount => :unit_amount,
55
+ :product_id => :product_id,
56
+ :product_data => :product_data
57
+ }
58
+ end
59
+
60
+ # Returns attribute mapping this model knows about
61
+ def self.acceptable_attribute_map
62
+ attribute_map
63
+ end
64
+
65
+ # Returns all the JSON keys this model knows about
66
+ def self.acceptable_attributes
67
+ acceptable_attribute_map.values
68
+ end
69
+
70
+ # Attribute type mapping.
71
+ def self.openapi_types
72
+ {
73
+ :currency => :'Currency',
74
+ :unit_amount => :'Integer',
75
+ :product_id => :'String',
76
+ :product_data => :'ProductDataRequest'
77
+ }
78
+ end
79
+
80
+ # List of attributes with nullable: true
81
+ def self.openapi_nullable
82
+ Set.new([
83
+ :product_id,
84
+ :product_data
85
+ ])
86
+ end
87
+
88
+ # Initializes the object
89
+ # @param [Hash] attributes Model attributes in the form of hash
90
+ def initialize(attributes = {})
91
+ if (!attributes.is_a?(Hash))
92
+ raise ArgumentError, "The input argument (attributes) must be a hash in `PAYJPv2::PriceDataRequest` initialize method"
93
+ end
94
+
95
+ # check to see if the attribute exists and convert string to symbol for hash key
96
+ acceptable_attribute_map = self.class.acceptable_attribute_map
97
+ attributes = attributes.each_with_object({}) { |(k, v), h|
98
+ if (!acceptable_attribute_map.key?(k.to_sym))
99
+ raise ArgumentError, "`#{k}` is not a valid attribute in `PAYJPv2::PriceDataRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
100
+ end
101
+ h[k.to_sym] = v
102
+ }
103
+
104
+ if attributes.key?(:currency)
105
+ self.currency = attributes[:currency]
106
+ else
107
+ self.currency = nil
108
+ end
109
+
110
+ if attributes.key?(:unit_amount)
111
+ self.unit_amount = attributes[:unit_amount]
112
+ else
113
+ self.unit_amount = nil
114
+ end
115
+
116
+ if attributes.key?(:product_id)
117
+ self.product_id = attributes[:product_id]
118
+ end
119
+
120
+ if attributes.key?(:product_data)
121
+ self.product_data = attributes[:product_data]
122
+ end
123
+ end
124
+
125
+ # Custom attribute writer method with validation
126
+ # @param [Object] currency Value to be assigned
127
+ def currency=(currency)
128
+ if currency.nil?
129
+ raise ArgumentError, 'currency cannot be nil'
130
+ end
131
+
132
+ @currency = currency
133
+ end
134
+
135
+ # Custom attribute writer method with validation
136
+ # @param [Object] unit_amount Value to be assigned
137
+ def unit_amount=(unit_amount)
138
+ if unit_amount.nil?
139
+ raise ArgumentError, 'unit_amount cannot be nil'
140
+ end
141
+
142
+ if unit_amount < 0
143
+ raise ArgumentError, 'invalid value for "unit_amount", must be greater than or equal to 0.'
144
+ end
145
+
146
+ @unit_amount = unit_amount
147
+ end
148
+
149
+ # Checks equality by comparing each attribute.
150
+ # @param [Object] Object to be compared
151
+ def ==(o)
152
+ return true if self.equal?(o)
153
+ self.class == o.class &&
154
+ currency == o.currency &&
155
+ unit_amount == o.unit_amount &&
156
+ product_id == o.product_id &&
157
+ product_data == o.product_data
158
+ end
159
+
160
+ # @see the `==` method
161
+ # @param [Object] Object to be compared
162
+ def eql?(o)
163
+ self == o
164
+ end
165
+
166
+ # Calculates hash code according to all attributes.
167
+ # @return [Integer] Hash code
168
+ def hash
169
+ [currency, unit_amount, product_id, product_data].hash
170
+ end
171
+
172
+ # Builds the object from hash
173
+ # @param [Hash] attributes Model attributes in the form of hash
174
+ # @return [Object] Returns the model itself
175
+ def self.build_from_hash(attributes)
176
+ return nil unless attributes.is_a?(Hash)
177
+ attributes = attributes.transform_keys(&:to_sym)
178
+ transformed_hash = {}
179
+ openapi_types.each_pair do |key, type|
180
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
181
+ transformed_hash["#{key}"] = nil
182
+ elsif type =~ /\AArray<(.*)>/i
183
+ # check to ensure the input is an array given that the attribute
184
+ # is documented as an array but the input is not
185
+ if attributes[attribute_map[key]].is_a?(Array)
186
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
187
+ end
188
+ elsif !attributes[attribute_map[key]].nil?
189
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
190
+ end
191
+ end
192
+ new(transformed_hash)
193
+ end
194
+
195
+ # Deserializes the data based on type
196
+ # @param string type Data type
197
+ # @param string value Value to be deserialized
198
+ # @return [Object] Deserialized data
199
+ def self._deserialize(type, value)
200
+ case type.to_sym
201
+ when :Time
202
+ Time.parse(value)
203
+ when :Date
204
+ Date.parse(value)
205
+ when :String
206
+ value.to_s
207
+ when :Integer
208
+ value.to_i
209
+ when :Float
210
+ value.to_f
211
+ when :Boolean
212
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
213
+ true
214
+ else
215
+ false
216
+ end
217
+ when :Object
218
+ # generic object (usually a Hash), return directly
219
+ value
220
+ when /\AArray<(?<inner_type>.+)>\z/
221
+ inner_type = Regexp.last_match[:inner_type]
222
+ value.map { |v| _deserialize(inner_type, v) }
223
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
224
+ k_type = Regexp.last_match[:k_type]
225
+ v_type = Regexp.last_match[:v_type]
226
+ {}.tap do |hash|
227
+ value.each do |k, v|
228
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
229
+ end
230
+ end
231
+ else # model
232
+ # models (e.g. Pet) or oneOf
233
+ klass = PAYJPv2.const_get(type)
234
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
235
+ end
236
+ end
237
+
238
+ # Returns the string representation of the object
239
+ # @return [String] String presentation of the object
240
+ def to_s
241
+ to_hash.to_s
242
+ end
243
+
244
+ # to_body is an alias to to_hash (backward compatibility)
245
+ # @return [Hash] Returns the object in the form of hash
246
+ def to_body
247
+ to_hash
248
+ end
249
+
250
+ # Returns the object in the form of hash
251
+ # @return [Hash] Returns the object in the form of hash
252
+ def to_hash
253
+ hash = {}
254
+ self.class.attribute_map.each_pair do |attr, param|
255
+ value = self.send(attr)
256
+ if value.nil?
257
+ is_nullable = self.class.openapi_nullable.include?(attr)
258
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
259
+ end
260
+
261
+ hash[param] = _to_hash(value)
262
+ end
263
+ hash
264
+ end
265
+
266
+ # Outputs non-array value in the form of hash
267
+ # For object, use to_hash. Otherwise, just return the value
268
+ # @param [Object] value Any valid value
269
+ # @return [Hash] Returns the value in the form of hash
270
+ def _to_hash(value)
271
+ if value.is_a?(Array)
272
+ value.compact.map { |v| _to_hash(v) }
273
+ elsif value.is_a?(Hash)
274
+ {}.tap do |hash|
275
+ value.each { |k, v| hash[k] = _to_hash(v) }
276
+ end
277
+ elsif value.respond_to? :to_hash
278
+ value.to_hash
279
+ else
280
+ value
281
+ end
282
+ end
283
+
284
+ end
285
+
286
+ end
@@ -0,0 +1,228 @@
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 ProductDataRequest
18
+ # Checkout などで顧客に表示される商品名
19
+ attr_accessor :name
20
+
21
+ attr_accessor :description
22
+
23
+ # Attribute mapping from ruby-style variable name to JSON key.
24
+ def self.attribute_map
25
+ {
26
+ :name => :name,
27
+ :description => :description
28
+ }
29
+ end
30
+
31
+ # Returns attribute mapping this model knows about
32
+ def self.acceptable_attribute_map
33
+ attribute_map
34
+ end
35
+
36
+ # Returns all the JSON keys this model knows about
37
+ def self.acceptable_attributes
38
+ acceptable_attribute_map.values
39
+ end
40
+
41
+ # Attribute type mapping.
42
+ def self.openapi_types
43
+ {
44
+ :name => :'String',
45
+ :description => :'String'
46
+ }
47
+ end
48
+
49
+ # List of attributes with nullable: true
50
+ def self.openapi_nullable
51
+ Set.new([
52
+ :description
53
+ ])
54
+ end
55
+
56
+ # Initializes the object
57
+ # @param [Hash] attributes Model attributes in the form of hash
58
+ def initialize(attributes = {})
59
+ if (!attributes.is_a?(Hash))
60
+ raise ArgumentError, "The input argument (attributes) must be a hash in `PAYJPv2::ProductDataRequest` initialize method"
61
+ end
62
+
63
+ # check to see if the attribute exists and convert string to symbol for hash key
64
+ acceptable_attribute_map = self.class.acceptable_attribute_map
65
+ attributes = attributes.each_with_object({}) { |(k, v), h|
66
+ if (!acceptable_attribute_map.key?(k.to_sym))
67
+ raise ArgumentError, "`#{k}` is not a valid attribute in `PAYJPv2::ProductDataRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
68
+ end
69
+ h[k.to_sym] = v
70
+ }
71
+
72
+ if attributes.key?(:name)
73
+ self.name = attributes[:name]
74
+ else
75
+ self.name = nil
76
+ end
77
+
78
+ if attributes.key?(:description)
79
+ self.description = attributes[:description]
80
+ end
81
+ end
82
+
83
+ # Custom attribute writer method with validation
84
+ # @param [Object] name Value to be assigned
85
+ def name=(name)
86
+ if name.nil?
87
+ raise ArgumentError, 'name cannot be nil'
88
+ end
89
+
90
+ @name = name
91
+ end
92
+
93
+ # Checks equality by comparing each attribute.
94
+ # @param [Object] Object to be compared
95
+ def ==(o)
96
+ return true if self.equal?(o)
97
+ self.class == o.class &&
98
+ name == o.name &&
99
+ description == o.description
100
+ end
101
+
102
+ # @see the `==` method
103
+ # @param [Object] Object to be compared
104
+ def eql?(o)
105
+ self == o
106
+ end
107
+
108
+ # Calculates hash code according to all attributes.
109
+ # @return [Integer] Hash code
110
+ def hash
111
+ [name, description].hash
112
+ end
113
+
114
+ # Builds the object from hash
115
+ # @param [Hash] attributes Model attributes in the form of hash
116
+ # @return [Object] Returns the model itself
117
+ def self.build_from_hash(attributes)
118
+ return nil unless attributes.is_a?(Hash)
119
+ attributes = attributes.transform_keys(&:to_sym)
120
+ transformed_hash = {}
121
+ openapi_types.each_pair do |key, type|
122
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
123
+ transformed_hash["#{key}"] = nil
124
+ elsif type =~ /\AArray<(.*)>/i
125
+ # check to ensure the input is an array given that the attribute
126
+ # is documented as an array but the input is not
127
+ if attributes[attribute_map[key]].is_a?(Array)
128
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
129
+ end
130
+ elsif !attributes[attribute_map[key]].nil?
131
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
132
+ end
133
+ end
134
+ new(transformed_hash)
135
+ end
136
+
137
+ # Deserializes the data based on type
138
+ # @param string type Data type
139
+ # @param string value Value to be deserialized
140
+ # @return [Object] Deserialized data
141
+ def self._deserialize(type, value)
142
+ case type.to_sym
143
+ when :Time
144
+ Time.parse(value)
145
+ when :Date
146
+ Date.parse(value)
147
+ when :String
148
+ value.to_s
149
+ when :Integer
150
+ value.to_i
151
+ when :Float
152
+ value.to_f
153
+ when :Boolean
154
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
155
+ true
156
+ else
157
+ false
158
+ end
159
+ when :Object
160
+ # generic object (usually a Hash), return directly
161
+ value
162
+ when /\AArray<(?<inner_type>.+)>\z/
163
+ inner_type = Regexp.last_match[:inner_type]
164
+ value.map { |v| _deserialize(inner_type, v) }
165
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
166
+ k_type = Regexp.last_match[:k_type]
167
+ v_type = Regexp.last_match[:v_type]
168
+ {}.tap do |hash|
169
+ value.each do |k, v|
170
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
171
+ end
172
+ end
173
+ else # model
174
+ # models (e.g. Pet) or oneOf
175
+ klass = PAYJPv2.const_get(type)
176
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
177
+ end
178
+ end
179
+
180
+ # Returns the string representation of the object
181
+ # @return [String] String presentation of the object
182
+ def to_s
183
+ to_hash.to_s
184
+ end
185
+
186
+ # to_body is an alias to to_hash (backward compatibility)
187
+ # @return [Hash] Returns the object in the form of hash
188
+ def to_body
189
+ to_hash
190
+ end
191
+
192
+ # Returns the object in the form of hash
193
+ # @return [Hash] Returns the object in the form of hash
194
+ def to_hash
195
+ hash = {}
196
+ self.class.attribute_map.each_pair do |attr, param|
197
+ value = self.send(attr)
198
+ if value.nil?
199
+ is_nullable = self.class.openapi_nullable.include?(attr)
200
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
201
+ end
202
+
203
+ hash[param] = _to_hash(value)
204
+ end
205
+ hash
206
+ end
207
+
208
+ # Outputs non-array value in the form of hash
209
+ # For object, use to_hash. Otherwise, just return the value
210
+ # @param [Object] value Any valid value
211
+ # @return [Hash] Returns the value in the form of hash
212
+ def _to_hash(value)
213
+ if value.is_a?(Array)
214
+ value.compact.map { |v| _to_hash(v) }
215
+ elsif value.is_a?(Hash)
216
+ {}.tap do |hash|
217
+ value.each { |k, v| hash[k] = _to_hash(v) }
218
+ end
219
+ elsif value.respond_to? :to_hash
220
+ value.to_hash
221
+ else
222
+ value
223
+ end
224
+ end
225
+
226
+ end
227
+
228
+ end
@@ -11,5 +11,5 @@ Generator version: 7.14.0
11
11
  =end
12
12
 
13
13
  module PAYJPv2
14
- VERSION = '1.0.10'
14
+ VERSION = '1.1.0'
15
15
  end
data/lib/payjpv2.rb CHANGED
@@ -106,11 +106,13 @@ require 'payjpv2/models/payment_transaction_list_response'
106
106
  require 'payjpv2/models/payment_transaction_response'
107
107
  require 'payjpv2/models/payment_transaction_type'
108
108
  require 'payjpv2/models/price_create_request'
109
+ require 'payjpv2/models/price_data_request'
109
110
  require 'payjpv2/models/price_details_response'
110
111
  require 'payjpv2/models/price_list_response'
111
112
  require 'payjpv2/models/price_type'
112
113
  require 'payjpv2/models/price_update_request'
113
114
  require 'payjpv2/models/product_create_request'
115
+ require 'payjpv2/models/product_data_request'
114
116
  require 'payjpv2/models/product_deleted_response'
115
117
  require 'payjpv2/models/product_details_response'
116
118
  require 'payjpv2/models/product_list_response'
@@ -0,0 +1,107 @@
1
+ =begin
2
+ PaymentMethodResponse のような anyOf module が API client の convert_to_type 経由で
3
+ 正しくデシリアライズされることを確認するスペック。
4
+
5
+ 過去、 templates/ruby/api_client.mustache の convert_to_type は openapi_one_of だけを
6
+ チェックして openapi_any_of を見ていなかったため、 Pydantic の RootModel + Union から
7
+ 生成された anyOf module に対して build_from_hash を呼んでしまい
8
+ ``NoMethodError: undefined method 'build_from_hash' for module PAYJPv2::PaymentMethodResponse``
9
+ が発生していた。
10
+
11
+ 加えて partial_anyof_module.mustache (および partial_oneof_module.mustache) の
12
+ find_and_cast_into_type は data.keys (string, from JSON.parse) を
13
+ acceptable_attributes (symbol) と直接比較していたため、常に raise → rescue → nil で
14
+ build 自体も機能していなかった。
15
+
16
+ 両者を修正した後の挙動を回帰テストとして固定する。
17
+ =end
18
+
19
+ require 'spec_helper'
20
+
21
+ describe 'anyOf module deserialization via ApiClient#convert_to_type' do
22
+ let(:api_client) { PAYJPv2::ApiClient.new }
23
+
24
+ let(:card_payload) do
25
+ {
26
+ 'object' => 'payment_method',
27
+ 'id' => 'pm_test_card',
28
+ 'livemode' => false,
29
+ 'type' => 'card',
30
+ 'customer_id' => 'cus_test',
31
+ 'detached_at' => nil,
32
+ 'metadata' => {},
33
+ 'created_at' => '2026-01-01T00:00:00Z',
34
+ 'updated_at' => '2026-01-01T00:00:00Z',
35
+ 'billing_details' => {
36
+ 'name' => 'PAY TARO',
37
+ 'phone' => '09012345678',
38
+ 'email' => 'test@example.com',
39
+ 'address' => {
40
+ 'country' => 'JP',
41
+ 'zip' => '1000001',
42
+ 'state' => 'Tokyo',
43
+ 'city' => 'Chiyoda',
44
+ 'line1' => '1-1-1',
45
+ 'line2' => nil
46
+ }
47
+ },
48
+ 'card' => {
49
+ 'last4' => '4242',
50
+ 'brand' => 'visa',
51
+ 'exp_month' => 12,
52
+ 'exp_year' => 2030,
53
+ 'fingerprint' => 'fp_test',
54
+ 'country' => 'JP'
55
+ }
56
+ }
57
+ end
58
+
59
+ let(:paypay_payload) do
60
+ {
61
+ 'object' => 'payment_method',
62
+ 'id' => 'pm_test_paypay',
63
+ 'livemode' => false,
64
+ 'type' => 'paypay',
65
+ 'customer_id' => 'cus_test',
66
+ 'detached_at' => nil,
67
+ 'metadata' => {},
68
+ 'created_at' => '2026-01-01T00:00:00Z',
69
+ 'updated_at' => '2026-01-01T00:00:00Z',
70
+ 'billing_details' => {
71
+ 'name' => 'PAY TARO',
72
+ 'phone' => '09012345678',
73
+ 'email' => 'test@example.com',
74
+ 'address' => {
75
+ 'country' => 'JP',
76
+ 'zip' => '1000001',
77
+ 'state' => 'Tokyo',
78
+ 'city' => 'Chiyoda',
79
+ 'line1' => '1-1-1',
80
+ 'line2' => nil
81
+ }
82
+ }
83
+ }
84
+ end
85
+
86
+ it 'PaymentMethodResponse が anyOf module として生成されていること' do
87
+ expect(PAYJPv2::PaymentMethodResponse).to be_a(Module)
88
+ expect(PAYJPv2::PaymentMethodResponse).to respond_to(:openapi_any_of)
89
+ expect(PAYJPv2::PaymentMethodResponse).to respond_to(:build)
90
+ expect(PAYJPv2::PaymentMethodResponse).not_to respond_to(:build_from_hash)
91
+ end
92
+
93
+ it 'card 型のレスポンスを convert_to_type で PaymentMethodCardResponse に解決できること' do
94
+ result = api_client.send(:convert_to_type, card_payload, 'PaymentMethodResponse')
95
+ expect(result).to be_a(PAYJPv2::PaymentMethodCardResponse)
96
+ expect(result.id).to eq('pm_test_card')
97
+ expect(result.type).to eq('card')
98
+ expect(result.card.last4).to eq('4242')
99
+ end
100
+
101
+ it 'paypay 型のレスポンスを convert_to_type で PaymentMethodPayPayResponse に解決できること' do
102
+ result = api_client.send(:convert_to_type, paypay_payload, 'PaymentMethodResponse')
103
+ expect(result).to be_a(PAYJPv2::PaymentMethodPayPayResponse)
104
+ expect(result.id).to eq('pm_test_paypay')
105
+ expect(result.type).to eq('paypay')
106
+ end
107
+ end
@@ -0,0 +1,137 @@
1
+ =begin
2
+ 加盟店から報告された事象の回帰テスト。
3
+
4
+ pm_api = PAYJPv2::PaymentMethodsApi.new
5
+ pm_api.detach_payment_method(payment_method_id)
6
+ # => NoMethodError: undefined method 'build_from_hash' for module PAYJPv2::PaymentMethodResponse
7
+
8
+ がテンプレート修正後は起きないこと、および返り値が想定どおりの
9
+ 具体クラス (PaymentMethodCardResponse / PaymentMethodPayPayResponse) で
10
+ 返ってくることを呼び出し経路全体で保証する。
11
+
12
+ anyof_deserialization_spec.rb は ApiClient#convert_to_type を直接叩いており
13
+ バグの根因の単体検証だが、本 spec は加盟店が書いたコード経路そのものを
14
+ Typhoeus stub 経由で再現する。
15
+ =end
16
+
17
+ require 'spec_helper'
18
+
19
+ describe 'PAYJPv2::PaymentMethodsApi#detach_payment_method (regression for anyOf build_from_hash)' do
20
+ let(:payment_method_id) { 'pm_test_card' }
21
+
22
+ let(:detached_card_response_body) do
23
+ {
24
+ 'object' => 'payment_method',
25
+ 'id' => payment_method_id,
26
+ 'livemode' => false,
27
+ 'type' => 'card',
28
+ 'customer_id' => 'cus_test',
29
+ 'detached_at' => '2026-05-13T15:00:00Z',
30
+ 'metadata' => {},
31
+ 'created_at' => '2026-01-01T00:00:00Z',
32
+ 'updated_at' => '2026-05-13T15:00:00Z',
33
+ 'billing_details' => {
34
+ 'name' => 'PAY TARO',
35
+ 'phone' => '09012345678',
36
+ 'email' => 'test@example.com',
37
+ 'address' => {
38
+ 'country' => 'JP',
39
+ 'zip' => '1000001',
40
+ 'state' => 'Tokyo',
41
+ 'city' => 'Chiyoda',
42
+ 'line1' => '1-1-1',
43
+ 'line2' => nil
44
+ }
45
+ },
46
+ 'card' => {
47
+ 'last4' => '4242',
48
+ 'brand' => 'visa',
49
+ 'exp_month' => 12,
50
+ 'exp_year' => 2030,
51
+ 'fingerprint' => 'fp_test',
52
+ 'country' => 'JP'
53
+ }
54
+ }
55
+ end
56
+
57
+ let(:detached_paypay_response_body) do
58
+ {
59
+ 'object' => 'payment_method',
60
+ 'id' => 'pm_test_paypay',
61
+ 'livemode' => false,
62
+ 'type' => 'paypay',
63
+ 'customer_id' => 'cus_test',
64
+ 'detached_at' => '2026-05-13T15:00:00Z',
65
+ 'metadata' => {},
66
+ 'created_at' => '2026-01-01T00:00:00Z',
67
+ 'updated_at' => '2026-05-13T15:00:00Z',
68
+ 'billing_details' => {
69
+ 'name' => 'PAY TARO',
70
+ 'phone' => '09012345678',
71
+ 'email' => 'test@example.com',
72
+ 'address' => {
73
+ 'country' => 'JP',
74
+ 'zip' => '1000001',
75
+ 'state' => 'Tokyo',
76
+ 'city' => 'Chiyoda',
77
+ 'line1' => '1-1-1',
78
+ 'line2' => nil
79
+ }
80
+ }
81
+ }
82
+ end
83
+
84
+ before do
85
+ PAYJPv2.configure do |c|
86
+ c.host = 'api.pay.jp'
87
+ c.access_token = 'sk_test_dummy'
88
+ end
89
+ Typhoeus::Expectation.clear
90
+ end
91
+
92
+ after do
93
+ Typhoeus::Expectation.clear
94
+ end
95
+
96
+ it 'card 型の detach レスポンスを PaymentMethodCardResponse で受け取れる' do
97
+ Typhoeus.stub(/payment_methods\/#{payment_method_id}\/detach/).and_return(
98
+ Typhoeus::Response.new(
99
+ code: 200,
100
+ headers: { 'Content-Type' => 'application/json' },
101
+ body: detached_card_response_body.to_json
102
+ )
103
+ )
104
+
105
+ pm_api = PAYJPv2::PaymentMethodsApi.new
106
+
107
+ expect { pm_api.detach_payment_method(payment_method_id) }.not_to raise_error
108
+
109
+ result = pm_api.detach_payment_method(payment_method_id)
110
+ expect(result).to be_a(PAYJPv2::PaymentMethodCardResponse)
111
+ expect(result.id).to eq(payment_method_id)
112
+ expect(result.type).to eq('card')
113
+ expect(result.detached_at).not_to be_nil
114
+ expect(result.card.last4).to eq('4242')
115
+ end
116
+
117
+ it 'paypay 型の detach レスポンスを PaymentMethodPayPayResponse で受け取れる' do
118
+ paypay_id = 'pm_test_paypay'
119
+ Typhoeus.stub(/payment_methods\/#{paypay_id}\/detach/).and_return(
120
+ Typhoeus::Response.new(
121
+ code: 200,
122
+ headers: { 'Content-Type' => 'application/json' },
123
+ body: detached_paypay_response_body.to_json
124
+ )
125
+ )
126
+
127
+ pm_api = PAYJPv2::PaymentMethodsApi.new
128
+
129
+ expect { pm_api.detach_payment_method(paypay_id) }.not_to raise_error
130
+
131
+ result = pm_api.detach_payment_method(paypay_id)
132
+ expect(result).to be_a(PAYJPv2::PaymentMethodPayPayResponse)
133
+ expect(result.id).to eq(paypay_id)
134
+ expect(result.type).to eq('paypay')
135
+ expect(result.detached_at).not_to be_nil
136
+ end
137
+ end
@@ -33,6 +33,12 @@ describe PAYJPv2::LineItemRequest do
33
33
  end
34
34
  end
35
35
 
36
+ describe 'test attribute "price_data"' do
37
+ it 'should work' do
38
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
39
+ end
40
+ end
41
+
36
42
  describe 'test attribute "quantity"' do
37
43
  it 'should work' do
38
44
  # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
@@ -0,0 +1,54 @@
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 'spec_helper'
14
+ require 'json'
15
+ require 'date'
16
+
17
+ # Unit tests for PAYJPv2::PriceDataRequest
18
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
19
+ # Please update as you see appropriate
20
+ describe PAYJPv2::PriceDataRequest do
21
+ let(:instance) { PAYJPv2::PriceDataRequest.new }
22
+
23
+ describe 'test an instance of PriceDataRequest' do
24
+ it 'should create an instance of PriceDataRequest' do
25
+ # uncomment below to test the instance creation
26
+ #expect(instance).to be_instance_of(PAYJPv2::PriceDataRequest)
27
+ end
28
+ end
29
+
30
+ describe 'test attribute "currency"' do
31
+ it 'should work' do
32
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
33
+ end
34
+ end
35
+
36
+ describe 'test attribute "unit_amount"' do
37
+ it 'should work' do
38
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
39
+ end
40
+ end
41
+
42
+ describe 'test attribute "product_id"' do
43
+ it 'should work' do
44
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
45
+ end
46
+ end
47
+
48
+ describe 'test attribute "product_data"' do
49
+ it 'should work' do
50
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
51
+ end
52
+ end
53
+
54
+ 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 'spec_helper'
14
+ require 'json'
15
+ require 'date'
16
+
17
+ # Unit tests for PAYJPv2::ProductDataRequest
18
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
19
+ # Please update as you see appropriate
20
+ describe PAYJPv2::ProductDataRequest do
21
+ let(:instance) { PAYJPv2::ProductDataRequest.new }
22
+
23
+ describe 'test an instance of ProductDataRequest' do
24
+ it 'should create an instance of ProductDataRequest' do
25
+ # uncomment below to test the instance creation
26
+ #expect(instance).to be_instance_of(PAYJPv2::ProductDataRequest)
27
+ end
28
+ end
29
+
30
+ describe 'test attribute "name"' do
31
+ it 'should work' do
32
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
33
+ end
34
+ end
35
+
36
+ describe 'test attribute "description"' do
37
+ it 'should work' do
38
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
39
+ end
40
+ end
41
+
42
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: payjpv2
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.10
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - PAY.JP
@@ -164,12 +164,14 @@ files:
164
164
  - docs/PaymentTransactionType.md
165
165
  - docs/PaymentTransactionsApi.md
166
166
  - docs/PriceCreateRequest.md
167
+ - docs/PriceDataRequest.md
167
168
  - docs/PriceDetailsResponse.md
168
169
  - docs/PriceListResponse.md
169
170
  - docs/PriceType.md
170
171
  - docs/PriceUpdateRequest.md
171
172
  - docs/PricesApi.md
172
173
  - docs/ProductCreateRequest.md
174
+ - docs/ProductDataRequest.md
173
175
  - docs/ProductDeletedResponse.md
174
176
  - docs/ProductDetailsResponse.md
175
177
  - docs/ProductListResponse.md
@@ -312,11 +314,13 @@ files:
312
314
  - lib/payjpv2/models/payment_transaction_response.rb
313
315
  - lib/payjpv2/models/payment_transaction_type.rb
314
316
  - lib/payjpv2/models/price_create_request.rb
317
+ - lib/payjpv2/models/price_data_request.rb
315
318
  - lib/payjpv2/models/price_details_response.rb
316
319
  - lib/payjpv2/models/price_list_response.rb
317
320
  - lib/payjpv2/models/price_type.rb
318
321
  - lib/payjpv2/models/price_update_request.rb
319
322
  - lib/payjpv2/models/product_create_request.rb
323
+ - lib/payjpv2/models/product_data_request.rb
320
324
  - lib/payjpv2/models/product_deleted_response.rb
321
325
  - lib/payjpv2/models/product_details_response.rb
322
326
  - lib/payjpv2/models/product_list_response.rb
@@ -362,6 +366,8 @@ files:
362
366
  - spec/api/statements_api_spec.rb
363
367
  - spec/api/tax_rates_api_spec.rb
364
368
  - spec/api/terms_api_spec.rb
369
+ - spec/integration/anyof_deserialization_spec.rb
370
+ - spec/integration/payment_methods_api_detach_spec.rb
365
371
  - spec/models/apple_pay_config_request_spec.rb
366
372
  - spec/models/balance_list_response_spec.rb
367
373
  - spec/models/balance_response_spec.rb
@@ -451,11 +457,13 @@ files:
451
457
  - spec/models/payment_transaction_response_spec.rb
452
458
  - spec/models/payment_transaction_type_spec.rb
453
459
  - spec/models/price_create_request_spec.rb
460
+ - spec/models/price_data_request_spec.rb
454
461
  - spec/models/price_details_response_spec.rb
455
462
  - spec/models/price_list_response_spec.rb
456
463
  - spec/models/price_type_spec.rb
457
464
  - spec/models/price_update_request_spec.rb
458
465
  - spec/models/product_create_request_spec.rb
466
+ - spec/models/product_data_request_spec.rb
459
467
  - spec/models/product_deleted_response_spec.rb
460
468
  - spec/models/product_details_response_spec.rb
461
469
  - spec/models/product_list_response_spec.rb
@@ -527,6 +535,8 @@ test_files:
527
535
  - spec/api/statements_api_spec.rb
528
536
  - spec/api/tax_rates_api_spec.rb
529
537
  - spec/api/terms_api_spec.rb
538
+ - spec/integration/anyof_deserialization_spec.rb
539
+ - spec/integration/payment_methods_api_detach_spec.rb
530
540
  - spec/models/apple_pay_config_request_spec.rb
531
541
  - spec/models/balance_list_response_spec.rb
532
542
  - spec/models/balance_response_spec.rb
@@ -616,11 +626,13 @@ test_files:
616
626
  - spec/models/payment_transaction_response_spec.rb
617
627
  - spec/models/payment_transaction_type_spec.rb
618
628
  - spec/models/price_create_request_spec.rb
629
+ - spec/models/price_data_request_spec.rb
619
630
  - spec/models/price_details_response_spec.rb
620
631
  - spec/models/price_list_response_spec.rb
621
632
  - spec/models/price_type_spec.rb
622
633
  - spec/models/price_update_request_spec.rb
623
634
  - spec/models/product_create_request_spec.rb
635
+ - spec/models/product_data_request_spec.rb
624
636
  - spec/models/product_deleted_response_spec.rb
625
637
  - spec/models/product_details_response_spec.rb
626
638
  - spec/models/product_list_response_spec.rb