jamm 2.0.0 → 2.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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/jamm/api/api/payment_api.rb +70 -70
- data/lib/jamm/api/models/v1_buyer.rb +1 -1
- data/lib/jamm/api/models/v1_charge.rb +1 -1
- data/lib/jamm/api/models/v1_charge_error.rb +226 -0
- data/lib/jamm/api/models/v1_charge_message.rb +58 -4
- data/lib/jamm/api/models/v1_charge_message_status.rb +2 -1
- data/lib/jamm/api/models/v1_charge_result.rb +13 -4
- data/lib/jamm/api/models/v1_event_type.rb +3 -2
- data/lib/jamm/api/models/v1_initial_charge.rb +12 -2
- data/lib/jamm/api/models/v1_message_response.rb +13 -4
- data/lib/jamm/api/models/v1_refund_info.rb +275 -0
- data/lib/jamm/api/models/v1_refund_request.rb +15 -5
- data/lib/jamm/api.rb +2 -0
- data/lib/jamm/version.rb +1 -1
- data/lib/jamm/webhook.rb +5 -1
- metadata +4 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b9d9cfa81304a829a1d016ff3a4d2e53fe2b15caf2fa6c4e8513161b16881dff
|
|
4
|
+
data.tar.gz: 9f1ffda9436127fa5101cbff162f8ac24f52a8b151ade3c7691a39e9144e52aa
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8af376c181770bbc2fb93c1002ca29493fde1c6cdf4227475a1ce891fd82d83c073774c7296c67e911ae064d55fa8314fb8550d390dbe9b991d56167ca30e95a
|
|
7
|
+
data.tar.gz: 6c8c4ca5abb8f6b4bcc0d94ab15441bfa1ca572e000a4358072bccf340e8493776c7791b6fcb4d798e0dd647ceac2db9c1937720aebcde971d132825f576328b
|
data/Gemfile.lock
CHANGED
|
@@ -87,6 +87,74 @@ module Api
|
|
|
87
87
|
return data, status_code, headers
|
|
88
88
|
end
|
|
89
89
|
|
|
90
|
+
# Initiate async off-session payment
|
|
91
|
+
# Starts asynchronous off-session payment processing and returns request tracking information.
|
|
92
|
+
# @param body [OffSessionPaymentAsyncRequest] This message represents a request to process an off-session payment asynchronously. It contains the customer ID and the amount to charge.
|
|
93
|
+
# @param [Hash] opts the optional parameters
|
|
94
|
+
# @return [OffSessionPaymentAsyncResponse]
|
|
95
|
+
def async_off_session_payment(body, opts = {})
|
|
96
|
+
data, _status_code, _headers = async_off_session_payment_with_http_info(body, opts)
|
|
97
|
+
data
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
# Initiate async off-session payment
|
|
101
|
+
# Starts asynchronous off-session payment processing and returns request tracking information.
|
|
102
|
+
# @param body [OffSessionPaymentAsyncRequest] This message represents a request to process an off-session payment asynchronously. It contains the customer ID and the amount to charge.
|
|
103
|
+
# @param [Hash] opts the optional parameters
|
|
104
|
+
# @return [Array<(OffSessionPaymentAsyncResponse, Integer, Hash)>] OffSessionPaymentAsyncResponse data, response status code and response headers
|
|
105
|
+
def async_off_session_payment_with_http_info(body, opts = {})
|
|
106
|
+
if @api_client.config.debugging
|
|
107
|
+
@api_client.config.logger.debug 'Calling API: PaymentApi.async_off_session_payment ...'
|
|
108
|
+
end
|
|
109
|
+
# verify the required parameter 'body' is set
|
|
110
|
+
if @api_client.config.client_side_validation && body.nil?
|
|
111
|
+
fail ArgumentError, "Missing the required parameter 'body' when calling PaymentApi.async_off_session_payment"
|
|
112
|
+
end
|
|
113
|
+
# resource path
|
|
114
|
+
local_var_path = '/v1/payments/off-session/async'
|
|
115
|
+
|
|
116
|
+
# query parameters
|
|
117
|
+
query_params = opts[:query_params] || {}
|
|
118
|
+
|
|
119
|
+
# header parameters
|
|
120
|
+
header_params = opts[:header_params] || {}
|
|
121
|
+
# HTTP header 'Accept' (if needed)
|
|
122
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
123
|
+
# HTTP header 'Content-Type'
|
|
124
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
125
|
+
if !content_type.nil?
|
|
126
|
+
header_params['Content-Type'] = content_type
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
# form parameters
|
|
130
|
+
form_params = opts[:form_params] || {}
|
|
131
|
+
|
|
132
|
+
# http body (model)
|
|
133
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
|
|
134
|
+
|
|
135
|
+
# return_type
|
|
136
|
+
return_type = opts[:debug_return_type] || 'OffSessionPaymentAsyncResponse'
|
|
137
|
+
|
|
138
|
+
# auth_names
|
|
139
|
+
auth_names = opts[:debug_auth_names] || []
|
|
140
|
+
|
|
141
|
+
new_options = opts.merge(
|
|
142
|
+
:operation => :"PaymentApi.async_off_session_payment",
|
|
143
|
+
:header_params => header_params,
|
|
144
|
+
:query_params => query_params,
|
|
145
|
+
:form_params => form_params,
|
|
146
|
+
:body => post_body,
|
|
147
|
+
:auth_names => auth_names,
|
|
148
|
+
:return_type => return_type
|
|
149
|
+
)
|
|
150
|
+
|
|
151
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
152
|
+
if @api_client.config.debugging
|
|
153
|
+
@api_client.config.logger.debug "API called: PaymentApi#async_off_session_payment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
154
|
+
end
|
|
155
|
+
return data, status_code, headers
|
|
156
|
+
end
|
|
157
|
+
|
|
90
158
|
# Create a contract with initial charge
|
|
91
159
|
# Create a contract with initial charge
|
|
92
160
|
# @param body [CreateContractWithChargeRequest] Request message for creating a new contract with an immediate initial charge. This combines contract creation and charging in a single operation.
|
|
@@ -559,74 +627,6 @@ module Api
|
|
|
559
627
|
return data, status_code, headers
|
|
560
628
|
end
|
|
561
629
|
|
|
562
|
-
# Initiate async off-session payment
|
|
563
|
-
# Starts asynchronous off-session payment processing and returns request tracking information.
|
|
564
|
-
# @param body [OffSessionPaymentAsyncRequest] This message represents a request to process an off-session payment asynchronously. It contains the customer ID and the amount to charge.
|
|
565
|
-
# @param [Hash] opts the optional parameters
|
|
566
|
-
# @return [OffSessionPaymentAsyncResponse]
|
|
567
|
-
def off_session_payment_async(body, opts = {})
|
|
568
|
-
data, _status_code, _headers = off_session_payment_async_with_http_info(body, opts)
|
|
569
|
-
data
|
|
570
|
-
end
|
|
571
|
-
|
|
572
|
-
# Initiate async off-session payment
|
|
573
|
-
# Starts asynchronous off-session payment processing and returns request tracking information.
|
|
574
|
-
# @param body [OffSessionPaymentAsyncRequest] This message represents a request to process an off-session payment asynchronously. It contains the customer ID and the amount to charge.
|
|
575
|
-
# @param [Hash] opts the optional parameters
|
|
576
|
-
# @return [Array<(OffSessionPaymentAsyncResponse, Integer, Hash)>] OffSessionPaymentAsyncResponse data, response status code and response headers
|
|
577
|
-
def off_session_payment_async_with_http_info(body, opts = {})
|
|
578
|
-
if @api_client.config.debugging
|
|
579
|
-
@api_client.config.logger.debug 'Calling API: PaymentApi.off_session_payment_async ...'
|
|
580
|
-
end
|
|
581
|
-
# verify the required parameter 'body' is set
|
|
582
|
-
if @api_client.config.client_side_validation && body.nil?
|
|
583
|
-
fail ArgumentError, "Missing the required parameter 'body' when calling PaymentApi.off_session_payment_async"
|
|
584
|
-
end
|
|
585
|
-
# resource path
|
|
586
|
-
local_var_path = '/v1/payments/off-session/async'
|
|
587
|
-
|
|
588
|
-
# query parameters
|
|
589
|
-
query_params = opts[:query_params] || {}
|
|
590
|
-
|
|
591
|
-
# header parameters
|
|
592
|
-
header_params = opts[:header_params] || {}
|
|
593
|
-
# HTTP header 'Accept' (if needed)
|
|
594
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
595
|
-
# HTTP header 'Content-Type'
|
|
596
|
-
content_type = @api_client.select_header_content_type(['application/json'])
|
|
597
|
-
if !content_type.nil?
|
|
598
|
-
header_params['Content-Type'] = content_type
|
|
599
|
-
end
|
|
600
|
-
|
|
601
|
-
# form parameters
|
|
602
|
-
form_params = opts[:form_params] || {}
|
|
603
|
-
|
|
604
|
-
# http body (model)
|
|
605
|
-
post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
|
|
606
|
-
|
|
607
|
-
# return_type
|
|
608
|
-
return_type = opts[:debug_return_type] || 'OffSessionPaymentAsyncResponse'
|
|
609
|
-
|
|
610
|
-
# auth_names
|
|
611
|
-
auth_names = opts[:debug_auth_names] || []
|
|
612
|
-
|
|
613
|
-
new_options = opts.merge(
|
|
614
|
-
:operation => :"PaymentApi.off_session_payment_async",
|
|
615
|
-
:header_params => header_params,
|
|
616
|
-
:query_params => query_params,
|
|
617
|
-
:form_params => form_params,
|
|
618
|
-
:body => post_body,
|
|
619
|
-
:auth_names => auth_names,
|
|
620
|
-
:return_type => return_type
|
|
621
|
-
)
|
|
622
|
-
|
|
623
|
-
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
624
|
-
if @api_client.config.debugging
|
|
625
|
-
@api_client.config.logger.debug "API called: PaymentApi#off_session_payment_async\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
626
|
-
end
|
|
627
|
-
return data, status_code, headers
|
|
628
|
-
end
|
|
629
|
-
|
|
630
630
|
# Process payment with optional redirect
|
|
631
631
|
# Unified interface for creating payments - supports existing customers, new customers with charges, and contract-only creation.
|
|
632
632
|
# @param body [OnSessionPaymentRequest] Request message for the unified payment interface. The system intelligently routes the request to the appropriate payment method based on the provided parameters.
|
|
@@ -697,7 +697,7 @@ module Api
|
|
|
697
697
|
|
|
698
698
|
# Refund a charge
|
|
699
699
|
# Refunds a charge. If the same-day cancellation window has not passed, cancels the charge directly. Otherwise, creates a bank transfer refund request.
|
|
700
|
-
# @param body [RefundRequest] Request message for refunding a charge. The refund is always processed asynchronously. The final result is delivered via webhook (`
|
|
700
|
+
# @param body [RefundRequest] Request message for refunding a charge. The refund is always processed asynchronously. The final result is delivered via webhook (`refund_succeeded`).
|
|
701
701
|
# @param [Hash] opts the optional parameters
|
|
702
702
|
# @return [RefundResponse]
|
|
703
703
|
def refund(body, opts = {})
|
|
@@ -707,7 +707,7 @@ module Api
|
|
|
707
707
|
|
|
708
708
|
# Refund a charge
|
|
709
709
|
# Refunds a charge. If the same-day cancellation window has not passed, cancels the charge directly. Otherwise, creates a bank transfer refund request.
|
|
710
|
-
# @param body [RefundRequest] Request message for refunding a charge. The refund is always processed asynchronously. The final result is delivered via webhook (`
|
|
710
|
+
# @param body [RefundRequest] Request message for refunding a charge. The refund is always processed asynchronously. The final result is delivered via webhook (`refund_succeeded`).
|
|
711
711
|
# @param [Hash] opts the optional parameters
|
|
712
712
|
# @return [Array<(RefundResponse, Integer, Hash)>] RefundResponse data, response status code and response headers
|
|
713
713
|
def refund_with_http_info(body, opts = {})
|
|
@@ -22,7 +22,7 @@ module Api
|
|
|
22
22
|
# A flag whether Jamm to force KYC for the customer. 初回購入時に購入者に対してKYCを強制するかどうかのフラグです。
|
|
23
23
|
attr_accessor :force_kyc
|
|
24
24
|
|
|
25
|
-
# Phone number of the customer. You can update this value later through the UpdateCustomer endpoint. e.g. - 09012345678 Customerの電話番号。 この値は UpdateCustomer エンドポイントを通じて後で更新できます。
|
|
25
|
+
# Phone number of the customer. You can update this value later through the UpdateCustomer endpoint. Accepts Japanese phone numbers (10-11 digits). Note that only mobile numbers (070/080/090) will be stored; non-mobile numbers are silently ignored. e.g. - 09012345678 (mobile) - 08012345678 (mobile) - 07012345678 (mobile) - 05012345678 (IP phone, not stored) - 0312345678 (landline, not stored) Customerの電話番号。 この値は UpdateCustomer エンドポイントを通じて後で更新できます。 携帯電話番号(070/080/090)のみ保存され、それ以外の番号は無視されます。
|
|
26
26
|
attr_accessor :phone
|
|
27
27
|
|
|
28
28
|
# Name of the customer. You can update this value later through the UpdateCustomer endpoint. e.g. - John Appleseed - 山田太郎 購入者の氏名。 この値は UpdateCustomer エンドポイントを通じて後で更新できます。
|
|
@@ -22,7 +22,7 @@ module Api
|
|
|
22
22
|
# Amount of the charge in Japanese Yen. The amount must be the total price of the product/service including tax. 決済金額。日本円で指定してください。 金額は商品/サービスの合計金額 (税込) を指定してください。 @gotags: validate:\"gte=1,lte=500000\"
|
|
23
23
|
attr_accessor :price
|
|
24
24
|
|
|
25
|
-
# Description is an arbitrary string for merchant to track the charge. This information is displayed on Merchant Dashboard. 決済の説明。ショップが決済を追跡するための任意の文字列です。 @gotags: validate:\"required\"
|
|
25
|
+
# Description is an arbitrary string for merchant to track the charge. This information is displayed on Merchant Dashboard. 決済の説明。ショップが決済を追跡するための任意の文字列です。 @gotags: validate:\"required,max=1024\"
|
|
26
26
|
attr_accessor :description
|
|
27
27
|
|
|
28
28
|
# Arbitrary key-value additional information about the charge. You can see this information in our merchant dashboard. Chargeに関する任意のキーと値の追加情報。 加盟店ダッシュボードで確認できます。
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Jamm API
|
|
3
|
+
|
|
4
|
+
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.9.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module Api
|
|
17
|
+
# Contains error details for a failed charge.
|
|
18
|
+
class ChargeError
|
|
19
|
+
# Jamm defined error code (e.g. \"ERROR_TYPE_PAYMENT_CHARGE_OVER_LIMIT\").
|
|
20
|
+
attr_accessor :code
|
|
21
|
+
|
|
22
|
+
# Human readable error message.
|
|
23
|
+
attr_accessor :message
|
|
24
|
+
|
|
25
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
26
|
+
def self.attribute_map
|
|
27
|
+
{
|
|
28
|
+
:'code' => :'code',
|
|
29
|
+
:'message' => :'message'
|
|
30
|
+
}
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# Returns all the JSON keys this model knows about
|
|
34
|
+
def self.acceptable_attributes
|
|
35
|
+
attribute_map.values
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
# Attribute type mapping.
|
|
39
|
+
def self.openapi_types
|
|
40
|
+
{
|
|
41
|
+
:'code' => :'String',
|
|
42
|
+
:'message' => :'String'
|
|
43
|
+
}
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
# List of attributes with nullable: true
|
|
47
|
+
def self.openapi_nullable
|
|
48
|
+
Set.new([
|
|
49
|
+
])
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
# Initializes the object
|
|
53
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
54
|
+
def initialize(attributes = {})
|
|
55
|
+
if (!attributes.is_a?(Hash))
|
|
56
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Api::ChargeError` initialize method"
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
60
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
61
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
62
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Api::ChargeError`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
63
|
+
end
|
|
64
|
+
h[k.to_sym] = v
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
if attributes.key?(:'code')
|
|
68
|
+
self.code = attributes[:'code']
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
if attributes.key?(:'message')
|
|
72
|
+
self.message = attributes[:'message']
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
77
|
+
# @return Array for valid properties with the reasons
|
|
78
|
+
def list_invalid_properties
|
|
79
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
80
|
+
invalid_properties = Array.new
|
|
81
|
+
invalid_properties
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
# Check to see if the all the properties in the model are valid
|
|
85
|
+
# @return true if the model is valid
|
|
86
|
+
def valid?
|
|
87
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
88
|
+
true
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
# Checks equality by comparing each attribute.
|
|
92
|
+
# @param [Object] Object to be compared
|
|
93
|
+
def ==(o)
|
|
94
|
+
return true if self.equal?(o)
|
|
95
|
+
self.class == o.class &&
|
|
96
|
+
code == o.code &&
|
|
97
|
+
message == o.message
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
# @see the `==` method
|
|
101
|
+
# @param [Object] Object to be compared
|
|
102
|
+
def eql?(o)
|
|
103
|
+
self == o
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
# Calculates hash code according to all attributes.
|
|
107
|
+
# @return [Integer] Hash code
|
|
108
|
+
def hash
|
|
109
|
+
[code, message].hash
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
# Builds the object from hash
|
|
113
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
114
|
+
# @return [Object] Returns the model itself
|
|
115
|
+
def self.build_from_hash(attributes)
|
|
116
|
+
return nil unless attributes.is_a?(Hash)
|
|
117
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
118
|
+
transformed_hash = {}
|
|
119
|
+
openapi_types.each_pair do |key, type|
|
|
120
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
121
|
+
transformed_hash["#{key}"] = nil
|
|
122
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
123
|
+
# check to ensure the input is an array given that the attribute
|
|
124
|
+
# is documented as an array but the input is not
|
|
125
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
126
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
127
|
+
end
|
|
128
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
129
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
130
|
+
end
|
|
131
|
+
end
|
|
132
|
+
new(transformed_hash)
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
# Deserializes the data based on type
|
|
136
|
+
# @param string type Data type
|
|
137
|
+
# @param string value Value to be deserialized
|
|
138
|
+
# @return [Object] Deserialized data
|
|
139
|
+
def self._deserialize(type, value)
|
|
140
|
+
case type.to_sym
|
|
141
|
+
when :Time
|
|
142
|
+
Time.parse(value)
|
|
143
|
+
when :Date
|
|
144
|
+
Date.parse(value)
|
|
145
|
+
when :String
|
|
146
|
+
value.to_s
|
|
147
|
+
when :Integer
|
|
148
|
+
value.to_i
|
|
149
|
+
when :Float
|
|
150
|
+
value.to_f
|
|
151
|
+
when :Boolean
|
|
152
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
153
|
+
true
|
|
154
|
+
else
|
|
155
|
+
false
|
|
156
|
+
end
|
|
157
|
+
when :Object
|
|
158
|
+
# generic object (usually a Hash), return directly
|
|
159
|
+
value
|
|
160
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
161
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
162
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
163
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
164
|
+
k_type = Regexp.last_match[:k_type]
|
|
165
|
+
v_type = Regexp.last_match[:v_type]
|
|
166
|
+
{}.tap do |hash|
|
|
167
|
+
value.each do |k, v|
|
|
168
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
169
|
+
end
|
|
170
|
+
end
|
|
171
|
+
else # model
|
|
172
|
+
# models (e.g. Pet) or oneOf
|
|
173
|
+
klass = Api.const_get(type)
|
|
174
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
175
|
+
end
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
# Returns the string representation of the object
|
|
179
|
+
# @return [String] String presentation of the object
|
|
180
|
+
def to_s
|
|
181
|
+
to_hash.to_s
|
|
182
|
+
end
|
|
183
|
+
|
|
184
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
185
|
+
# @return [Hash] Returns the object in the form of hash
|
|
186
|
+
def to_body
|
|
187
|
+
to_hash
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
# Returns the object in the form of hash
|
|
191
|
+
# @return [Hash] Returns the object in the form of hash
|
|
192
|
+
def to_hash
|
|
193
|
+
hash = {}
|
|
194
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
195
|
+
value = self.send(attr)
|
|
196
|
+
if value.nil?
|
|
197
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
198
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
199
|
+
end
|
|
200
|
+
|
|
201
|
+
hash[param] = _to_hash(value)
|
|
202
|
+
end
|
|
203
|
+
hash
|
|
204
|
+
end
|
|
205
|
+
|
|
206
|
+
# Outputs non-array value in the form of hash
|
|
207
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
208
|
+
# @param [Object] value Any valid value
|
|
209
|
+
# @return [Hash] Returns the value in the form of hash
|
|
210
|
+
def _to_hash(value)
|
|
211
|
+
if value.is_a?(Array)
|
|
212
|
+
value.compact.map { |v| _to_hash(v) }
|
|
213
|
+
elsif value.is_a?(Hash)
|
|
214
|
+
{}.tap do |hash|
|
|
215
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
216
|
+
end
|
|
217
|
+
elsif value.respond_to? :to_hash
|
|
218
|
+
value.to_hash
|
|
219
|
+
else
|
|
220
|
+
value
|
|
221
|
+
end
|
|
222
|
+
end
|
|
223
|
+
|
|
224
|
+
end
|
|
225
|
+
|
|
226
|
+
end
|
|
@@ -25,24 +25,43 @@ module Api
|
|
|
25
25
|
|
|
26
26
|
attr_accessor :merchant_name
|
|
27
27
|
|
|
28
|
+
# Original charge amount before discount and before any refund is applied.
|
|
28
29
|
attr_accessor :initial_amount
|
|
29
30
|
|
|
31
|
+
# Discount amount deducted from the original charge amount.
|
|
30
32
|
attr_accessor :discount
|
|
31
33
|
|
|
34
|
+
# Final charge amount after discount, before any refund is applied.
|
|
32
35
|
attr_accessor :final_amount
|
|
33
36
|
|
|
37
|
+
# Total amount refunded for this charge when the charge has been refunded.
|
|
34
38
|
attr_accessor :amount_refunded
|
|
35
39
|
|
|
36
40
|
attr_accessor :currency
|
|
37
41
|
|
|
42
|
+
# Timestamp when the charge or refund outcome was completed.
|
|
38
43
|
attr_accessor :processed_at
|
|
39
44
|
|
|
45
|
+
# Jamm fee associated with this refund event (refund uses refund fee; cancel uses 0).
|
|
46
|
+
attr_accessor :jamm_fee
|
|
47
|
+
|
|
40
48
|
attr_accessor :created_at
|
|
41
49
|
|
|
42
50
|
attr_accessor :updated_at
|
|
43
51
|
|
|
52
|
+
# Whether the original transaction's Jamm fee was waived (same-day cancel) or not (refund). Values: \"waived\", \"not_waived\".
|
|
53
|
+
attr_accessor :original_transaction_jamm_fee
|
|
54
|
+
|
|
55
|
+
# Consumption tax (10% of the Jamm fee).
|
|
56
|
+
attr_accessor :consumption_tax
|
|
57
|
+
|
|
44
58
|
attr_accessor :error
|
|
45
59
|
|
|
60
|
+
# External refund identifier (rfd-*) for refund/refund-failed webhooks.
|
|
61
|
+
attr_accessor :refund_id
|
|
62
|
+
|
|
63
|
+
attr_accessor :refund
|
|
64
|
+
|
|
46
65
|
class EnumAttributeValidator
|
|
47
66
|
attr_reader :datatype
|
|
48
67
|
attr_reader :allowable_values
|
|
@@ -79,9 +98,14 @@ module Api
|
|
|
79
98
|
:'amount_refunded' => :'amountRefunded',
|
|
80
99
|
:'currency' => :'currency',
|
|
81
100
|
:'processed_at' => :'processedAt',
|
|
101
|
+
:'jamm_fee' => :'jammFee',
|
|
82
102
|
:'created_at' => :'createdAt',
|
|
83
103
|
:'updated_at' => :'updatedAt',
|
|
84
|
-
:'
|
|
104
|
+
:'original_transaction_jamm_fee' => :'originalTransactionJammFee',
|
|
105
|
+
:'consumption_tax' => :'consumptionTax',
|
|
106
|
+
:'error' => :'error',
|
|
107
|
+
:'refund_id' => :'refundId',
|
|
108
|
+
:'refund' => :'refund'
|
|
85
109
|
}
|
|
86
110
|
end
|
|
87
111
|
|
|
@@ -104,9 +128,14 @@ module Api
|
|
|
104
128
|
:'amount_refunded' => :'Integer',
|
|
105
129
|
:'currency' => :'String',
|
|
106
130
|
:'processed_at' => :'String',
|
|
131
|
+
:'jamm_fee' => :'Integer',
|
|
107
132
|
:'created_at' => :'String',
|
|
108
133
|
:'updated_at' => :'String',
|
|
109
|
-
:'
|
|
134
|
+
:'original_transaction_jamm_fee' => :'String',
|
|
135
|
+
:'consumption_tax' => :'Integer',
|
|
136
|
+
:'error' => :'Apiv1Error',
|
|
137
|
+
:'refund_id' => :'String',
|
|
138
|
+
:'refund' => :'RefundInfo'
|
|
110
139
|
}
|
|
111
140
|
end
|
|
112
141
|
|
|
@@ -177,6 +206,10 @@ module Api
|
|
|
177
206
|
self.processed_at = attributes[:'processed_at']
|
|
178
207
|
end
|
|
179
208
|
|
|
209
|
+
if attributes.key?(:'jamm_fee')
|
|
210
|
+
self.jamm_fee = attributes[:'jamm_fee']
|
|
211
|
+
end
|
|
212
|
+
|
|
180
213
|
if attributes.key?(:'created_at')
|
|
181
214
|
self.created_at = attributes[:'created_at']
|
|
182
215
|
end
|
|
@@ -185,9 +218,25 @@ module Api
|
|
|
185
218
|
self.updated_at = attributes[:'updated_at']
|
|
186
219
|
end
|
|
187
220
|
|
|
221
|
+
if attributes.key?(:'original_transaction_jamm_fee')
|
|
222
|
+
self.original_transaction_jamm_fee = attributes[:'original_transaction_jamm_fee']
|
|
223
|
+
end
|
|
224
|
+
|
|
225
|
+
if attributes.key?(:'consumption_tax')
|
|
226
|
+
self.consumption_tax = attributes[:'consumption_tax']
|
|
227
|
+
end
|
|
228
|
+
|
|
188
229
|
if attributes.key?(:'error')
|
|
189
230
|
self.error = attributes[:'error']
|
|
190
231
|
end
|
|
232
|
+
|
|
233
|
+
if attributes.key?(:'refund_id')
|
|
234
|
+
self.refund_id = attributes[:'refund_id']
|
|
235
|
+
end
|
|
236
|
+
|
|
237
|
+
if attributes.key?(:'refund')
|
|
238
|
+
self.refund = attributes[:'refund']
|
|
239
|
+
end
|
|
191
240
|
end
|
|
192
241
|
|
|
193
242
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -221,9 +270,14 @@ module Api
|
|
|
221
270
|
amount_refunded == o.amount_refunded &&
|
|
222
271
|
currency == o.currency &&
|
|
223
272
|
processed_at == o.processed_at &&
|
|
273
|
+
jamm_fee == o.jamm_fee &&
|
|
224
274
|
created_at == o.created_at &&
|
|
225
275
|
updated_at == o.updated_at &&
|
|
226
|
-
|
|
276
|
+
original_transaction_jamm_fee == o.original_transaction_jamm_fee &&
|
|
277
|
+
consumption_tax == o.consumption_tax &&
|
|
278
|
+
error == o.error &&
|
|
279
|
+
refund_id == o.refund_id &&
|
|
280
|
+
refund == o.refund
|
|
227
281
|
end
|
|
228
282
|
|
|
229
283
|
# @see the `==` method
|
|
@@ -235,7 +289,7 @@ module Api
|
|
|
235
289
|
# Calculates hash code according to all attributes.
|
|
236
290
|
# @return [Integer] Hash code
|
|
237
291
|
def hash
|
|
238
|
-
[id, customer, status, description, merchant_name, initial_amount, discount, final_amount, amount_refunded, currency, processed_at, created_at, updated_at, error].hash
|
|
292
|
+
[id, customer, status, description, merchant_name, initial_amount, discount, final_amount, amount_refunded, currency, processed_at, jamm_fee, created_at, updated_at, original_transaction_jamm_fee, consumption_tax, error, refund_id, refund].hash
|
|
239
293
|
end
|
|
240
294
|
|
|
241
295
|
# Builds the object from hash
|
|
@@ -21,9 +21,10 @@ module Api
|
|
|
21
21
|
WAITING_EKYC = "STATUS_WAITING_EKYC".freeze
|
|
22
22
|
BLOCKING = "STATUS_BLOCKING".freeze
|
|
23
23
|
CANCELLED = "STATUS_CANCELLED".freeze
|
|
24
|
+
REFUNDED = "STATUS_REFUNDED".freeze
|
|
24
25
|
|
|
25
26
|
def self.all_vars
|
|
26
|
-
@all_vars ||= [UNSPECIFIED, SUCCESS, FAILURE, WAITING_EKYC, BLOCKING, CANCELLED].freeze
|
|
27
|
+
@all_vars ||= [UNSPECIFIED, SUCCESS, FAILURE, WAITING_EKYC, BLOCKING, CANCELLED, REFUNDED].freeze
|
|
27
28
|
end
|
|
28
29
|
|
|
29
30
|
# Builds the enum from string
|
|
@@ -50,6 +50,8 @@ module Api
|
|
|
50
50
|
|
|
51
51
|
attr_accessor :charge_status
|
|
52
52
|
|
|
53
|
+
attr_accessor :error
|
|
54
|
+
|
|
53
55
|
class EnumAttributeValidator
|
|
54
56
|
attr_reader :datatype
|
|
55
57
|
attr_reader :allowable_values
|
|
@@ -90,7 +92,8 @@ module Api
|
|
|
90
92
|
:'created_at' => :'createdAt',
|
|
91
93
|
:'updated_at' => :'updatedAt',
|
|
92
94
|
:'processed_at' => :'processedAt',
|
|
93
|
-
:'charge_status' => :'chargeStatus'
|
|
95
|
+
:'charge_status' => :'chargeStatus',
|
|
96
|
+
:'error' => :'error'
|
|
94
97
|
}
|
|
95
98
|
end
|
|
96
99
|
|
|
@@ -117,7 +120,8 @@ module Api
|
|
|
117
120
|
:'created_at' => :'Time',
|
|
118
121
|
:'updated_at' => :'Time',
|
|
119
122
|
:'processed_at' => :'Time',
|
|
120
|
-
:'charge_status' => :'ChargeStatus'
|
|
123
|
+
:'charge_status' => :'ChargeStatus',
|
|
124
|
+
:'error' => :'ChargeError'
|
|
121
125
|
}
|
|
122
126
|
end
|
|
123
127
|
|
|
@@ -209,6 +213,10 @@ module Api
|
|
|
209
213
|
else
|
|
210
214
|
self.charge_status = 'CHARGE_STATUS_UNSPECIFIED'
|
|
211
215
|
end
|
|
216
|
+
|
|
217
|
+
if attributes.key?(:'error')
|
|
218
|
+
self.error = attributes[:'error']
|
|
219
|
+
end
|
|
212
220
|
end
|
|
213
221
|
|
|
214
222
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -246,7 +254,8 @@ module Api
|
|
|
246
254
|
created_at == o.created_at &&
|
|
247
255
|
updated_at == o.updated_at &&
|
|
248
256
|
processed_at == o.processed_at &&
|
|
249
|
-
charge_status == o.charge_status
|
|
257
|
+
charge_status == o.charge_status &&
|
|
258
|
+
error == o.error
|
|
250
259
|
end
|
|
251
260
|
|
|
252
261
|
# @see the `==` method
|
|
@@ -258,7 +267,7 @@ module Api
|
|
|
258
267
|
# Calculates hash code according to all attributes.
|
|
259
268
|
# @return [Integer] Hash code
|
|
260
269
|
def hash
|
|
261
|
-
[charge_id, paid, reason, description, merchant_name, initial_amount, discount, final_amount, amount_refunded, currency, token_id, metadata, created_at, updated_at, processed_at, charge_status].hash
|
|
270
|
+
[charge_id, paid, reason, description, merchant_name, initial_amount, discount, final_amount, amount_refunded, currency, token_id, metadata, created_at, updated_at, processed_at, charge_status, error].hash
|
|
262
271
|
end
|
|
263
272
|
|
|
264
273
|
# Builds the object from hash
|
|
@@ -20,13 +20,14 @@ module Api
|
|
|
20
20
|
CHARGE_UPDATED = "EVENT_TYPE_CHARGE_UPDATED".freeze
|
|
21
21
|
CHARGE_SUCCESS = "EVENT_TYPE_CHARGE_SUCCESS".freeze
|
|
22
22
|
CHARGE_FAIL = "EVENT_TYPE_CHARGE_FAIL".freeze
|
|
23
|
-
|
|
23
|
+
REFUND_SUCCEEDED = "EVENT_TYPE_REFUND_SUCCEEDED".freeze
|
|
24
|
+
REFUND_FAILED = "EVENT_TYPE_REFUND_FAILED".freeze
|
|
24
25
|
CONTRACT_ACTIVATED = "EVENT_TYPE_CONTRACT_ACTIVATED".freeze
|
|
25
26
|
USER_ACCOUNT_DELETED = "EVENT_TYPE_USER_ACCOUNT_DELETED".freeze
|
|
26
27
|
TESTING = "EVENT_TYPE_TESTING".freeze
|
|
27
28
|
|
|
28
29
|
def self.all_vars
|
|
29
|
-
@all_vars ||= [UNSPECIFIED, CHARGE_CREATED, CHARGE_UPDATED, CHARGE_SUCCESS, CHARGE_FAIL,
|
|
30
|
+
@all_vars ||= [UNSPECIFIED, CHARGE_CREATED, CHARGE_UPDATED, CHARGE_SUCCESS, CHARGE_FAIL, REFUND_SUCCEEDED, REFUND_FAILED, CONTRACT_ACTIVATED, USER_ACCOUNT_DELETED, TESTING].freeze
|
|
30
31
|
end
|
|
31
32
|
|
|
32
33
|
# Builds the enum from string
|
|
@@ -19,12 +19,15 @@ module Api
|
|
|
19
19
|
# Amount of the charge in Japanese Yen. The amount must be the total price of the product/service including tax. 決済金額。日本円で指定してください。 金額は商品/サービスの合計金額 (税込) を指定してください。 @gotags: validate:\"gte=1,lte=500000\"
|
|
20
20
|
attr_accessor :price
|
|
21
21
|
|
|
22
|
-
# Description is an arbitrary string for merchant to track the charge. This information is displayed on Merchant Dashboard. 決済の説明。ショップが決済を追跡するための任意の文字列です。 @gotags: validate:\"required\"
|
|
22
|
+
# Description is an arbitrary string for merchant to track the charge. This information is displayed on Merchant Dashboard. 決済の説明。ショップが決済を追跡するための任意の文字列です。 @gotags: validate:\"required,max=1024\"
|
|
23
23
|
attr_accessor :description
|
|
24
24
|
|
|
25
25
|
# Arbitrary key-value additional information about the charge. You can see this information in our merchant dashboard. Chargeに関する任意のキーと値の追加情報。 加盟店ダッシュボードで確認できます。
|
|
26
26
|
attr_accessor :metadata
|
|
27
27
|
|
|
28
|
+
# Fee charged by the platform (in JPY). Must be >= the Jamm fee for the merchant. Only meaningful when the caller is a platform. Ignored for direct merchant calls. プラットフォームが徴収する手数料(日本円)。加盟店のJamm手数料以上である必要があります。
|
|
29
|
+
attr_accessor :platform_fee
|
|
30
|
+
|
|
28
31
|
# Merchant can optionally set the expiry date for the payment. Defaults to 90 minutes if not specified. 決済の有効期限。未指定の場合は90分後に自動失効します。
|
|
29
32
|
attr_accessor :expires_at
|
|
30
33
|
|
|
@@ -34,6 +37,7 @@ module Api
|
|
|
34
37
|
:'price' => :'price',
|
|
35
38
|
:'description' => :'description',
|
|
36
39
|
:'metadata' => :'metadata',
|
|
40
|
+
:'platform_fee' => :'platformFee',
|
|
37
41
|
:'expires_at' => :'expiresAt'
|
|
38
42
|
}
|
|
39
43
|
end
|
|
@@ -49,6 +53,7 @@ module Api
|
|
|
49
53
|
:'price' => :'Integer',
|
|
50
54
|
:'description' => :'String',
|
|
51
55
|
:'metadata' => :'Hash<String, String>',
|
|
56
|
+
:'platform_fee' => :'Integer',
|
|
52
57
|
:'expires_at' => :'Time'
|
|
53
58
|
}
|
|
54
59
|
end
|
|
@@ -88,6 +93,10 @@ module Api
|
|
|
88
93
|
end
|
|
89
94
|
end
|
|
90
95
|
|
|
96
|
+
if attributes.key?(:'platform_fee')
|
|
97
|
+
self.platform_fee = attributes[:'platform_fee']
|
|
98
|
+
end
|
|
99
|
+
|
|
91
100
|
if attributes.key?(:'expires_at')
|
|
92
101
|
self.expires_at = attributes[:'expires_at']
|
|
93
102
|
end
|
|
@@ -116,6 +125,7 @@ module Api
|
|
|
116
125
|
price == o.price &&
|
|
117
126
|
description == o.description &&
|
|
118
127
|
metadata == o.metadata &&
|
|
128
|
+
platform_fee == o.platform_fee &&
|
|
119
129
|
expires_at == o.expires_at
|
|
120
130
|
end
|
|
121
131
|
|
|
@@ -128,7 +138,7 @@ module Api
|
|
|
128
138
|
# Calculates hash code according to all attributes.
|
|
129
139
|
# @return [Integer] Hash code
|
|
130
140
|
def hash
|
|
131
|
-
[price, description, metadata, expires_at].hash
|
|
141
|
+
[price, description, metadata, platform_fee, expires_at].hash
|
|
132
142
|
end
|
|
133
143
|
|
|
134
144
|
# Builds the object from hash
|
|
@@ -23,13 +23,16 @@ module Api
|
|
|
23
23
|
|
|
24
24
|
attr_accessor :user_account_message
|
|
25
25
|
|
|
26
|
+
attr_accessor :refund_info
|
|
27
|
+
|
|
26
28
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
27
29
|
def self.attribute_map
|
|
28
30
|
{
|
|
29
31
|
:'merchant_webhook_message' => :'merchantWebhookMessage',
|
|
30
32
|
:'charge_message' => :'chargeMessage',
|
|
31
33
|
:'contract_message' => :'contractMessage',
|
|
32
|
-
:'user_account_message' => :'userAccountMessage'
|
|
34
|
+
:'user_account_message' => :'userAccountMessage',
|
|
35
|
+
:'refund_info' => :'refundInfo'
|
|
33
36
|
}
|
|
34
37
|
end
|
|
35
38
|
|
|
@@ -44,7 +47,8 @@ module Api
|
|
|
44
47
|
:'merchant_webhook_message' => :'MerchantWebhookMessage',
|
|
45
48
|
:'charge_message' => :'ChargeMessage',
|
|
46
49
|
:'contract_message' => :'ContractMessage',
|
|
47
|
-
:'user_account_message' => :'UserAccountMessage'
|
|
50
|
+
:'user_account_message' => :'UserAccountMessage',
|
|
51
|
+
:'refund_info' => :'RefundInfo'
|
|
48
52
|
}
|
|
49
53
|
end
|
|
50
54
|
|
|
@@ -84,6 +88,10 @@ module Api
|
|
|
84
88
|
if attributes.key?(:'user_account_message')
|
|
85
89
|
self.user_account_message = attributes[:'user_account_message']
|
|
86
90
|
end
|
|
91
|
+
|
|
92
|
+
if attributes.key?(:'refund_info')
|
|
93
|
+
self.refund_info = attributes[:'refund_info']
|
|
94
|
+
end
|
|
87
95
|
end
|
|
88
96
|
|
|
89
97
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -109,7 +117,8 @@ module Api
|
|
|
109
117
|
merchant_webhook_message == o.merchant_webhook_message &&
|
|
110
118
|
charge_message == o.charge_message &&
|
|
111
119
|
contract_message == o.contract_message &&
|
|
112
|
-
user_account_message == o.user_account_message
|
|
120
|
+
user_account_message == o.user_account_message &&
|
|
121
|
+
refund_info == o.refund_info
|
|
113
122
|
end
|
|
114
123
|
|
|
115
124
|
# @see the `==` method
|
|
@@ -121,7 +130,7 @@ module Api
|
|
|
121
130
|
# Calculates hash code according to all attributes.
|
|
122
131
|
# @return [Integer] Hash code
|
|
123
132
|
def hash
|
|
124
|
-
[merchant_webhook_message, charge_message, contract_message, user_account_message].hash
|
|
133
|
+
[merchant_webhook_message, charge_message, contract_message, user_account_message, refund_info].hash
|
|
125
134
|
end
|
|
126
135
|
|
|
127
136
|
# Builds the object from hash
|
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Jamm API
|
|
3
|
+
|
|
4
|
+
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.9.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module Api
|
|
17
|
+
# RefundInfo contains refund-specific details for refund and refund_failed webhook events.
|
|
18
|
+
class RefundInfo
|
|
19
|
+
# External refund identifier (rfd-*).
|
|
20
|
+
attr_accessor :refund_id
|
|
21
|
+
|
|
22
|
+
# Amount refunded for this event.
|
|
23
|
+
attr_accessor :amount_refunded
|
|
24
|
+
|
|
25
|
+
# Jamm fee for this refund event.
|
|
26
|
+
attr_accessor :jamm_fee
|
|
27
|
+
|
|
28
|
+
# Consumption tax (10% of the Jamm fee).
|
|
29
|
+
attr_accessor :consumption_tax
|
|
30
|
+
|
|
31
|
+
# Whether the original transaction's Jamm fee was waived (true for same-day cancel).
|
|
32
|
+
attr_accessor :original_transaction_fee_waived
|
|
33
|
+
|
|
34
|
+
attr_accessor :error
|
|
35
|
+
|
|
36
|
+
# When the refund was processed (not present on refund_failed events).
|
|
37
|
+
attr_accessor :processed_at
|
|
38
|
+
|
|
39
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
40
|
+
def self.attribute_map
|
|
41
|
+
{
|
|
42
|
+
:'refund_id' => :'refundId',
|
|
43
|
+
:'amount_refunded' => :'amountRefunded',
|
|
44
|
+
:'jamm_fee' => :'jammFee',
|
|
45
|
+
:'consumption_tax' => :'consumptionTax',
|
|
46
|
+
:'original_transaction_fee_waived' => :'originalTransactionFeeWaived',
|
|
47
|
+
:'error' => :'error',
|
|
48
|
+
:'processed_at' => :'processedAt'
|
|
49
|
+
}
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
# Returns all the JSON keys this model knows about
|
|
53
|
+
def self.acceptable_attributes
|
|
54
|
+
attribute_map.values
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# Attribute type mapping.
|
|
58
|
+
def self.openapi_types
|
|
59
|
+
{
|
|
60
|
+
:'refund_id' => :'String',
|
|
61
|
+
:'amount_refunded' => :'Integer',
|
|
62
|
+
:'jamm_fee' => :'Integer',
|
|
63
|
+
:'consumption_tax' => :'Integer',
|
|
64
|
+
:'original_transaction_fee_waived' => :'Boolean',
|
|
65
|
+
:'error' => :'Apiv1Error',
|
|
66
|
+
:'processed_at' => :'String'
|
|
67
|
+
}
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
# List of attributes with nullable: true
|
|
71
|
+
def self.openapi_nullable
|
|
72
|
+
Set.new([
|
|
73
|
+
])
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
# Initializes the object
|
|
77
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
78
|
+
def initialize(attributes = {})
|
|
79
|
+
if (!attributes.is_a?(Hash))
|
|
80
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Api::RefundInfo` initialize method"
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
84
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
85
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
86
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Api::RefundInfo`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
87
|
+
end
|
|
88
|
+
h[k.to_sym] = v
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
if attributes.key?(:'refund_id')
|
|
92
|
+
self.refund_id = attributes[:'refund_id']
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
if attributes.key?(:'amount_refunded')
|
|
96
|
+
self.amount_refunded = attributes[:'amount_refunded']
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
if attributes.key?(:'jamm_fee')
|
|
100
|
+
self.jamm_fee = attributes[:'jamm_fee']
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
if attributes.key?(:'consumption_tax')
|
|
104
|
+
self.consumption_tax = attributes[:'consumption_tax']
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
if attributes.key?(:'original_transaction_fee_waived')
|
|
108
|
+
self.original_transaction_fee_waived = attributes[:'original_transaction_fee_waived']
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
if attributes.key?(:'error')
|
|
112
|
+
self.error = attributes[:'error']
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
if attributes.key?(:'processed_at')
|
|
116
|
+
self.processed_at = attributes[:'processed_at']
|
|
117
|
+
end
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
121
|
+
# @return Array for valid properties with the reasons
|
|
122
|
+
def list_invalid_properties
|
|
123
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
124
|
+
invalid_properties = Array.new
|
|
125
|
+
invalid_properties
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
# Check to see if the all the properties in the model are valid
|
|
129
|
+
# @return true if the model is valid
|
|
130
|
+
def valid?
|
|
131
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
132
|
+
true
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
# Checks equality by comparing each attribute.
|
|
136
|
+
# @param [Object] Object to be compared
|
|
137
|
+
def ==(o)
|
|
138
|
+
return true if self.equal?(o)
|
|
139
|
+
self.class == o.class &&
|
|
140
|
+
refund_id == o.refund_id &&
|
|
141
|
+
amount_refunded == o.amount_refunded &&
|
|
142
|
+
jamm_fee == o.jamm_fee &&
|
|
143
|
+
consumption_tax == o.consumption_tax &&
|
|
144
|
+
original_transaction_fee_waived == o.original_transaction_fee_waived &&
|
|
145
|
+
error == o.error &&
|
|
146
|
+
processed_at == o.processed_at
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
# @see the `==` method
|
|
150
|
+
# @param [Object] Object to be compared
|
|
151
|
+
def eql?(o)
|
|
152
|
+
self == o
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
# Calculates hash code according to all attributes.
|
|
156
|
+
# @return [Integer] Hash code
|
|
157
|
+
def hash
|
|
158
|
+
[refund_id, amount_refunded, jamm_fee, consumption_tax, original_transaction_fee_waived, error, processed_at].hash
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
# Builds the object from hash
|
|
162
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
163
|
+
# @return [Object] Returns the model itself
|
|
164
|
+
def self.build_from_hash(attributes)
|
|
165
|
+
return nil unless attributes.is_a?(Hash)
|
|
166
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
167
|
+
transformed_hash = {}
|
|
168
|
+
openapi_types.each_pair do |key, type|
|
|
169
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
170
|
+
transformed_hash["#{key}"] = nil
|
|
171
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
172
|
+
# check to ensure the input is an array given that the attribute
|
|
173
|
+
# is documented as an array but the input is not
|
|
174
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
175
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
176
|
+
end
|
|
177
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
178
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
179
|
+
end
|
|
180
|
+
end
|
|
181
|
+
new(transformed_hash)
|
|
182
|
+
end
|
|
183
|
+
|
|
184
|
+
# Deserializes the data based on type
|
|
185
|
+
# @param string type Data type
|
|
186
|
+
# @param string value Value to be deserialized
|
|
187
|
+
# @return [Object] Deserialized data
|
|
188
|
+
def self._deserialize(type, value)
|
|
189
|
+
case type.to_sym
|
|
190
|
+
when :Time
|
|
191
|
+
Time.parse(value)
|
|
192
|
+
when :Date
|
|
193
|
+
Date.parse(value)
|
|
194
|
+
when :String
|
|
195
|
+
value.to_s
|
|
196
|
+
when :Integer
|
|
197
|
+
value.to_i
|
|
198
|
+
when :Float
|
|
199
|
+
value.to_f
|
|
200
|
+
when :Boolean
|
|
201
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
202
|
+
true
|
|
203
|
+
else
|
|
204
|
+
false
|
|
205
|
+
end
|
|
206
|
+
when :Object
|
|
207
|
+
# generic object (usually a Hash), return directly
|
|
208
|
+
value
|
|
209
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
210
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
211
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
212
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
213
|
+
k_type = Regexp.last_match[:k_type]
|
|
214
|
+
v_type = Regexp.last_match[:v_type]
|
|
215
|
+
{}.tap do |hash|
|
|
216
|
+
value.each do |k, v|
|
|
217
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
218
|
+
end
|
|
219
|
+
end
|
|
220
|
+
else # model
|
|
221
|
+
# models (e.g. Pet) or oneOf
|
|
222
|
+
klass = Api.const_get(type)
|
|
223
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
224
|
+
end
|
|
225
|
+
end
|
|
226
|
+
|
|
227
|
+
# Returns the string representation of the object
|
|
228
|
+
# @return [String] String presentation of the object
|
|
229
|
+
def to_s
|
|
230
|
+
to_hash.to_s
|
|
231
|
+
end
|
|
232
|
+
|
|
233
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
234
|
+
# @return [Hash] Returns the object in the form of hash
|
|
235
|
+
def to_body
|
|
236
|
+
to_hash
|
|
237
|
+
end
|
|
238
|
+
|
|
239
|
+
# Returns the object in the form of hash
|
|
240
|
+
# @return [Hash] Returns the object in the form of hash
|
|
241
|
+
def to_hash
|
|
242
|
+
hash = {}
|
|
243
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
244
|
+
value = self.send(attr)
|
|
245
|
+
if value.nil?
|
|
246
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
247
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
248
|
+
end
|
|
249
|
+
|
|
250
|
+
hash[param] = _to_hash(value)
|
|
251
|
+
end
|
|
252
|
+
hash
|
|
253
|
+
end
|
|
254
|
+
|
|
255
|
+
# Outputs non-array value in the form of hash
|
|
256
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
257
|
+
# @param [Object] value Any valid value
|
|
258
|
+
# @return [Hash] Returns the value in the form of hash
|
|
259
|
+
def _to_hash(value)
|
|
260
|
+
if value.is_a?(Array)
|
|
261
|
+
value.compact.map { |v| _to_hash(v) }
|
|
262
|
+
elsif value.is_a?(Hash)
|
|
263
|
+
{}.tap do |hash|
|
|
264
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
265
|
+
end
|
|
266
|
+
elsif value.respond_to? :to_hash
|
|
267
|
+
value.to_hash
|
|
268
|
+
else
|
|
269
|
+
value
|
|
270
|
+
end
|
|
271
|
+
end
|
|
272
|
+
|
|
273
|
+
end
|
|
274
|
+
|
|
275
|
+
end
|
|
@@ -14,7 +14,7 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module Api
|
|
17
|
-
# Request message for refunding a charge. The refund is always processed asynchronously. The final result is delivered via webhook (`
|
|
17
|
+
# Request message for refunding a charge. The refund is always processed asynchronously. The final result is delivered via webhook (`refund_succeeded`).
|
|
18
18
|
class RefundRequest
|
|
19
19
|
# The charge ID to refund. 返金する決済のID。 @gotags: validate:\"required\"
|
|
20
20
|
attr_accessor :charge_id
|
|
@@ -22,11 +22,15 @@ module Api
|
|
|
22
22
|
# Optional refund amount in JPY. If omitted, the full refundable amount is used. 返金金額(日本円)。 省略した場合、全額返金となります。
|
|
23
23
|
attr_accessor :amount
|
|
24
24
|
|
|
25
|
+
# When true, only attempts cancellation without falling back to bank transfer refund. Defaults to false (fallback enabled). trueの場合、キャンセルのみを試行し、銀行振込返金への フォールバックを行いません。デフォルトはfalse(フォールバック有効)。
|
|
26
|
+
attr_accessor :cancel_only
|
|
27
|
+
|
|
25
28
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
26
29
|
def self.attribute_map
|
|
27
30
|
{
|
|
28
31
|
:'charge_id' => :'chargeId',
|
|
29
|
-
:'amount' => :'amount'
|
|
32
|
+
:'amount' => :'amount',
|
|
33
|
+
:'cancel_only' => :'cancelOnly'
|
|
30
34
|
}
|
|
31
35
|
end
|
|
32
36
|
|
|
@@ -39,7 +43,8 @@ module Api
|
|
|
39
43
|
def self.openapi_types
|
|
40
44
|
{
|
|
41
45
|
:'charge_id' => :'String',
|
|
42
|
-
:'amount' => :'Integer'
|
|
46
|
+
:'amount' => :'Integer',
|
|
47
|
+
:'cancel_only' => :'Boolean'
|
|
43
48
|
}
|
|
44
49
|
end
|
|
45
50
|
|
|
@@ -71,6 +76,10 @@ module Api
|
|
|
71
76
|
if attributes.key?(:'amount')
|
|
72
77
|
self.amount = attributes[:'amount']
|
|
73
78
|
end
|
|
79
|
+
|
|
80
|
+
if attributes.key?(:'cancel_only')
|
|
81
|
+
self.cancel_only = attributes[:'cancel_only']
|
|
82
|
+
end
|
|
74
83
|
end
|
|
75
84
|
|
|
76
85
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -94,7 +103,8 @@ module Api
|
|
|
94
103
|
return true if self.equal?(o)
|
|
95
104
|
self.class == o.class &&
|
|
96
105
|
charge_id == o.charge_id &&
|
|
97
|
-
amount == o.amount
|
|
106
|
+
amount == o.amount &&
|
|
107
|
+
cancel_only == o.cancel_only
|
|
98
108
|
end
|
|
99
109
|
|
|
100
110
|
# @see the `==` method
|
|
@@ -106,7 +116,7 @@ module Api
|
|
|
106
116
|
# Calculates hash code according to all attributes.
|
|
107
117
|
# @return [Integer] Hash code
|
|
108
118
|
def hash
|
|
109
|
-
[charge_id, amount].hash
|
|
119
|
+
[charge_id, amount, cancel_only].hash
|
|
110
120
|
end
|
|
111
121
|
|
|
112
122
|
# Builds the object from hash
|
data/lib/jamm/api.rb
CHANGED
|
@@ -33,6 +33,7 @@ require 'jamm/api/models/v1_bank_quota'
|
|
|
33
33
|
require 'jamm/api/models/v1_bank_scheduled_maintenance_period'
|
|
34
34
|
require 'jamm/api/models/v1_buyer'
|
|
35
35
|
require 'jamm/api/models/v1_charge'
|
|
36
|
+
require 'jamm/api/models/v1_charge_error'
|
|
36
37
|
require 'jamm/api/models/v1_charge_message'
|
|
37
38
|
require 'jamm/api/models/v1_charge_message_status'
|
|
38
39
|
require 'jamm/api/models/v1_charge_result'
|
|
@@ -79,6 +80,7 @@ require 'jamm/api/models/v1_pagination'
|
|
|
79
80
|
require 'jamm/api/models/v1_payment_authorization_status'
|
|
80
81
|
require 'jamm/api/models/v1_payment_link'
|
|
81
82
|
require 'jamm/api/models/v1_ping_response'
|
|
83
|
+
require 'jamm/api/models/v1_refund_info'
|
|
82
84
|
require 'jamm/api/models/v1_refund_request'
|
|
83
85
|
require 'jamm/api/models/v1_refund_response'
|
|
84
86
|
require 'jamm/api/models/v1_search_banks_response'
|
data/lib/jamm/version.rb
CHANGED
data/lib/jamm/webhook.rb
CHANGED
|
@@ -22,7 +22,11 @@ module Jamm
|
|
|
22
22
|
out.content = Jamm::OpenAPI::ChargeMessage.new(json[:content])
|
|
23
23
|
return out
|
|
24
24
|
|
|
25
|
-
when Jamm::OpenAPI::EventType::
|
|
25
|
+
when Jamm::OpenAPI::EventType::REFUND_SUCCEEDED
|
|
26
|
+
out.content = Jamm::OpenAPI::ChargeMessage.new(json[:content])
|
|
27
|
+
return out
|
|
28
|
+
|
|
29
|
+
when Jamm::OpenAPI::EventType::REFUND_FAILED
|
|
26
30
|
out.content = Jamm::OpenAPI::ChargeMessage.new(json[:content])
|
|
27
31
|
return out
|
|
28
32
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: jamm
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.
|
|
4
|
+
version: 2.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Jamm
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-04-06 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rest-client
|
|
@@ -83,6 +83,7 @@ files:
|
|
|
83
83
|
- lib/jamm/api/models/v1_bank_scheduled_maintenance_period.rb
|
|
84
84
|
- lib/jamm/api/models/v1_buyer.rb
|
|
85
85
|
- lib/jamm/api/models/v1_charge.rb
|
|
86
|
+
- lib/jamm/api/models/v1_charge_error.rb
|
|
86
87
|
- lib/jamm/api/models/v1_charge_message.rb
|
|
87
88
|
- lib/jamm/api/models/v1_charge_message_status.rb
|
|
88
89
|
- lib/jamm/api/models/v1_charge_result.rb
|
|
@@ -129,6 +130,7 @@ files:
|
|
|
129
130
|
- lib/jamm/api/models/v1_payment_authorization_status.rb
|
|
130
131
|
- lib/jamm/api/models/v1_payment_link.rb
|
|
131
132
|
- lib/jamm/api/models/v1_ping_response.rb
|
|
133
|
+
- lib/jamm/api/models/v1_refund_info.rb
|
|
132
134
|
- lib/jamm/api/models/v1_refund_request.rb
|
|
133
135
|
- lib/jamm/api/models/v1_refund_response.rb
|
|
134
136
|
- lib/jamm/api/models/v1_search_banks_response.rb
|