jamm 1.3.0 → 1.4.1
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/jamm.gemspec +1 -1
- data/lib/jamm/api/api/customer_api.rb +82 -52
- data/lib/jamm/api/api/healthcheck_api.rb +18 -15
- data/lib/jamm/api/api/payment_api.rb +113 -62
- data/lib/jamm/api/api/webhook_service_api.rb +41 -28
- data/lib/jamm/api/api_client.rb +74 -66
- data/lib/jamm/api/api_error.rb +16 -16
- data/lib/jamm/api/configuration.rb +42 -34
- data/lib/jamm/api/models/apiv1_error.rb +56 -44
- data/lib/jamm/api/models/apiv1_status.rb +57 -47
- data/lib/jamm/api/models/customer_service_update_customer_body.rb +107 -69
- data/lib/jamm/api/models/googlerpc_status.rb +61 -45
- data/lib/jamm/api/models/protobuf_any.rb +42 -35
- data/lib/jamm/api/models/v1_add_charge_request.rb +59 -44
- data/lib/jamm/api/models/v1_add_charge_response.rb +59 -44
- data/lib/jamm/api/models/v1_bank.rb +150 -95
- data/lib/jamm/api/models/v1_bank_assets.rb +60 -47
- data/lib/jamm/api/models/v1_bank_branch.rb +83 -56
- data/lib/jamm/api/models/v1_bank_information.rb +71 -51
- data/lib/jamm/api/models/v1_bank_quota.rb +99 -64
- data/lib/jamm/api/models/v1_bank_scheduled_maintenance_period.rb +75 -52
- data/lib/jamm/api/models/v1_buyer.rb +104 -76
- data/lib/jamm/api/models/v1_charge.rb +67 -52
- data/lib/jamm/api/models/v1_charge_message.rb +151 -93
- data/lib/jamm/api/models/v1_charge_message_status.rb +17 -18
- data/lib/jamm/api/models/v1_charge_result.rb +152 -93
- data/lib/jamm/api/models/v1_contract.rb +64 -52
- data/lib/jamm/api/models/v1_contract_message.rb +67 -48
- data/lib/jamm/api/models/v1_contract_status.rb +20 -21
- data/lib/jamm/api/models/v1_create_contract_with_charge_request.rb +59 -44
- data/lib/jamm/api/models/v1_create_contract_with_charge_response.rb +67 -48
- data/lib/jamm/api/models/v1_create_contract_without_charge_request.rb +51 -40
- data/lib/jamm/api/models/v1_create_contract_without_charge_response.rb +59 -44
- data/lib/jamm/api/models/v1_create_customer_request.rb +42 -35
- data/lib/jamm/api/models/v1_create_customer_response.rb +42 -35
- data/lib/jamm/api/models/v1_customer.rb +91 -60
- data/lib/jamm/api/models/v1_delete_customer_response.rb +42 -35
- data/lib/jamm/api/models/v1_deposit_type.rb +14 -15
- data/lib/jamm/api/models/v1_error_detail.rb +57 -44
- data/lib/jamm/api/models/v1_error_response.rb +46 -38
- data/lib/jamm/api/models/v1_error_type.rb +30 -31
- data/lib/jamm/api/models/v1_event_type.rb +20 -21
- data/lib/jamm/api/models/v1_get_bank_response.rb +42 -35
- data/lib/jamm/api/models/v1_get_branch_response.rb +42 -35
- data/lib/jamm/api/models/v1_get_branches_response.rb +44 -36
- data/lib/jamm/api/models/v1_get_charge_response.rb +51 -40
- data/lib/jamm/api/models/v1_get_charges_response.rb +60 -45
- data/lib/jamm/api/models/v1_get_contract_response.rb +51 -40
- data/lib/jamm/api/models/v1_get_customer_response.rb +42 -35
- data/lib/jamm/api/models/v1_get_major_banks_response.rb +59 -44
- data/lib/jamm/api/models/v1_initial_charge.rb +61 -48
- data/lib/jamm/api/models/v1_kyc_status.rb +16 -17
- data/lib/jamm/api/models/v1_merchant.rb +51 -40
- data/lib/jamm/api/models/v1_merchant_customer.rb +51 -40
- data/lib/jamm/api/models/v1_merchant_webhook_message.rb +75 -57
- data/lib/jamm/api/models/v1_message_response.rb +67 -48
- data/lib/jamm/api/models/v1_off_session_payment_request.rb +51 -40
- data/lib/jamm/api/models/v1_off_session_payment_response.rb +51 -40
- data/lib/jamm/api/models/v1_on_session_payment_data.rb +67 -48
- data/lib/jamm/api/models/v1_on_session_payment_error.rb +55 -45
- data/lib/jamm/api/models/v1_on_session_payment_error_code.rb +21 -22
- data/lib/jamm/api/models/v1_on_session_payment_request.rb +67 -48
- data/lib/jamm/api/models/v1_on_session_payment_response.rb +59 -44
- data/lib/jamm/api/models/v1_pagination.rb +51 -40
- data/lib/jamm/api/models/v1_payment_authorization_status.rb +14 -15
- data/lib/jamm/api/models/v1_payment_link.rb +57 -44
- data/lib/jamm/api/models/v1_ping_response.rb +42 -35
- data/lib/jamm/api/models/v1_search_banks_response.rb +44 -36
- data/lib/jamm/api/models/v1_search_branches_response.rb +44 -36
- data/lib/jamm/api/models/v1_update_customer_response.rb +42 -35
- data/lib/jamm/api/models/v1_url.rb +48 -39
- data/lib/jamm/api/models/v1_user_account_message.rb +67 -48
- data/lib/jamm/api/models/v1_withdraw_request.rb +51 -40
- data/lib/jamm/api/models/v1_withdraw_response.rb +51 -40
- data/lib/jamm/api/version.rb +11 -11
- data/lib/jamm/api.rb +10 -10
- data/lib/jamm/charge.rb +12 -0
- data/lib/jamm/deprecation.rb +13 -0
- data/lib/jamm/payment.rb +61 -0
- data/lib/jamm/version.rb +1 -1
- data/lib/jamm.rb +2 -0
- metadata +5 -3
@@ -1,14 +1,14 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
#
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
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
12
|
|
13
13
|
require 'date'
|
14
14
|
require 'time'
|
@@ -16,13 +16,15 @@ require 'time'
|
|
16
16
|
module Api
|
17
17
|
# This message represents a request to withdraw money from a customer. It contains the customer ID and the amount to withdraw.
|
18
18
|
class WithdrawRequest
|
19
|
-
attr_accessor :customer
|
19
|
+
attr_accessor :customer
|
20
|
+
|
21
|
+
attr_accessor :charge
|
20
22
|
|
21
23
|
# Attribute mapping from ruby-style variable name to JSON key.
|
22
24
|
def self.attribute_map
|
23
25
|
{
|
24
|
-
:customer => :customer,
|
25
|
-
:charge => :charge
|
26
|
+
:'customer' => :'customer',
|
27
|
+
:'charge' => :'charge'
|
26
28
|
}
|
27
29
|
end
|
28
30
|
|
@@ -34,40 +36,47 @@ module Api
|
|
34
36
|
# Attribute type mapping.
|
35
37
|
def self.openapi_types
|
36
38
|
{
|
37
|
-
:customer => :String,
|
38
|
-
:charge => :InitialCharge
|
39
|
+
:'customer' => :'String',
|
40
|
+
:'charge' => :'InitialCharge'
|
39
41
|
}
|
40
42
|
end
|
41
43
|
|
42
44
|
# List of attributes with nullable: true
|
43
45
|
def self.openapi_nullable
|
44
|
-
Set.new([
|
46
|
+
Set.new([
|
47
|
+
])
|
45
48
|
end
|
46
49
|
|
47
50
|
# Initializes the object
|
48
51
|
# @param [Hash] attributes Model attributes in the form of hash
|
49
52
|
def initialize(attributes = {})
|
50
|
-
|
53
|
+
if (!attributes.is_a?(Hash))
|
54
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Api::WithdrawRequest` initialize method"
|
55
|
+
end
|
51
56
|
|
52
57
|
# check to see if the attribute exists and convert string to symbol for hash key
|
53
|
-
attributes = attributes.each_with_object({})
|
54
|
-
|
55
|
-
|
58
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
59
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
60
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Api::WithdrawRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
61
|
+
end
|
56
62
|
h[k.to_sym] = v
|
57
|
-
|
58
|
-
|
59
|
-
self.customer = attributes[:customer] if attributes.key?(:customer)
|
63
|
+
}
|
60
64
|
|
61
|
-
|
65
|
+
if attributes.key?(:'customer')
|
66
|
+
self.customer = attributes[:'customer']
|
67
|
+
end
|
62
68
|
|
63
|
-
|
69
|
+
if attributes.key?(:'charge')
|
70
|
+
self.charge = attributes[:'charge']
|
71
|
+
end
|
64
72
|
end
|
65
73
|
|
66
74
|
# Show invalid properties with the reasons. Usually used together with valid?
|
67
75
|
# @return Array for valid properties with the reasons
|
68
76
|
def list_invalid_properties
|
69
77
|
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
70
|
-
|
78
|
+
invalid_properties = Array.new
|
79
|
+
invalid_properties
|
71
80
|
end
|
72
81
|
|
73
82
|
# Check to see if the all the properties in the model are valid
|
@@ -79,18 +88,17 @@ module Api
|
|
79
88
|
|
80
89
|
# Checks equality by comparing each attribute.
|
81
90
|
# @param [Object] Object to be compared
|
82
|
-
def ==(
|
83
|
-
return true if equal?(
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
charge == other.charge
|
91
|
+
def ==(o)
|
92
|
+
return true if self.equal?(o)
|
93
|
+
self.class == o.class &&
|
94
|
+
customer == o.customer &&
|
95
|
+
charge == o.charge
|
88
96
|
end
|
89
97
|
|
90
98
|
# @see the `==` method
|
91
99
|
# @param [Object] Object to be compared
|
92
|
-
def eql?(
|
93
|
-
self ==
|
100
|
+
def eql?(o)
|
101
|
+
self == o
|
94
102
|
end
|
95
103
|
|
96
104
|
# Calculates hash code according to all attributes.
|
@@ -104,18 +112,19 @@ module Api
|
|
104
112
|
# @return [Object] Returns the model itself
|
105
113
|
def self.build_from_hash(attributes)
|
106
114
|
return nil unless attributes.is_a?(Hash)
|
107
|
-
|
108
115
|
attributes = attributes.transform_keys(&:to_sym)
|
109
116
|
transformed_hash = {}
|
110
117
|
openapi_types.each_pair do |key, type|
|
111
118
|
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
112
|
-
transformed_hash[key
|
119
|
+
transformed_hash["#{key}"] = nil
|
113
120
|
elsif type =~ /\AArray<(.*)>/i
|
114
121
|
# check to ensure the input is an array given that the attribute
|
115
122
|
# is documented as an array but the input is not
|
116
|
-
|
123
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
124
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
125
|
+
end
|
117
126
|
elsif !attributes[attribute_map[key]].nil?
|
118
|
-
transformed_hash[key
|
127
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
119
128
|
end
|
120
129
|
end
|
121
130
|
new(transformed_hash)
|
@@ -181,7 +190,7 @@ module Api
|
|
181
190
|
def to_hash
|
182
191
|
hash = {}
|
183
192
|
self.class.attribute_map.each_pair do |attr, param|
|
184
|
-
value = send(attr)
|
193
|
+
value = self.send(attr)
|
185
194
|
if value.nil?
|
186
195
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
187
196
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
@@ -209,5 +218,7 @@ module Api
|
|
209
218
|
value
|
210
219
|
end
|
211
220
|
end
|
221
|
+
|
212
222
|
end
|
223
|
+
|
213
224
|
end
|
@@ -1,14 +1,14 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
#
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
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
12
|
|
13
13
|
require 'date'
|
14
14
|
require 'time'
|
@@ -16,13 +16,15 @@ require 'time'
|
|
16
16
|
module Api
|
17
17
|
# This message represents the response after processing a WithdrawRequest. It contains information about the customer and the charge.
|
18
18
|
class WithdrawResponse
|
19
|
-
attr_accessor :customer
|
19
|
+
attr_accessor :customer
|
20
|
+
|
21
|
+
attr_accessor :charge
|
20
22
|
|
21
23
|
# Attribute mapping from ruby-style variable name to JSON key.
|
22
24
|
def self.attribute_map
|
23
25
|
{
|
24
|
-
:customer => :customer,
|
25
|
-
:charge => :charge
|
26
|
+
:'customer' => :'customer',
|
27
|
+
:'charge' => :'charge'
|
26
28
|
}
|
27
29
|
end
|
28
30
|
|
@@ -34,40 +36,47 @@ module Api
|
|
34
36
|
# Attribute type mapping.
|
35
37
|
def self.openapi_types
|
36
38
|
{
|
37
|
-
:customer => :Customer,
|
38
|
-
:charge => :ChargeResult
|
39
|
+
:'customer' => :'Customer',
|
40
|
+
:'charge' => :'ChargeResult'
|
39
41
|
}
|
40
42
|
end
|
41
43
|
|
42
44
|
# List of attributes with nullable: true
|
43
45
|
def self.openapi_nullable
|
44
|
-
Set.new([
|
46
|
+
Set.new([
|
47
|
+
])
|
45
48
|
end
|
46
49
|
|
47
50
|
# Initializes the object
|
48
51
|
# @param [Hash] attributes Model attributes in the form of hash
|
49
52
|
def initialize(attributes = {})
|
50
|
-
|
53
|
+
if (!attributes.is_a?(Hash))
|
54
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Api::WithdrawResponse` initialize method"
|
55
|
+
end
|
51
56
|
|
52
57
|
# check to see if the attribute exists and convert string to symbol for hash key
|
53
|
-
attributes = attributes.each_with_object({})
|
54
|
-
|
55
|
-
|
58
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
59
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
60
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Api::WithdrawResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
61
|
+
end
|
56
62
|
h[k.to_sym] = v
|
57
|
-
|
58
|
-
|
59
|
-
self.customer = attributes[:customer] if attributes.key?(:customer)
|
63
|
+
}
|
60
64
|
|
61
|
-
|
65
|
+
if attributes.key?(:'customer')
|
66
|
+
self.customer = attributes[:'customer']
|
67
|
+
end
|
62
68
|
|
63
|
-
|
69
|
+
if attributes.key?(:'charge')
|
70
|
+
self.charge = attributes[:'charge']
|
71
|
+
end
|
64
72
|
end
|
65
73
|
|
66
74
|
# Show invalid properties with the reasons. Usually used together with valid?
|
67
75
|
# @return Array for valid properties with the reasons
|
68
76
|
def list_invalid_properties
|
69
77
|
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
70
|
-
|
78
|
+
invalid_properties = Array.new
|
79
|
+
invalid_properties
|
71
80
|
end
|
72
81
|
|
73
82
|
# Check to see if the all the properties in the model are valid
|
@@ -79,18 +88,17 @@ module Api
|
|
79
88
|
|
80
89
|
# Checks equality by comparing each attribute.
|
81
90
|
# @param [Object] Object to be compared
|
82
|
-
def ==(
|
83
|
-
return true if equal?(
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
charge == other.charge
|
91
|
+
def ==(o)
|
92
|
+
return true if self.equal?(o)
|
93
|
+
self.class == o.class &&
|
94
|
+
customer == o.customer &&
|
95
|
+
charge == o.charge
|
88
96
|
end
|
89
97
|
|
90
98
|
# @see the `==` method
|
91
99
|
# @param [Object] Object to be compared
|
92
|
-
def eql?(
|
93
|
-
self ==
|
100
|
+
def eql?(o)
|
101
|
+
self == o
|
94
102
|
end
|
95
103
|
|
96
104
|
# Calculates hash code according to all attributes.
|
@@ -104,18 +112,19 @@ module Api
|
|
104
112
|
# @return [Object] Returns the model itself
|
105
113
|
def self.build_from_hash(attributes)
|
106
114
|
return nil unless attributes.is_a?(Hash)
|
107
|
-
|
108
115
|
attributes = attributes.transform_keys(&:to_sym)
|
109
116
|
transformed_hash = {}
|
110
117
|
openapi_types.each_pair do |key, type|
|
111
118
|
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
112
|
-
transformed_hash[key
|
119
|
+
transformed_hash["#{key}"] = nil
|
113
120
|
elsif type =~ /\AArray<(.*)>/i
|
114
121
|
# check to ensure the input is an array given that the attribute
|
115
122
|
# is documented as an array but the input is not
|
116
|
-
|
123
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
124
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
125
|
+
end
|
117
126
|
elsif !attributes[attribute_map[key]].nil?
|
118
|
-
transformed_hash[key
|
127
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
119
128
|
end
|
120
129
|
end
|
121
130
|
new(transformed_hash)
|
@@ -181,7 +190,7 @@ module Api
|
|
181
190
|
def to_hash
|
182
191
|
hash = {}
|
183
192
|
self.class.attribute_map.each_pair do |attr, param|
|
184
|
-
value = send(attr)
|
193
|
+
value = self.send(attr)
|
185
194
|
if value.nil?
|
186
195
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
187
196
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
@@ -209,5 +218,7 @@ module Api
|
|
209
218
|
value
|
210
219
|
end
|
211
220
|
end
|
221
|
+
|
212
222
|
end
|
223
|
+
|
213
224
|
end
|
data/lib/jamm/api/version.rb
CHANGED
@@ -1,14 +1,14 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
#
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
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
12
|
|
13
13
|
module Api
|
14
14
|
VERSION = '1.0.0'
|
data/lib/jamm/api.rb
CHANGED
@@ -1,14 +1,14 @@
|
|
1
|
-
|
1
|
+
=begin
|
2
|
+
#Jamm API
|
2
3
|
|
3
|
-
#
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
#
|
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
12
|
|
13
13
|
# Common files
|
14
14
|
require 'jamm/api/api_client'
|
data/lib/jamm/charge.rb
CHANGED
@@ -7,7 +7,10 @@ require 'jamm/errors'
|
|
7
7
|
|
8
8
|
module Jamm
|
9
9
|
module Charge
|
10
|
+
# DEPRECATED, use Jamm::Payment.on_session
|
10
11
|
def self.create_with_redirect(customer:, charge:, redirect:)
|
12
|
+
Jamm::Deprecation.warn('Jamm::Charge.create_with_redirect')
|
13
|
+
|
11
14
|
request = Jamm::OpenAPI::AddChargeRequest.new(
|
12
15
|
customer: customer,
|
13
16
|
charge: charge,
|
@@ -19,7 +22,10 @@ module Jamm
|
|
19
22
|
raise Jamm::ApiError.from_error(e)
|
20
23
|
end
|
21
24
|
|
25
|
+
# DEPRECATED, use Jamm::Payment.off_session
|
22
26
|
def self.create_without_redirect(customer:, charge:)
|
27
|
+
Jamm::Deprecation.warn('Jamm::Charge.create_without_redirect')
|
28
|
+
|
23
29
|
request = Jamm::OpenAPI::WithdrawRequest.new(
|
24
30
|
customer: customer,
|
25
31
|
charge: charge
|
@@ -30,7 +36,10 @@ module Jamm
|
|
30
36
|
raise Jamm::ApiError.from_error(e)
|
31
37
|
end
|
32
38
|
|
39
|
+
# DEPRECATED, use Jamm::Payment.get
|
33
40
|
def self.get(charge_id)
|
41
|
+
Jamm::Deprecation.warn('Jamm::Charge.get')
|
42
|
+
|
34
43
|
Jamm::OpenAPI::PaymentApi.new(Jamm::Client.handler).get_charge(charge_id)
|
35
44
|
rescue Jamm::OpenAPI::ApiError => e
|
36
45
|
return nil if e.code == 404
|
@@ -38,7 +47,10 @@ module Jamm
|
|
38
47
|
raise Jamm::ApiError.from_error(e)
|
39
48
|
end
|
40
49
|
|
50
|
+
# DEPRECATED, use Jamm::Payment.list
|
41
51
|
def self.list(customer:, pagination: nil)
|
52
|
+
Jamm::Deprecation.warn('Jamm::Charge.list')
|
53
|
+
|
42
54
|
Jamm::OpenAPI::PaymentApi.new(Jamm::Client.handler).get_charges(customer, pagination.nil? ? {} : pagination)
|
43
55
|
rescue Jamm::OpenAPI::ApiError => e
|
44
56
|
if [404].include?(e.code)
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Jamm
|
4
|
+
module Deprecation
|
5
|
+
def self.warn(method)
|
6
|
+
puts [
|
7
|
+
'DEPRECATION WARNING:',
|
8
|
+
"#{method} is going to deprecate.",
|
9
|
+
'Please check our migration guide https://github.com/jamm-pay/ruby-sdk/wiki'
|
10
|
+
].join(' ')
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
data/lib/jamm/payment.rb
ADDED
@@ -0,0 +1,61 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'rest-client'
|
4
|
+
require 'json'
|
5
|
+
require 'base64'
|
6
|
+
require 'jamm/errors'
|
7
|
+
|
8
|
+
module Jamm
|
9
|
+
module Payment
|
10
|
+
def self.on_session(charge:, redirect:, customer: nil, buyer: nil)
|
11
|
+
request = if customer.nil?
|
12
|
+
Jamm::OpenAPI::OnSessionPaymentRequest.new(
|
13
|
+
buyer: buyer,
|
14
|
+
charge: charge,
|
15
|
+
redirect: redirect
|
16
|
+
)
|
17
|
+
else
|
18
|
+
Jamm::OpenAPI::OnSessionPaymentRequest.new(
|
19
|
+
customer: customer,
|
20
|
+
charge: charge,
|
21
|
+
redirect: redirect
|
22
|
+
)
|
23
|
+
end
|
24
|
+
|
25
|
+
Jamm::OpenAPI::PaymentApi.new(Jamm::Client.handler).on_session_payment(request)
|
26
|
+
rescue Jamm::OpenAPI::ApiError => e
|
27
|
+
raise Jamm::ApiError.from_error(e)
|
28
|
+
end
|
29
|
+
|
30
|
+
def self.off_session(customer:, charge:)
|
31
|
+
request = Jamm::OpenAPI::OffSessionPaymentRequest.new(
|
32
|
+
customer: customer,
|
33
|
+
charge: charge
|
34
|
+
)
|
35
|
+
|
36
|
+
Jamm::OpenAPI::PaymentApi.new(Jamm::Client.handler).off_session_payment(request)
|
37
|
+
rescue Jamm::OpenAPI::ApiError => e
|
38
|
+
raise Jamm::ApiError.from_error(e)
|
39
|
+
end
|
40
|
+
|
41
|
+
def self.get(charge_id)
|
42
|
+
Jamm::OpenAPI::PaymentApi.new(Jamm::Client.handler).get_charge(charge_id)
|
43
|
+
rescue Jamm::OpenAPI::ApiError => e
|
44
|
+
return nil if e.code == 404
|
45
|
+
|
46
|
+
raise Jamm::ApiError.from_error(e)
|
47
|
+
end
|
48
|
+
|
49
|
+
def self.list(customer:, pagination: nil)
|
50
|
+
Jamm::OpenAPI::PaymentApi.new(Jamm::Client.handler).get_charges(customer, pagination.nil? ? {} : pagination)
|
51
|
+
rescue Jamm::OpenAPI::ApiError => e
|
52
|
+
if [404].include?(e.code)
|
53
|
+
nil
|
54
|
+
else
|
55
|
+
{
|
56
|
+
charges: []
|
57
|
+
}
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
data/lib/jamm/version.rb
CHANGED
data/lib/jamm.rb
CHANGED
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: 1.
|
4
|
+
version: 1.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jamm
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-08-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|
@@ -139,17 +139,19 @@ files:
|
|
139
139
|
- lib/jamm/client.rb
|
140
140
|
- lib/jamm/contract.rb
|
141
141
|
- lib/jamm/customer.rb
|
142
|
+
- lib/jamm/deprecation.rb
|
142
143
|
- lib/jamm/errors.rb
|
143
144
|
- lib/jamm/healthcheck.rb
|
144
145
|
- lib/jamm/oauth.rb
|
145
146
|
- lib/jamm/openapi.rb
|
147
|
+
- lib/jamm/payment.rb
|
146
148
|
- lib/jamm/version.rb
|
147
149
|
- lib/jamm/webhook.rb
|
148
150
|
homepage: https://jamm-pay.jp
|
149
151
|
licenses:
|
150
152
|
- MIT
|
151
153
|
metadata:
|
152
|
-
source_code_uri: https://github.com/jamm-pay/
|
154
|
+
source_code_uri: https://github.com/jamm-pay/ruby-sdk
|
153
155
|
post_install_message:
|
154
156
|
rdoc_options: []
|
155
157
|
require_paths:
|