jamm 1.7.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 +136 -0
- 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 +46 -4
- data/lib/jamm/api/models/v1_charge_status.rb +46 -0
- 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_off_session_payment_async_request.rb +224 -0
- data/lib/jamm/api/models/v1_off_session_payment_async_response.rb +257 -0
- data/lib/jamm/api/models/v1_refund_info.rb +275 -0
- data/lib/jamm/api/models/v1_refund_request.rb +236 -0
- data/lib/jamm/api/models/v1_refund_response.rb +226 -0
- data/lib/jamm/api/models/v1_withdraw_async_response.rb +13 -4
- data/lib/jamm/api.rb +7 -0
- data/lib/jamm/api_patches.rb +1 -1
- data/lib/jamm/client.rb +15 -1
- data/lib/jamm/customer.rb +17 -10
- data/lib/jamm/healthcheck.rb +3 -2
- data/lib/jamm/payment.rb +28 -8
- data/lib/jamm/version.rb +1 -1
- data/lib/jamm/webhook.rb +7 -2
- data/lib/jamm.rb +16 -7
- metadata +9 -4
- data/lib/jamm/charge.rb +0 -65
- data/lib/jamm/contract.rb +0 -39
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.
|
|
@@ -627,6 +695,74 @@ module Api
|
|
|
627
695
|
return data, status_code, headers
|
|
628
696
|
end
|
|
629
697
|
|
|
698
|
+
# Refund a charge
|
|
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 (`refund_succeeded`).
|
|
701
|
+
# @param [Hash] opts the optional parameters
|
|
702
|
+
# @return [RefundResponse]
|
|
703
|
+
def refund(body, opts = {})
|
|
704
|
+
data, _status_code, _headers = refund_with_http_info(body, opts)
|
|
705
|
+
data
|
|
706
|
+
end
|
|
707
|
+
|
|
708
|
+
# Refund a charge
|
|
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 (`refund_succeeded`).
|
|
711
|
+
# @param [Hash] opts the optional parameters
|
|
712
|
+
# @return [Array<(RefundResponse, Integer, Hash)>] RefundResponse data, response status code and response headers
|
|
713
|
+
def refund_with_http_info(body, opts = {})
|
|
714
|
+
if @api_client.config.debugging
|
|
715
|
+
@api_client.config.logger.debug 'Calling API: PaymentApi.refund ...'
|
|
716
|
+
end
|
|
717
|
+
# verify the required parameter 'body' is set
|
|
718
|
+
if @api_client.config.client_side_validation && body.nil?
|
|
719
|
+
fail ArgumentError, "Missing the required parameter 'body' when calling PaymentApi.refund"
|
|
720
|
+
end
|
|
721
|
+
# resource path
|
|
722
|
+
local_var_path = '/v1/refund'
|
|
723
|
+
|
|
724
|
+
# query parameters
|
|
725
|
+
query_params = opts[:query_params] || {}
|
|
726
|
+
|
|
727
|
+
# header parameters
|
|
728
|
+
header_params = opts[:header_params] || {}
|
|
729
|
+
# HTTP header 'Accept' (if needed)
|
|
730
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
731
|
+
# HTTP header 'Content-Type'
|
|
732
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
733
|
+
if !content_type.nil?
|
|
734
|
+
header_params['Content-Type'] = content_type
|
|
735
|
+
end
|
|
736
|
+
|
|
737
|
+
# form parameters
|
|
738
|
+
form_params = opts[:form_params] || {}
|
|
739
|
+
|
|
740
|
+
# http body (model)
|
|
741
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
|
|
742
|
+
|
|
743
|
+
# return_type
|
|
744
|
+
return_type = opts[:debug_return_type] || 'RefundResponse'
|
|
745
|
+
|
|
746
|
+
# auth_names
|
|
747
|
+
auth_names = opts[:debug_auth_names] || []
|
|
748
|
+
|
|
749
|
+
new_options = opts.merge(
|
|
750
|
+
:operation => :"PaymentApi.refund",
|
|
751
|
+
:header_params => header_params,
|
|
752
|
+
:query_params => query_params,
|
|
753
|
+
:form_params => form_params,
|
|
754
|
+
:body => post_body,
|
|
755
|
+
:auth_names => auth_names,
|
|
756
|
+
:return_type => return_type
|
|
757
|
+
)
|
|
758
|
+
|
|
759
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
760
|
+
if @api_client.config.debugging
|
|
761
|
+
@api_client.config.logger.debug "API called: PaymentApi#refund\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
762
|
+
end
|
|
763
|
+
return data, status_code, headers
|
|
764
|
+
end
|
|
765
|
+
|
|
630
766
|
# Withdraw money from customer immediately, without redirect
|
|
631
767
|
# This call is synchronous. The money will be withdrawn immediately.
|
|
632
768
|
# @param body [WithdrawRequest] This message represents a request to withdraw money from a customer. It contains the customer ID and the amount to withdraw.
|
|
@@ -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
|
|
@@ -48,6 +48,32 @@ module Api
|
|
|
48
48
|
|
|
49
49
|
attr_accessor :processed_at
|
|
50
50
|
|
|
51
|
+
attr_accessor :charge_status
|
|
52
|
+
|
|
53
|
+
attr_accessor :error
|
|
54
|
+
|
|
55
|
+
class EnumAttributeValidator
|
|
56
|
+
attr_reader :datatype
|
|
57
|
+
attr_reader :allowable_values
|
|
58
|
+
|
|
59
|
+
def initialize(datatype, allowable_values)
|
|
60
|
+
@allowable_values = allowable_values.map do |value|
|
|
61
|
+
case datatype.to_s
|
|
62
|
+
when /Integer/i
|
|
63
|
+
value.to_i
|
|
64
|
+
when /Float/i
|
|
65
|
+
value.to_f
|
|
66
|
+
else
|
|
67
|
+
value
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
def valid?(value)
|
|
73
|
+
!value || allowable_values.include?(value)
|
|
74
|
+
end
|
|
75
|
+
end
|
|
76
|
+
|
|
51
77
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
52
78
|
def self.attribute_map
|
|
53
79
|
{
|
|
@@ -65,7 +91,9 @@ module Api
|
|
|
65
91
|
:'metadata' => :'metadata',
|
|
66
92
|
:'created_at' => :'createdAt',
|
|
67
93
|
:'updated_at' => :'updatedAt',
|
|
68
|
-
:'processed_at' => :'processedAt'
|
|
94
|
+
:'processed_at' => :'processedAt',
|
|
95
|
+
:'charge_status' => :'chargeStatus',
|
|
96
|
+
:'error' => :'error'
|
|
69
97
|
}
|
|
70
98
|
end
|
|
71
99
|
|
|
@@ -91,7 +119,9 @@ module Api
|
|
|
91
119
|
:'metadata' => :'Hash<String, String>',
|
|
92
120
|
:'created_at' => :'Time',
|
|
93
121
|
:'updated_at' => :'Time',
|
|
94
|
-
:'processed_at' => :'Time'
|
|
122
|
+
:'processed_at' => :'Time',
|
|
123
|
+
:'charge_status' => :'ChargeStatus',
|
|
124
|
+
:'error' => :'ChargeError'
|
|
95
125
|
}
|
|
96
126
|
end
|
|
97
127
|
|
|
@@ -177,6 +207,16 @@ module Api
|
|
|
177
207
|
if attributes.key?(:'processed_at')
|
|
178
208
|
self.processed_at = attributes[:'processed_at']
|
|
179
209
|
end
|
|
210
|
+
|
|
211
|
+
if attributes.key?(:'charge_status')
|
|
212
|
+
self.charge_status = attributes[:'charge_status']
|
|
213
|
+
else
|
|
214
|
+
self.charge_status = 'CHARGE_STATUS_UNSPECIFIED'
|
|
215
|
+
end
|
|
216
|
+
|
|
217
|
+
if attributes.key?(:'error')
|
|
218
|
+
self.error = attributes[:'error']
|
|
219
|
+
end
|
|
180
220
|
end
|
|
181
221
|
|
|
182
222
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -213,7 +253,9 @@ module Api
|
|
|
213
253
|
metadata == o.metadata &&
|
|
214
254
|
created_at == o.created_at &&
|
|
215
255
|
updated_at == o.updated_at &&
|
|
216
|
-
processed_at == o.processed_at
|
|
256
|
+
processed_at == o.processed_at &&
|
|
257
|
+
charge_status == o.charge_status &&
|
|
258
|
+
error == o.error
|
|
217
259
|
end
|
|
218
260
|
|
|
219
261
|
# @see the `==` method
|
|
@@ -225,7 +267,7 @@ module Api
|
|
|
225
267
|
# Calculates hash code according to all attributes.
|
|
226
268
|
# @return [Integer] Hash code
|
|
227
269
|
def hash
|
|
228
|
-
[charge_id, paid, reason, description, merchant_name, initial_amount, discount, final_amount, amount_refunded, currency, token_id, metadata, created_at, updated_at, processed_at].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
|
|
229
271
|
end
|
|
230
272
|
|
|
231
273
|
# Builds the object from hash
|