mundi_api 0.9.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 +7 -0
- data/LICENSE +28 -0
- data/README.md +2186 -0
- data/lib/mundi_api.rb +137 -0
- data/lib/mundi_api/api_helper.rb +209 -0
- data/lib/mundi_api/configuration.rb +25 -0
- data/lib/mundi_api/controllers/base_controller.rb +61 -0
- data/lib/mundi_api/controllers/charges_controller.rb +359 -0
- data/lib/mundi_api/controllers/customers_controller.rb +758 -0
- data/lib/mundi_api/controllers/invoices_controller.rb +184 -0
- data/lib/mundi_api/controllers/orders_controller.rb +171 -0
- data/lib/mundi_api/controllers/plans_controller.rb +387 -0
- data/lib/mundi_api/controllers/subscriptions_controller.rb +648 -0
- data/lib/mundi_api/controllers/tokens_controller.rb +87 -0
- data/lib/mundi_api/exceptions/api_exception.rb +18 -0
- data/lib/mundi_api/exceptions/error_exception.rb +37 -0
- data/lib/mundi_api/http/auth/basic_auth.rb +20 -0
- data/lib/mundi_api/http/faraday_client.rb +55 -0
- data/lib/mundi_api/http/http_call_back.rb +22 -0
- data/lib/mundi_api/http/http_client.rb +92 -0
- data/lib/mundi_api/http/http_context.rb +18 -0
- data/lib/mundi_api/http/http_method_enum.rb +11 -0
- data/lib/mundi_api/http/http_request.rb +48 -0
- data/lib/mundi_api/http/http_response.rb +21 -0
- data/lib/mundi_api/models/base_model.rb +34 -0
- data/lib/mundi_api/models/create_access_token_request.rb +35 -0
- data/lib/mundi_api/models/create_address_request.rb +108 -0
- data/lib/mundi_api/models/create_bank_transfer_payment_request.rb +44 -0
- data/lib/mundi_api/models/create_boleto_payment_request.rb +83 -0
- data/lib/mundi_api/models/create_cancel_charge_request.rb +35 -0
- data/lib/mundi_api/models/create_cancel_subscription_request.rb +35 -0
- data/lib/mundi_api/models/create_capture_charge_request.rb +45 -0
- data/lib/mundi_api/models/create_card_options_request.rb +36 -0
- data/lib/mundi_api/models/create_card_request.rb +136 -0
- data/lib/mundi_api/models/create_card_token_request.rb +80 -0
- data/lib/mundi_api/models/create_charge_request.rb +92 -0
- data/lib/mundi_api/models/create_checkout_boleto_payment_request.rb +54 -0
- data/lib/mundi_api/models/create_checkout_card_installment_option_request.rb +44 -0
- data/lib/mundi_api/models/create_checkout_card_payment_request.rb +51 -0
- data/lib/mundi_api/models/create_checkout_payment_request.rb +82 -0
- data/lib/mundi_api/models/create_credit_card_payment_request.rb +108 -0
- data/lib/mundi_api/models/create_customer_request.rb +108 -0
- data/lib/mundi_api/models/create_discount_request.rb +62 -0
- data/lib/mundi_api/models/create_order_item_request.rb +71 -0
- data/lib/mundi_api/models/create_order_request.rb +114 -0
- data/lib/mundi_api/models/create_payment_request.rb +121 -0
- data/lib/mundi_api/models/create_phone_request.rb +53 -0
- data/lib/mundi_api/models/create_phones_request.rb +46 -0
- data/lib/mundi_api/models/create_plan_item_request.rb +81 -0
- data/lib/mundi_api/models/create_plan_request.rb +199 -0
- data/lib/mundi_api/models/create_price_bracket_request.rb +62 -0
- data/lib/mundi_api/models/create_pricing_scheme_request.rb +69 -0
- data/lib/mundi_api/models/create_seller_request.rb +90 -0
- data/lib/mundi_api/models/create_setup_request.rb +55 -0
- data/lib/mundi_api/models/create_shipping_request.rb +81 -0
- data/lib/mundi_api/models/create_subscription_item_request.rb +106 -0
- data/lib/mundi_api/models/create_subscription_request.rb +269 -0
- data/lib/mundi_api/models/create_token_request.rb +44 -0
- data/lib/mundi_api/models/create_usage_request.rb +54 -0
- data/lib/mundi_api/models/create_voucher_payment_request.rb +72 -0
- data/lib/mundi_api/models/get_access_token_response.rb +73 -0
- data/lib/mundi_api/models/get_address_response.rb +163 -0
- data/lib/mundi_api/models/get_bank_transfer_transaction_response.rb +118 -0
- data/lib/mundi_api/models/get_billing_address_response.rb +98 -0
- data/lib/mundi_api/models/get_boleto_transaction_response.rb +137 -0
- data/lib/mundi_api/models/get_card_response.rb +164 -0
- data/lib/mundi_api/models/get_card_token_response.rb +89 -0
- data/lib/mundi_api/models/get_charge_response.rb +184 -0
- data/lib/mundi_api/models/get_checkout_payment_settings_response.rb +99 -0
- data/lib/mundi_api/models/get_credit_card_transaction_response.rb +163 -0
- data/lib/mundi_api/models/get_customer_response.rb +145 -0
- data/lib/mundi_api/models/get_discount_response.rb +100 -0
- data/lib/mundi_api/models/get_invoice_item_response.rb +73 -0
- data/lib/mundi_api/models/get_invoice_response.rb +210 -0
- data/lib/mundi_api/models/get_order_item_response.rb +63 -0
- data/lib/mundi_api/models/get_order_response.rb +167 -0
- data/lib/mundi_api/models/get_period_response.rb +73 -0
- data/lib/mundi_api/models/get_phone_response.rb +53 -0
- data/lib/mundi_api/models/get_phones_response.rb +46 -0
- data/lib/mundi_api/models/get_plan_item_response.rb +127 -0
- data/lib/mundi_api/models/get_plan_response.rb +223 -0
- data/lib/mundi_api/models/get_price_bracket_response.rb +62 -0
- data/lib/mundi_api/models/get_pricing_scheme_response.rb +69 -0
- data/lib/mundi_api/models/get_safety_pay_transaction_response.rb +109 -0
- data/lib/mundi_api/models/get_seller_response.rb +126 -0
- data/lib/mundi_api/models/get_setup_response.rb +62 -0
- data/lib/mundi_api/models/get_shipping_response.rb +72 -0
- data/lib/mundi_api/models/get_subscription_item_response.rb +135 -0
- data/lib/mundi_api/models/get_subscription_response.rb +261 -0
- data/lib/mundi_api/models/get_token_response.rb +72 -0
- data/lib/mundi_api/models/get_transaction_response.rb +136 -0
- data/lib/mundi_api/models/get_usage_response.rb +82 -0
- data/lib/mundi_api/models/get_voucher_transaction_response.rb +163 -0
- data/lib/mundi_api/models/list_access_tokens_response.rb +51 -0
- data/lib/mundi_api/models/list_addresses_response.rb +51 -0
- data/lib/mundi_api/models/list_cards_response.rb +51 -0
- data/lib/mundi_api/models/list_charges_response.rb +51 -0
- data/lib/mundi_api/models/list_customers_response.rb +51 -0
- data/lib/mundi_api/models/list_invoices_response.rb +51 -0
- data/lib/mundi_api/models/list_order_response.rb +51 -0
- data/lib/mundi_api/models/list_plans_response.rb +51 -0
- data/lib/mundi_api/models/list_subscription_items_response.rb +51 -0
- data/lib/mundi_api/models/list_subscriptions_response.rb +51 -0
- data/lib/mundi_api/models/list_transactions_response.rb +51 -0
- data/lib/mundi_api/models/list_usages_response.rb +51 -0
- data/lib/mundi_api/models/paging_response.rb +53 -0
- data/lib/mundi_api/models/update_address_request.rb +53 -0
- data/lib/mundi_api/models/update_card_request.rb +81 -0
- data/lib/mundi_api/models/update_charge_card_request.rb +62 -0
- data/lib/mundi_api/models/update_charge_due_date_request.rb +36 -0
- data/lib/mundi_api/models/update_charge_payment_method_request.rb +74 -0
- data/lib/mundi_api/models/update_customer_request.rb +90 -0
- data/lib/mundi_api/models/update_metadata_request.rb +35 -0
- data/lib/mundi_api/models/update_plan_item_request.rb +81 -0
- data/lib/mundi_api/models/update_plan_request.rb +161 -0
- data/lib/mundi_api/models/update_price_bracket_request.rb +62 -0
- data/lib/mundi_api/models/update_pricing_scheme_request.rb +69 -0
- data/lib/mundi_api/models/update_subscription_billing_date_request.rb +37 -0
- data/lib/mundi_api/models/update_subscription_card_request.rb +44 -0
- data/lib/mundi_api/models/update_subscription_item_request.rb +81 -0
- data/lib/mundi_api/models/update_subscription_payment_method_request.rb +53 -0
- data/lib/mundi_api/mundi_api_client.rb +63 -0
- metadata +246 -0
@@ -0,0 +1,164 @@
|
|
1
|
+
# This file was automatically generated by APIMATIC v2.0
|
2
|
+
# ( https://apimatic.io ).
|
3
|
+
|
4
|
+
require 'date'
|
5
|
+
module MundiApi
|
6
|
+
# Response object for getting a credit card
|
7
|
+
class GetCardResponse < BaseModel
|
8
|
+
# TODO: Write general description for this method
|
9
|
+
# @return [String]
|
10
|
+
attr_accessor :id
|
11
|
+
|
12
|
+
# TODO: Write general description for this method
|
13
|
+
# @return [String]
|
14
|
+
attr_accessor :last_four_digits
|
15
|
+
|
16
|
+
# TODO: Write general description for this method
|
17
|
+
# @return [String]
|
18
|
+
attr_accessor :brand
|
19
|
+
|
20
|
+
# TODO: Write general description for this method
|
21
|
+
# @return [String]
|
22
|
+
attr_accessor :holder_name
|
23
|
+
|
24
|
+
# TODO: Write general description for this method
|
25
|
+
# @return [Integer]
|
26
|
+
attr_accessor :exp_month
|
27
|
+
|
28
|
+
# TODO: Write general description for this method
|
29
|
+
# @return [Integer]
|
30
|
+
attr_accessor :exp_year
|
31
|
+
|
32
|
+
# TODO: Write general description for this method
|
33
|
+
# @return [String]
|
34
|
+
attr_accessor :status
|
35
|
+
|
36
|
+
# TODO: Write general description for this method
|
37
|
+
# @return [DateTime]
|
38
|
+
attr_accessor :created_at
|
39
|
+
|
40
|
+
# TODO: Write general description for this method
|
41
|
+
# @return [DateTime]
|
42
|
+
attr_accessor :updated_at
|
43
|
+
|
44
|
+
# TODO: Write general description for this method
|
45
|
+
# @return [GetBillingAddressResponse]
|
46
|
+
attr_accessor :billing_address
|
47
|
+
|
48
|
+
# TODO: Write general description for this method
|
49
|
+
# @return [GetCustomerResponse]
|
50
|
+
attr_accessor :customer
|
51
|
+
|
52
|
+
# TODO: Write general description for this method
|
53
|
+
# @return [Array<String, String>]
|
54
|
+
attr_accessor :metadata
|
55
|
+
|
56
|
+
# Card type
|
57
|
+
# @return [String]
|
58
|
+
attr_accessor :type
|
59
|
+
|
60
|
+
# Document number for the card's holder
|
61
|
+
# @return [String]
|
62
|
+
attr_accessor :holder_document
|
63
|
+
|
64
|
+
# Document number for the card's holder
|
65
|
+
# @return [DateTime]
|
66
|
+
attr_accessor :deleted_at
|
67
|
+
|
68
|
+
# A mapping from model property names to API property names.
|
69
|
+
def self.names
|
70
|
+
if @_hash.nil?
|
71
|
+
@_hash = {}
|
72
|
+
@_hash['id'] = 'id'
|
73
|
+
@_hash['last_four_digits'] = 'last_four_digits'
|
74
|
+
@_hash['brand'] = 'brand'
|
75
|
+
@_hash['holder_name'] = 'holder_name'
|
76
|
+
@_hash['exp_month'] = 'exp_month'
|
77
|
+
@_hash['exp_year'] = 'exp_year'
|
78
|
+
@_hash['status'] = 'status'
|
79
|
+
@_hash['created_at'] = 'created_at'
|
80
|
+
@_hash['updated_at'] = 'updated_at'
|
81
|
+
@_hash['billing_address'] = 'billing_address'
|
82
|
+
@_hash['customer'] = 'customer'
|
83
|
+
@_hash['metadata'] = 'metadata'
|
84
|
+
@_hash['type'] = 'type'
|
85
|
+
@_hash['holder_document'] = 'holder_document'
|
86
|
+
@_hash['deleted_at'] = 'deleted_at'
|
87
|
+
end
|
88
|
+
@_hash
|
89
|
+
end
|
90
|
+
|
91
|
+
def initialize(id = nil,
|
92
|
+
last_four_digits = nil,
|
93
|
+
brand = nil,
|
94
|
+
holder_name = nil,
|
95
|
+
exp_month = nil,
|
96
|
+
exp_year = nil,
|
97
|
+
status = nil,
|
98
|
+
created_at = nil,
|
99
|
+
updated_at = nil,
|
100
|
+
billing_address = nil,
|
101
|
+
customer = nil,
|
102
|
+
metadata = nil,
|
103
|
+
type = nil,
|
104
|
+
holder_document = nil,
|
105
|
+
deleted_at = nil)
|
106
|
+
@id = id
|
107
|
+
@last_four_digits = last_four_digits
|
108
|
+
@brand = brand
|
109
|
+
@holder_name = holder_name
|
110
|
+
@exp_month = exp_month
|
111
|
+
@exp_year = exp_year
|
112
|
+
@status = status
|
113
|
+
@created_at = created_at
|
114
|
+
@updated_at = updated_at
|
115
|
+
@billing_address = billing_address
|
116
|
+
@customer = customer
|
117
|
+
@metadata = metadata
|
118
|
+
@type = type
|
119
|
+
@holder_document = holder_document
|
120
|
+
@deleted_at = deleted_at
|
121
|
+
end
|
122
|
+
|
123
|
+
# Creates an instance of the object from a hash.
|
124
|
+
def self.from_hash(hash)
|
125
|
+
return nil unless hash
|
126
|
+
|
127
|
+
# Extract variables from the hash.
|
128
|
+
id = hash['id']
|
129
|
+
last_four_digits = hash['last_four_digits']
|
130
|
+
brand = hash['brand']
|
131
|
+
holder_name = hash['holder_name']
|
132
|
+
exp_month = hash['exp_month']
|
133
|
+
exp_year = hash['exp_year']
|
134
|
+
status = hash['status']
|
135
|
+
created_at = DateTime.rfc3339(hash['created_at']) if hash['created_at']
|
136
|
+
updated_at = DateTime.rfc3339(hash['updated_at']) if hash['updated_at']
|
137
|
+
billing_address = GetBillingAddressResponse.from_hash(hash['billing_address']) if
|
138
|
+
hash['billing_address']
|
139
|
+
customer = GetCustomerResponse.from_hash(hash['customer']) if
|
140
|
+
hash['customer']
|
141
|
+
metadata = hash['metadata']
|
142
|
+
type = hash['type']
|
143
|
+
holder_document = hash['holder_document']
|
144
|
+
deleted_at = DateTime.rfc3339(hash['deleted_at']) if hash['deleted_at']
|
145
|
+
|
146
|
+
# Create object from extracted values.
|
147
|
+
GetCardResponse.new(id,
|
148
|
+
last_four_digits,
|
149
|
+
brand,
|
150
|
+
holder_name,
|
151
|
+
exp_month,
|
152
|
+
exp_year,
|
153
|
+
status,
|
154
|
+
created_at,
|
155
|
+
updated_at,
|
156
|
+
billing_address,
|
157
|
+
customer,
|
158
|
+
metadata,
|
159
|
+
type,
|
160
|
+
holder_document,
|
161
|
+
deleted_at)
|
162
|
+
end
|
163
|
+
end
|
164
|
+
end
|
@@ -0,0 +1,89 @@
|
|
1
|
+
# This file was automatically generated by APIMATIC v2.0
|
2
|
+
# ( https://apimatic.io ).
|
3
|
+
|
4
|
+
module MundiApi
|
5
|
+
# Card token data
|
6
|
+
class GetCardTokenResponse < BaseModel
|
7
|
+
# TODO: Write general description for this method
|
8
|
+
# @return [String]
|
9
|
+
attr_accessor :last_four_digits
|
10
|
+
|
11
|
+
# TODO: Write general description for this method
|
12
|
+
# @return [String]
|
13
|
+
attr_accessor :holder_name
|
14
|
+
|
15
|
+
# TODO: Write general description for this method
|
16
|
+
# @return [String]
|
17
|
+
attr_accessor :holder_document
|
18
|
+
|
19
|
+
# TODO: Write general description for this method
|
20
|
+
# @return [String]
|
21
|
+
attr_accessor :exp_month
|
22
|
+
|
23
|
+
# TODO: Write general description for this method
|
24
|
+
# @return [String]
|
25
|
+
attr_accessor :exp_year
|
26
|
+
|
27
|
+
# TODO: Write general description for this method
|
28
|
+
# @return [String]
|
29
|
+
attr_accessor :brand
|
30
|
+
|
31
|
+
# TODO: Write general description for this method
|
32
|
+
# @return [String]
|
33
|
+
attr_accessor :type
|
34
|
+
|
35
|
+
# A mapping from model property names to API property names.
|
36
|
+
def self.names
|
37
|
+
if @_hash.nil?
|
38
|
+
@_hash = {}
|
39
|
+
@_hash['last_four_digits'] = 'last_four_digits'
|
40
|
+
@_hash['holder_name'] = 'holder_name'
|
41
|
+
@_hash['holder_document'] = 'holder_document'
|
42
|
+
@_hash['exp_month'] = 'exp_month'
|
43
|
+
@_hash['exp_year'] = 'exp_year'
|
44
|
+
@_hash['brand'] = 'brand'
|
45
|
+
@_hash['type'] = 'type'
|
46
|
+
end
|
47
|
+
@_hash
|
48
|
+
end
|
49
|
+
|
50
|
+
def initialize(last_four_digits = nil,
|
51
|
+
holder_name = nil,
|
52
|
+
holder_document = nil,
|
53
|
+
exp_month = nil,
|
54
|
+
exp_year = nil,
|
55
|
+
brand = nil,
|
56
|
+
type = nil)
|
57
|
+
@last_four_digits = last_four_digits
|
58
|
+
@holder_name = holder_name
|
59
|
+
@holder_document = holder_document
|
60
|
+
@exp_month = exp_month
|
61
|
+
@exp_year = exp_year
|
62
|
+
@brand = brand
|
63
|
+
@type = type
|
64
|
+
end
|
65
|
+
|
66
|
+
# Creates an instance of the object from a hash.
|
67
|
+
def self.from_hash(hash)
|
68
|
+
return nil unless hash
|
69
|
+
|
70
|
+
# Extract variables from the hash.
|
71
|
+
last_four_digits = hash['last_four_digits']
|
72
|
+
holder_name = hash['holder_name']
|
73
|
+
holder_document = hash['holder_document']
|
74
|
+
exp_month = hash['exp_month']
|
75
|
+
exp_year = hash['exp_year']
|
76
|
+
brand = hash['brand']
|
77
|
+
type = hash['type']
|
78
|
+
|
79
|
+
# Create object from extracted values.
|
80
|
+
GetCardTokenResponse.new(last_four_digits,
|
81
|
+
holder_name,
|
82
|
+
holder_document,
|
83
|
+
exp_month,
|
84
|
+
exp_year,
|
85
|
+
brand,
|
86
|
+
type)
|
87
|
+
end
|
88
|
+
end
|
89
|
+
end
|
@@ -0,0 +1,184 @@
|
|
1
|
+
# This file was automatically generated by APIMATIC v2.0
|
2
|
+
# ( https://apimatic.io ).
|
3
|
+
|
4
|
+
require 'date'
|
5
|
+
module MundiApi
|
6
|
+
# Response object for getting a charge
|
7
|
+
class GetChargeResponse < BaseModel
|
8
|
+
# TODO: Write general description for this method
|
9
|
+
# @return [String]
|
10
|
+
attr_accessor :id
|
11
|
+
|
12
|
+
# TODO: Write general description for this method
|
13
|
+
# @return [String]
|
14
|
+
attr_accessor :code
|
15
|
+
|
16
|
+
# TODO: Write general description for this method
|
17
|
+
# @return [String]
|
18
|
+
attr_accessor :gateway_id
|
19
|
+
|
20
|
+
# TODO: Write general description for this method
|
21
|
+
# @return [Integer]
|
22
|
+
attr_accessor :amount
|
23
|
+
|
24
|
+
# TODO: Write general description for this method
|
25
|
+
# @return [String]
|
26
|
+
attr_accessor :status
|
27
|
+
|
28
|
+
# TODO: Write general description for this method
|
29
|
+
# @return [String]
|
30
|
+
attr_accessor :currency
|
31
|
+
|
32
|
+
# TODO: Write general description for this method
|
33
|
+
# @return [String]
|
34
|
+
attr_accessor :payment_method
|
35
|
+
|
36
|
+
# TODO: Write general description for this method
|
37
|
+
# @return [DateTime]
|
38
|
+
attr_accessor :due_at
|
39
|
+
|
40
|
+
# TODO: Write general description for this method
|
41
|
+
# @return [DateTime]
|
42
|
+
attr_accessor :created_at
|
43
|
+
|
44
|
+
# TODO: Write general description for this method
|
45
|
+
# @return [DateTime]
|
46
|
+
attr_accessor :updated_at
|
47
|
+
|
48
|
+
# TODO: Write general description for this method
|
49
|
+
# @return [GetTransactionResponse]
|
50
|
+
attr_accessor :last_transaction
|
51
|
+
|
52
|
+
# TODO: Write general description for this method
|
53
|
+
# @return [GetInvoiceResponse]
|
54
|
+
attr_accessor :invoice
|
55
|
+
|
56
|
+
# TODO: Write general description for this method
|
57
|
+
# @return [GetOrderResponse]
|
58
|
+
attr_accessor :order
|
59
|
+
|
60
|
+
# TODO: Write general description for this method
|
61
|
+
# @return [GetCustomerResponse]
|
62
|
+
attr_accessor :customer
|
63
|
+
|
64
|
+
# TODO: Write general description for this method
|
65
|
+
# @return [Array<String, String>]
|
66
|
+
attr_accessor :metadata
|
67
|
+
|
68
|
+
# TODO: Write general description for this method
|
69
|
+
# @return [DateTime]
|
70
|
+
attr_accessor :paid_at
|
71
|
+
|
72
|
+
# TODO: Write general description for this method
|
73
|
+
# @return [DateTime]
|
74
|
+
attr_accessor :canceled_at
|
75
|
+
|
76
|
+
# A mapping from model property names to API property names.
|
77
|
+
def self.names
|
78
|
+
if @_hash.nil?
|
79
|
+
@_hash = {}
|
80
|
+
@_hash['id'] = 'id'
|
81
|
+
@_hash['code'] = 'code'
|
82
|
+
@_hash['gateway_id'] = 'gateway_id'
|
83
|
+
@_hash['amount'] = 'amount'
|
84
|
+
@_hash['status'] = 'status'
|
85
|
+
@_hash['currency'] = 'currency'
|
86
|
+
@_hash['payment_method'] = 'payment_method'
|
87
|
+
@_hash['due_at'] = 'due_at'
|
88
|
+
@_hash['created_at'] = 'created_at'
|
89
|
+
@_hash['updated_at'] = 'updated_at'
|
90
|
+
@_hash['last_transaction'] = 'last_transaction'
|
91
|
+
@_hash['invoice'] = 'invoice'
|
92
|
+
@_hash['order'] = 'order'
|
93
|
+
@_hash['customer'] = 'customer'
|
94
|
+
@_hash['metadata'] = 'metadata'
|
95
|
+
@_hash['paid_at'] = 'paid_at'
|
96
|
+
@_hash['canceled_at'] = 'canceled_at'
|
97
|
+
end
|
98
|
+
@_hash
|
99
|
+
end
|
100
|
+
|
101
|
+
def initialize(id = nil,
|
102
|
+
code = nil,
|
103
|
+
gateway_id = nil,
|
104
|
+
amount = nil,
|
105
|
+
status = nil,
|
106
|
+
currency = nil,
|
107
|
+
payment_method = nil,
|
108
|
+
due_at = nil,
|
109
|
+
created_at = nil,
|
110
|
+
updated_at = nil,
|
111
|
+
last_transaction = nil,
|
112
|
+
invoice = nil,
|
113
|
+
order = nil,
|
114
|
+
customer = nil,
|
115
|
+
metadata = nil,
|
116
|
+
paid_at = nil,
|
117
|
+
canceled_at = nil)
|
118
|
+
@id = id
|
119
|
+
@code = code
|
120
|
+
@gateway_id = gateway_id
|
121
|
+
@amount = amount
|
122
|
+
@status = status
|
123
|
+
@currency = currency
|
124
|
+
@payment_method = payment_method
|
125
|
+
@due_at = due_at
|
126
|
+
@created_at = created_at
|
127
|
+
@updated_at = updated_at
|
128
|
+
@last_transaction = last_transaction
|
129
|
+
@invoice = invoice
|
130
|
+
@order = order
|
131
|
+
@customer = customer
|
132
|
+
@metadata = metadata
|
133
|
+
@paid_at = paid_at
|
134
|
+
@canceled_at = canceled_at
|
135
|
+
end
|
136
|
+
|
137
|
+
# Creates an instance of the object from a hash.
|
138
|
+
def self.from_hash(hash)
|
139
|
+
return nil unless hash
|
140
|
+
|
141
|
+
# Extract variables from the hash.
|
142
|
+
id = hash['id']
|
143
|
+
code = hash['code']
|
144
|
+
gateway_id = hash['gateway_id']
|
145
|
+
amount = hash['amount']
|
146
|
+
status = hash['status']
|
147
|
+
currency = hash['currency']
|
148
|
+
payment_method = hash['payment_method']
|
149
|
+
due_at = DateTime.rfc3339(hash['due_at']) if hash['due_at']
|
150
|
+
created_at = DateTime.rfc3339(hash['created_at']) if hash['created_at']
|
151
|
+
updated_at = DateTime.rfc3339(hash['updated_at']) if hash['updated_at']
|
152
|
+
last_transaction = GetTransactionResponse.from_hash(hash['last_transaction']) if
|
153
|
+
hash['last_transaction']
|
154
|
+
invoice = GetInvoiceResponse.from_hash(hash['invoice']) if
|
155
|
+
hash['invoice']
|
156
|
+
order = GetOrderResponse.from_hash(hash['order']) if hash['order']
|
157
|
+
customer = GetCustomerResponse.from_hash(hash['customer']) if
|
158
|
+
hash['customer']
|
159
|
+
metadata = hash['metadata']
|
160
|
+
paid_at = DateTime.rfc3339(hash['paid_at']) if hash['paid_at']
|
161
|
+
canceled_at = DateTime.rfc3339(hash['canceled_at']) if
|
162
|
+
hash['canceled_at']
|
163
|
+
|
164
|
+
# Create object from extracted values.
|
165
|
+
GetChargeResponse.new(id,
|
166
|
+
code,
|
167
|
+
gateway_id,
|
168
|
+
amount,
|
169
|
+
status,
|
170
|
+
currency,
|
171
|
+
payment_method,
|
172
|
+
due_at,
|
173
|
+
created_at,
|
174
|
+
updated_at,
|
175
|
+
last_transaction,
|
176
|
+
invoice,
|
177
|
+
order,
|
178
|
+
customer,
|
179
|
+
metadata,
|
180
|
+
paid_at,
|
181
|
+
canceled_at)
|
182
|
+
end
|
183
|
+
end
|
184
|
+
end
|
@@ -0,0 +1,99 @@
|
|
1
|
+
# This file was automatically generated by APIMATIC v2.0
|
2
|
+
# ( https://apimatic.io ).
|
3
|
+
|
4
|
+
module MundiApi
|
5
|
+
# Checkout Payment Settings Response
|
6
|
+
class GetCheckoutPaymentSettingsResponse < BaseModel
|
7
|
+
# Success Url
|
8
|
+
# @return [String]
|
9
|
+
attr_accessor :success_url
|
10
|
+
|
11
|
+
# Payment Url
|
12
|
+
# @return [String]
|
13
|
+
attr_accessor :payment_url
|
14
|
+
|
15
|
+
# Accepted Payment Methods
|
16
|
+
# @return [List of String]
|
17
|
+
attr_accessor :accepted_payment_methods
|
18
|
+
|
19
|
+
# Status
|
20
|
+
# @return [String]
|
21
|
+
attr_accessor :status
|
22
|
+
|
23
|
+
# Customer
|
24
|
+
# @return [GetCustomerResponse]
|
25
|
+
attr_accessor :customer
|
26
|
+
|
27
|
+
# Payment amount
|
28
|
+
# @return [Integer]
|
29
|
+
attr_accessor :amount
|
30
|
+
|
31
|
+
# Default Payment Method
|
32
|
+
# @return [String]
|
33
|
+
attr_accessor :default_payment_method
|
34
|
+
|
35
|
+
# Gateway Affiliation Id
|
36
|
+
# @return [String]
|
37
|
+
attr_accessor :gateway_affiliation_id
|
38
|
+
|
39
|
+
# A mapping from model property names to API property names.
|
40
|
+
def self.names
|
41
|
+
if @_hash.nil?
|
42
|
+
@_hash = {}
|
43
|
+
@_hash['success_url'] = 'success_url'
|
44
|
+
@_hash['payment_url'] = 'payment_url'
|
45
|
+
@_hash['accepted_payment_methods'] = 'accepted_payment_methods'
|
46
|
+
@_hash['status'] = 'status'
|
47
|
+
@_hash['customer'] = 'customer'
|
48
|
+
@_hash['amount'] = 'amount'
|
49
|
+
@_hash['default_payment_method'] = 'default_payment_method'
|
50
|
+
@_hash['gateway_affiliation_id'] = 'gateway_affiliation_id'
|
51
|
+
end
|
52
|
+
@_hash
|
53
|
+
end
|
54
|
+
|
55
|
+
def initialize(success_url = nil,
|
56
|
+
payment_url = nil,
|
57
|
+
accepted_payment_methods = nil,
|
58
|
+
status = nil,
|
59
|
+
customer = nil,
|
60
|
+
amount = nil,
|
61
|
+
default_payment_method = nil,
|
62
|
+
gateway_affiliation_id = nil)
|
63
|
+
@success_url = success_url
|
64
|
+
@payment_url = payment_url
|
65
|
+
@accepted_payment_methods = accepted_payment_methods
|
66
|
+
@status = status
|
67
|
+
@customer = customer
|
68
|
+
@amount = amount
|
69
|
+
@default_payment_method = default_payment_method
|
70
|
+
@gateway_affiliation_id = gateway_affiliation_id
|
71
|
+
end
|
72
|
+
|
73
|
+
# Creates an instance of the object from a hash.
|
74
|
+
def self.from_hash(hash)
|
75
|
+
return nil unless hash
|
76
|
+
|
77
|
+
# Extract variables from the hash.
|
78
|
+
success_url = hash['success_url']
|
79
|
+
payment_url = hash['payment_url']
|
80
|
+
accepted_payment_methods = hash['accepted_payment_methods']
|
81
|
+
status = hash['status']
|
82
|
+
customer = GetCustomerResponse.from_hash(hash['customer']) if
|
83
|
+
hash['customer']
|
84
|
+
amount = hash['amount']
|
85
|
+
default_payment_method = hash['default_payment_method']
|
86
|
+
gateway_affiliation_id = hash['gateway_affiliation_id']
|
87
|
+
|
88
|
+
# Create object from extracted values.
|
89
|
+
GetCheckoutPaymentSettingsResponse.new(success_url,
|
90
|
+
payment_url,
|
91
|
+
accepted_payment_methods,
|
92
|
+
status,
|
93
|
+
customer,
|
94
|
+
amount,
|
95
|
+
default_payment_method,
|
96
|
+
gateway_affiliation_id)
|
97
|
+
end
|
98
|
+
end
|
99
|
+
end
|