mundi_api 0.9.1 → 0.13.7

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.
Files changed (144) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1755 -698
  3. data/lib/mundi_api.rb +75 -35
  4. data/lib/mundi_api/api_helper.rb +59 -7
  5. data/lib/mundi_api/controllers/charges_controller.rb +136 -97
  6. data/lib/mundi_api/controllers/customers_controller.rb +264 -253
  7. data/lib/mundi_api/controllers/invoices_controller.rb +97 -23
  8. data/lib/mundi_api/controllers/orders_controller.rb +247 -30
  9. data/lib/mundi_api/controllers/plans_controller.rb +108 -106
  10. data/lib/mundi_api/controllers/recipients_controller.rb +571 -0
  11. data/lib/mundi_api/controllers/sellers_controller.rb +244 -0
  12. data/lib/mundi_api/controllers/subscriptions_controller.rb +298 -108
  13. data/lib/mundi_api/models/create_access_token_request.rb +7 -9
  14. data/lib/mundi_api/models/create_address_request.rb +30 -14
  15. data/lib/mundi_api/models/create_anticipation_request.rb +53 -0
  16. data/lib/mundi_api/models/create_bank_account_request.rb +114 -0
  17. data/lib/mundi_api/models/create_bank_transfer_payment_request.rb +3 -5
  18. data/lib/mundi_api/models/create_boleto_payment_request.rb +18 -11
  19. data/lib/mundi_api/models/create_cancel_charge_request.rb +2 -4
  20. data/lib/mundi_api/models/create_cancel_subscription_request.rb +2 -4
  21. data/lib/mundi_api/models/create_capture_charge_request.rb +3 -5
  22. data/lib/mundi_api/models/create_card_options_request.rb +2 -4
  23. data/lib/mundi_api/models/create_card_request.rb +24 -17
  24. data/lib/mundi_api/models/create_card_token_request.rb +7 -9
  25. data/lib/mundi_api/models/create_charge_request.rb +8 -10
  26. data/lib/mundi_api/models/create_checkout_boleto_payment_request.rb +4 -6
  27. data/lib/mundi_api/models/create_checkout_card_installment_option_request.rb +3 -5
  28. data/lib/mundi_api/models/create_checkout_card_payment_request.rb +3 -5
  29. data/lib/mundi_api/models/create_checkout_payment_request.rb +55 -11
  30. data/lib/mundi_api/models/create_credit_card_payment_request.rb +28 -12
  31. data/lib/mundi_api/models/create_customer_request.rb +10 -12
  32. data/lib/mundi_api/models/create_device_request.rb +33 -0
  33. data/lib/mundi_api/models/create_discount_request.rb +5 -7
  34. data/lib/mundi_api/models/create_location_request.rb +42 -0
  35. data/lib/mundi_api/models/create_order_item_request.rb +15 -8
  36. data/lib/mundi_api/models/create_order_request.rb +57 -13
  37. data/lib/mundi_api/models/create_payment_request.rb +46 -13
  38. data/lib/mundi_api/models/create_phone_request.rb +4 -6
  39. data/lib/mundi_api/models/create_phones_request.rb +3 -5
  40. data/lib/mundi_api/models/create_plan_item_request.rb +7 -9
  41. data/lib/mundi_api/models/create_plan_request.rb +19 -21
  42. data/lib/mundi_api/models/create_price_bracket_request.rb +5 -7
  43. data/lib/mundi_api/models/create_pricing_scheme_request.rb +5 -7
  44. data/lib/mundi_api/models/create_recipient_request.rb +88 -0
  45. data/lib/mundi_api/models/create_seller_request.rb +21 -23
  46. data/lib/mundi_api/models/create_setup_request.rb +4 -6
  47. data/lib/mundi_api/models/create_shipping_request.rb +7 -9
  48. data/lib/mundi_api/models/create_split_request.rb +51 -0
  49. data/lib/mundi_api/models/create_subscription_item_request.rb +18 -11
  50. data/lib/mundi_api/models/create_subscription_request.rb +46 -30
  51. data/lib/mundi_api/models/create_token_request.rb +3 -5
  52. data/lib/mundi_api/models/create_transfer_request.rb +42 -0
  53. data/lib/mundi_api/models/create_usage_request.rb +4 -6
  54. data/lib/mundi_api/models/create_voucher_payment_request.rb +6 -8
  55. data/lib/mundi_api/models/get_access_token_response.rb +6 -8
  56. data/lib/mundi_api/models/get_address_response.rb +35 -19
  57. data/lib/mundi_api/models/get_anticipation_limit_response.rb +42 -0
  58. data/lib/mundi_api/models/get_anticipation_limits_response.rb +42 -0
  59. data/lib/mundi_api/models/get_anticipation_response.rb +117 -0
  60. data/lib/mundi_api/models/get_balance_response.rb +52 -0
  61. data/lib/mundi_api/models/get_bank_account_response.rb +161 -0
  62. data/lib/mundi_api/models/get_bank_transfer_transaction_response.rb +22 -9
  63. data/lib/mundi_api/models/get_billing_address_response.rb +29 -13
  64. data/lib/mundi_api/models/get_boleto_transaction_response.rb +96 -11
  65. data/lib/mundi_api/models/get_card_response.rb +16 -18
  66. data/lib/mundi_api/models/get_card_token_response.rb +8 -10
  67. data/lib/mundi_api/models/get_charge_response.rb +18 -20
  68. data/lib/mundi_api/models/get_checkout_boleto_payment_response.rb +43 -0
  69. data/lib/mundi_api/models/get_checkout_card_installment_options_response.rb +42 -0
  70. data/lib/mundi_api/models/get_checkout_card_payment_response.rb +49 -0
  71. data/lib/mundi_api/models/get_checkout_payment_response.rb +238 -0
  72. data/lib/mundi_api/models/get_checkout_payment_settings_response.rb +9 -11
  73. data/lib/mundi_api/models/get_credit_card_transaction_response.rb +36 -14
  74. data/lib/mundi_api/models/get_customer_response.rb +24 -17
  75. data/lib/mundi_api/models/get_device_response.rb +33 -0
  76. data/lib/mundi_api/models/get_discount_response.rb +9 -11
  77. data/lib/mundi_api/models/get_gateway_recipient_response.rb +69 -0
  78. data/lib/mundi_api/models/get_invoice_item_response.rb +27 -11
  79. data/lib/mundi_api/models/get_invoice_response.rb +29 -22
  80. data/lib/mundi_api/models/get_location_response.rb +42 -0
  81. data/lib/mundi_api/models/get_order_item_response.rb +28 -12
  82. data/lib/mundi_api/models/get_order_response.rb +64 -20
  83. data/lib/mundi_api/models/get_period_response.rb +6 -8
  84. data/lib/mundi_api/models/get_phone_response.rb +4 -6
  85. data/lib/mundi_api/models/get_phones_response.rb +3 -5
  86. data/lib/mundi_api/models/get_plan_item_response.rb +12 -14
  87. data/lib/mundi_api/models/get_plan_response.rb +22 -24
  88. data/lib/mundi_api/models/get_price_bracket_response.rb +5 -7
  89. data/lib/mundi_api/models/get_pricing_scheme_response.rb +5 -7
  90. data/lib/mundi_api/models/get_recipient_response.rb +150 -0
  91. data/lib/mundi_api/models/get_safety_pay_transaction_response.rb +21 -8
  92. data/lib/mundi_api/models/get_seller_response.rb +13 -15
  93. data/lib/mundi_api/models/get_sellers_request.rb +87 -0
  94. data/lib/mundi_api/models/get_setup_response.rb +5 -7
  95. data/lib/mundi_api/models/get_shipping_response.rb +6 -8
  96. data/lib/mundi_api/models/get_split_response.rb +52 -0
  97. data/lib/mundi_api/models/get_subscription_item_response.rb +24 -17
  98. data/lib/mundi_api/models/get_subscription_response.rb +44 -37
  99. data/lib/mundi_api/models/get_token_response.rb +6 -8
  100. data/lib/mundi_api/models/get_transaction_response.rb +37 -14
  101. data/lib/mundi_api/models/get_transfer_response.rb +89 -0
  102. data/lib/mundi_api/models/get_usage_response.rb +27 -11
  103. data/lib/mundi_api/models/get_voucher_transaction_response.rb +27 -14
  104. data/lib/mundi_api/models/list_access_tokens_response.rb +3 -5
  105. data/lib/mundi_api/models/list_addresses_response.rb +3 -5
  106. data/lib/mundi_api/models/list_anticipation_response.rb +49 -0
  107. data/lib/mundi_api/models/list_cards_response.rb +3 -5
  108. data/lib/mundi_api/models/list_charges_response.rb +3 -5
  109. data/lib/mundi_api/models/list_customers_response.rb +3 -5
  110. data/lib/mundi_api/models/list_invoices_response.rb +3 -5
  111. data/lib/mundi_api/models/list_order_response.rb +3 -5
  112. data/lib/mundi_api/models/list_plans_response.rb +3 -5
  113. data/lib/mundi_api/models/list_recipient_response.rb +49 -0
  114. data/lib/mundi_api/models/list_seller_response.rb +49 -0
  115. data/lib/mundi_api/models/list_subscription_items_response.rb +3 -5
  116. data/lib/mundi_api/models/list_subscriptions_response.rb +3 -5
  117. data/lib/mundi_api/models/list_transactions_response.rb +3 -5
  118. data/lib/mundi_api/models/list_transfer_response.rb +49 -0
  119. data/lib/mundi_api/models/list_usages_response.rb +3 -5
  120. data/lib/mundi_api/models/paging_response.rb +4 -6
  121. data/lib/mundi_api/models/update_address_request.rb +15 -8
  122. data/lib/mundi_api/models/update_card_request.rb +7 -9
  123. data/lib/mundi_api/models/update_charge_card_request.rb +5 -7
  124. data/lib/mundi_api/models/update_charge_due_date_request.rb +2 -4
  125. data/lib/mundi_api/models/update_charge_payment_method_request.rb +6 -8
  126. data/lib/mundi_api/models/update_customer_request.rb +23 -16
  127. data/lib/mundi_api/models/update_invoice_status_request.rb +33 -0
  128. data/lib/mundi_api/models/update_metadata_request.rb +2 -4
  129. data/lib/mundi_api/models/update_order_item_request.rb +60 -0
  130. data/lib/mundi_api/models/update_order_status_request.rb +33 -0
  131. data/lib/mundi_api/models/update_plan_item_request.rb +7 -9
  132. data/lib/mundi_api/models/update_plan_request.rb +16 -18
  133. data/lib/mundi_api/models/update_price_bracket_request.rb +5 -7
  134. data/lib/mundi_api/models/update_pricing_scheme_request.rb +5 -7
  135. data/lib/mundi_api/models/update_recipient_bank_account_request.rb +34 -0
  136. data/lib/mundi_api/models/update_recipient_request.rb +78 -0
  137. data/lib/mundi_api/models/update_seller_request.rb +97 -0
  138. data/lib/mundi_api/models/update_subscription_affiliation_id_request.rb +33 -0
  139. data/lib/mundi_api/models/update_subscription_billing_date_request.rb +2 -4
  140. data/lib/mundi_api/models/update_subscription_card_request.rb +3 -5
  141. data/lib/mundi_api/models/update_subscription_item_request.rb +16 -9
  142. data/lib/mundi_api/models/update_subscription_payment_method_request.rb +4 -6
  143. data/lib/mundi_api/mundi_api_client.rb +32 -20
  144. metadata +39 -3
@@ -0,0 +1,33 @@
1
+ # This file was automatically generated by APIMATIC v2.0
2
+ # ( https://apimatic.io ).
3
+
4
+ module MundiApi
5
+ # Response object for geetting an order device
6
+ class GetDeviceResponse < BaseModel
7
+ # Device's platform name
8
+ # @return [String]
9
+ attr_accessor :platform
10
+
11
+ # A mapping from model property names to API property names.
12
+ def self.names
13
+ @_hash = {} if @_hash.nil?
14
+ @_hash['platform'] = 'platform'
15
+ @_hash
16
+ end
17
+
18
+ def initialize(platform = nil)
19
+ @platform = platform
20
+ end
21
+
22
+ # Creates an instance of the object from a hash.
23
+ def self.from_hash(hash)
24
+ return nil unless hash
25
+
26
+ # Extract variables from the hash.
27
+ platform = hash['platform']
28
+
29
+ # Create object from extracted values.
30
+ GetDeviceResponse.new(platform)
31
+ end
32
+ end
33
+ end
@@ -39,17 +39,15 @@ module MundiApi
39
39
 
40
40
  # A mapping from model property names to API property names.
41
41
  def self.names
42
- if @_hash.nil?
43
- @_hash = {}
44
- @_hash['id'] = 'id'
45
- @_hash['value'] = 'value'
46
- @_hash['discount_type'] = 'discount_type'
47
- @_hash['status'] = 'status'
48
- @_hash['created_at'] = 'created_at'
49
- @_hash['subscription'] = 'subscription'
50
- @_hash['cycles'] = 'cycles'
51
- @_hash['deleted_at'] = 'deleted_at'
52
- end
42
+ @_hash = {} if @_hash.nil?
43
+ @_hash['id'] = 'id'
44
+ @_hash['value'] = 'value'
45
+ @_hash['discount_type'] = 'discount_type'
46
+ @_hash['status'] = 'status'
47
+ @_hash['created_at'] = 'created_at'
48
+ @_hash['subscription'] = 'subscription'
49
+ @_hash['cycles'] = 'cycles'
50
+ @_hash['deleted_at'] = 'deleted_at'
53
51
  @_hash
54
52
  end
55
53
 
@@ -0,0 +1,69 @@
1
+ # This file was automatically generated by APIMATIC v2.0
2
+ # ( https://apimatic.io ).
3
+
4
+ module MundiApi
5
+ # Information about the recipient on the gateway
6
+ class GetGatewayRecipientResponse < BaseModel
7
+ # Gateway name
8
+ # @return [String]
9
+ attr_accessor :gateway
10
+
11
+ # Status of the recipient on the gateway
12
+ # @return [String]
13
+ attr_accessor :status
14
+
15
+ # Recipient id on the gateway
16
+ # @return [String]
17
+ attr_accessor :pgid
18
+
19
+ # Creation date
20
+ # @return [String]
21
+ attr_accessor :created_at
22
+
23
+ # Last update date
24
+ # @return [String]
25
+ attr_accessor :updated_at
26
+
27
+ # A mapping from model property names to API property names.
28
+ def self.names
29
+ @_hash = {} if @_hash.nil?
30
+ @_hash['gateway'] = 'gateway'
31
+ @_hash['status'] = 'status'
32
+ @_hash['pgid'] = 'pgid'
33
+ @_hash['created_at'] = 'created_at'
34
+ @_hash['updated_at'] = 'updated_at'
35
+ @_hash
36
+ end
37
+
38
+ def initialize(gateway = nil,
39
+ status = nil,
40
+ pgid = nil,
41
+ created_at = nil,
42
+ updated_at = nil)
43
+ @gateway = gateway
44
+ @status = status
45
+ @pgid = pgid
46
+ @created_at = created_at
47
+ @updated_at = updated_at
48
+ end
49
+
50
+ # Creates an instance of the object from a hash.
51
+ def self.from_hash(hash)
52
+ return nil unless hash
53
+
54
+ # Extract variables from the hash.
55
+ gateway = hash['gateway']
56
+ status = hash['status']
57
+ pgid = hash['pgid']
58
+ created_at = hash['created_at']
59
+ updated_at = hash['updated_at']
60
+
61
+ # Create object from extracted values.
62
+ GetGatewayRecipientResponse.new(gateway,
63
+ status,
64
+ pgid,
65
+ created_at,
66
+ updated_at)
67
+ end
68
+ end
69
+ end
@@ -20,20 +20,28 @@ module MundiApi
20
20
  # @return [GetPriceBracketResponse]
21
21
  attr_accessor :price_bracket
22
22
 
23
- # TODO: Write general description for this method
23
+ # Subscription Item Id
24
+ # @return [String]
25
+ attr_accessor :subscription_item_id
26
+
27
+ # Subscription Item Id
24
28
  # @return [Integer]
25
29
  attr_accessor :quantity
26
30
 
31
+ # Subscription Item Id
32
+ # @return [String]
33
+ attr_accessor :name
34
+
27
35
  # A mapping from model property names to API property names.
28
36
  def self.names
29
- if @_hash.nil?
30
- @_hash = {}
31
- @_hash['amount'] = 'amount'
32
- @_hash['description'] = 'description'
33
- @_hash['pricing_scheme'] = 'pricing_scheme'
34
- @_hash['price_bracket'] = 'price_bracket'
35
- @_hash['quantity'] = 'quantity'
36
- end
37
+ @_hash = {} if @_hash.nil?
38
+ @_hash['amount'] = 'amount'
39
+ @_hash['description'] = 'description'
40
+ @_hash['pricing_scheme'] = 'pricing_scheme'
41
+ @_hash['price_bracket'] = 'price_bracket'
42
+ @_hash['subscription_item_id'] = 'subscription_item_id'
43
+ @_hash['quantity'] = 'quantity'
44
+ @_hash['name'] = 'name'
37
45
  @_hash
38
46
  end
39
47
 
@@ -41,12 +49,16 @@ module MundiApi
41
49
  description = nil,
42
50
  pricing_scheme = nil,
43
51
  price_bracket = nil,
44
- quantity = nil)
52
+ subscription_item_id = nil,
53
+ quantity = nil,
54
+ name = nil)
45
55
  @amount = amount
46
56
  @description = description
47
57
  @pricing_scheme = pricing_scheme
48
58
  @price_bracket = price_bracket
59
+ @subscription_item_id = subscription_item_id
49
60
  @quantity = quantity
61
+ @name = name
50
62
  end
51
63
 
52
64
  # Creates an instance of the object from a hash.
@@ -60,14 +72,18 @@ module MundiApi
60
72
  hash['pricing_scheme']
61
73
  price_bracket = GetPriceBracketResponse.from_hash(hash['price_bracket']) if
62
74
  hash['price_bracket']
75
+ subscription_item_id = hash['subscription_item_id']
63
76
  quantity = hash['quantity']
77
+ name = hash['name']
64
78
 
65
79
  # Create object from extracted values.
66
80
  GetInvoiceItemResponse.new(amount,
67
81
  description,
68
82
  pricing_scheme,
69
83
  price_bracket,
70
- quantity)
84
+ subscription_item_id,
85
+ quantity,
86
+ name)
71
87
  end
72
88
  end
73
89
  end
@@ -65,6 +65,10 @@ module MundiApi
65
65
  # @return [GetShippingResponse]
66
66
  attr_accessor :shipping
67
67
 
68
+ # TODO: Write general description for this method
69
+ # @return [Array<String, String>]
70
+ attr_accessor :metadata
71
+
68
72
  # TODO: Write general description for this method
69
73
  # @return [DateTime]
70
74
  attr_accessor :due_at
@@ -83,28 +87,27 @@ module MundiApi
83
87
 
84
88
  # A mapping from model property names to API property names.
85
89
  def self.names
86
- if @_hash.nil?
87
- @_hash = {}
88
- @_hash['id'] = 'id'
89
- @_hash['code'] = 'code'
90
- @_hash['url'] = 'url'
91
- @_hash['amount'] = 'amount'
92
- @_hash['status'] = 'status'
93
- @_hash['payment_method'] = 'payment_method'
94
- @_hash['created_at'] = 'created_at'
95
- @_hash['items'] = 'items'
96
- @_hash['customer'] = 'customer'
97
- @_hash['charge'] = 'charge'
98
- @_hash['installments'] = 'installments'
99
- @_hash['billing_address'] = 'billing_address'
100
- @_hash['subscription'] = 'subscription'
101
- @_hash['cycle'] = 'cycle'
102
- @_hash['shipping'] = 'shipping'
103
- @_hash['due_at'] = 'due_at'
104
- @_hash['canceled_at'] = 'canceled_at'
105
- @_hash['billing_at'] = 'billing_at'
106
- @_hash['seen_at'] = 'seen_at'
107
- end
90
+ @_hash = {} if @_hash.nil?
91
+ @_hash['id'] = 'id'
92
+ @_hash['code'] = 'code'
93
+ @_hash['url'] = 'url'
94
+ @_hash['amount'] = 'amount'
95
+ @_hash['status'] = 'status'
96
+ @_hash['payment_method'] = 'payment_method'
97
+ @_hash['created_at'] = 'created_at'
98
+ @_hash['items'] = 'items'
99
+ @_hash['customer'] = 'customer'
100
+ @_hash['charge'] = 'charge'
101
+ @_hash['installments'] = 'installments'
102
+ @_hash['billing_address'] = 'billing_address'
103
+ @_hash['subscription'] = 'subscription'
104
+ @_hash['cycle'] = 'cycle'
105
+ @_hash['shipping'] = 'shipping'
106
+ @_hash['metadata'] = 'metadata'
107
+ @_hash['due_at'] = 'due_at'
108
+ @_hash['canceled_at'] = 'canceled_at'
109
+ @_hash['billing_at'] = 'billing_at'
110
+ @_hash['seen_at'] = 'seen_at'
108
111
  @_hash
109
112
  end
110
113
 
@@ -123,6 +126,7 @@ module MundiApi
123
126
  subscription = nil,
124
127
  cycle = nil,
125
128
  shipping = nil,
129
+ metadata = nil,
126
130
  due_at = nil,
127
131
  canceled_at = nil,
128
132
  billing_at = nil,
@@ -142,6 +146,7 @@ module MundiApi
142
146
  @subscription = subscription
143
147
  @cycle = cycle
144
148
  @shipping = shipping
149
+ @metadata = metadata
145
150
  @due_at = due_at
146
151
  @canceled_at = canceled_at
147
152
  @billing_at = billing_at
@@ -179,6 +184,7 @@ module MundiApi
179
184
  cycle = GetPeriodResponse.from_hash(hash['cycle']) if hash['cycle']
180
185
  shipping = GetShippingResponse.from_hash(hash['shipping']) if
181
186
  hash['shipping']
187
+ metadata = hash['metadata']
182
188
  due_at = DateTime.rfc3339(hash['due_at']) if hash['due_at']
183
189
  canceled_at = DateTime.rfc3339(hash['canceled_at']) if
184
190
  hash['canceled_at']
@@ -201,6 +207,7 @@ module MundiApi
201
207
  subscription,
202
208
  cycle,
203
209
  shipping,
210
+ metadata,
204
211
  due_at,
205
212
  canceled_at,
206
213
  billing_at,
@@ -0,0 +1,42 @@
1
+ # This file was automatically generated by APIMATIC v2.0
2
+ # ( https://apimatic.io ).
3
+
4
+ module MundiApi
5
+ # Response object for geetting an order location request
6
+ class GetLocationResponse < BaseModel
7
+ # Latitude
8
+ # @return [String]
9
+ attr_accessor :latitude
10
+
11
+ # Longitude
12
+ # @return [String]
13
+ attr_accessor :longitude
14
+
15
+ # A mapping from model property names to API property names.
16
+ def self.names
17
+ @_hash = {} if @_hash.nil?
18
+ @_hash['latitude'] = 'latitude'
19
+ @_hash['longitude'] = 'longitude'
20
+ @_hash
21
+ end
22
+
23
+ def initialize(latitude = nil,
24
+ longitude = nil)
25
+ @latitude = latitude
26
+ @longitude = longitude
27
+ end
28
+
29
+ # Creates an instance of the object from a hash.
30
+ def self.from_hash(hash)
31
+ return nil unless hash
32
+
33
+ # Extract variables from the hash.
34
+ latitude = hash['latitude']
35
+ longitude = hash['longitude']
36
+
37
+ # Create object from extracted values.
38
+ GetLocationResponse.new(latitude,
39
+ longitude)
40
+ end
41
+ end
42
+ end
@@ -4,41 +4,53 @@
4
4
  module MundiApi
5
5
  # Response object for getting an order item
6
6
  class GetOrderItemResponse < BaseModel
7
- # TODO: Write general description for this method
7
+ # Id
8
+ # @return [String]
9
+ attr_accessor :id
10
+
11
+ # Id
8
12
  # @return [Integer]
9
13
  attr_accessor :amount
10
14
 
11
- # TODO: Write general description for this method
15
+ # Id
12
16
  # @return [String]
13
17
  attr_accessor :description
14
18
 
15
- # TODO: Write general description for this method
19
+ # Id
16
20
  # @return [Integer]
17
21
  attr_accessor :quantity
18
22
 
23
+ # Category
24
+ # @return [String]
25
+ attr_accessor :category
26
+
19
27
  # Seller data
20
28
  # @return [GetSellerResponse]
21
29
  attr_accessor :get_seller_response
22
30
 
23
31
  # A mapping from model property names to API property names.
24
32
  def self.names
25
- if @_hash.nil?
26
- @_hash = {}
27
- @_hash['amount'] = 'amount'
28
- @_hash['description'] = 'description'
29
- @_hash['quantity'] = 'quantity'
30
- @_hash['get_seller_response'] = 'GetSellerResponse'
31
- end
33
+ @_hash = {} if @_hash.nil?
34
+ @_hash['id'] = 'Id'
35
+ @_hash['amount'] = 'amount'
36
+ @_hash['description'] = 'description'
37
+ @_hash['quantity'] = 'quantity'
38
+ @_hash['category'] = 'category'
39
+ @_hash['get_seller_response'] = 'GetSellerResponse'
32
40
  @_hash
33
41
  end
34
42
 
35
- def initialize(amount = nil,
43
+ def initialize(id = nil,
44
+ amount = nil,
36
45
  description = nil,
37
46
  quantity = nil,
47
+ category = nil,
38
48
  get_seller_response = nil)
49
+ @id = id
39
50
  @amount = amount
40
51
  @description = description
41
52
  @quantity = quantity
53
+ @category = category
42
54
  @get_seller_response = get_seller_response
43
55
  end
44
56
 
@@ -47,16 +59,20 @@ module MundiApi
47
59
  return nil unless hash
48
60
 
49
61
  # Extract variables from the hash.
62
+ id = hash['Id']
50
63
  amount = hash['amount']
51
64
  description = hash['description']
52
65
  quantity = hash['quantity']
66
+ category = hash['category']
53
67
  get_seller_response = GetSellerResponse.from_hash(hash['GetSellerResponse']) if
54
68
  hash['GetSellerResponse']
55
69
 
56
70
  # Create object from extracted values.
57
- GetOrderItemResponse.new(amount,
71
+ GetOrderItemResponse.new(id,
72
+ amount,
58
73
  description,
59
74
  quantity,
75
+ category,
60
76
  get_seller_response)
61
77
  end
62
78
  end
@@ -53,28 +53,51 @@ module MundiApi
53
53
  # @return [Array<String, String>]
54
54
  attr_accessor :metadata
55
55
 
56
+ # Indicates whether the order is closed
57
+ # @return [Boolean]
58
+ attr_accessor :closed
59
+
56
60
  # Checkout Payment Settings Response
57
- # @return [List of GetCheckoutPaymentSettingsResponse]
61
+ # @return [List of GetCheckoutPaymentResponse]
58
62
  attr_accessor :checkouts
59
63
 
64
+ # Ip address
65
+ # @return [String]
66
+ attr_accessor :ip
67
+
68
+ # Session id
69
+ # @return [String]
70
+ attr_accessor :session_id
71
+
72
+ # Location
73
+ # @return [GetLocationResponse]
74
+ attr_accessor :location
75
+
76
+ # Device's informations
77
+ # @return [GetDeviceResponse]
78
+ attr_accessor :device
79
+
60
80
  # A mapping from model property names to API property names.
61
81
  def self.names
62
- if @_hash.nil?
63
- @_hash = {}
64
- @_hash['id'] = 'id'
65
- @_hash['code'] = 'code'
66
- @_hash['currency'] = 'currency'
67
- @_hash['items'] = 'items'
68
- @_hash['customer'] = 'customer'
69
- @_hash['status'] = 'status'
70
- @_hash['created_at'] = 'created_at'
71
- @_hash['updated_at'] = 'updated_at'
72
- @_hash['charges'] = 'charges'
73
- @_hash['invoice_url'] = 'invoice_url'
74
- @_hash['shipping'] = 'shipping'
75
- @_hash['metadata'] = 'metadata'
76
- @_hash['checkouts'] = 'checkouts'
77
- end
82
+ @_hash = {} if @_hash.nil?
83
+ @_hash['id'] = 'id'
84
+ @_hash['code'] = 'code'
85
+ @_hash['currency'] = 'currency'
86
+ @_hash['items'] = 'items'
87
+ @_hash['customer'] = 'customer'
88
+ @_hash['status'] = 'status'
89
+ @_hash['created_at'] = 'created_at'
90
+ @_hash['updated_at'] = 'updated_at'
91
+ @_hash['charges'] = 'charges'
92
+ @_hash['invoice_url'] = 'invoice_url'
93
+ @_hash['shipping'] = 'shipping'
94
+ @_hash['metadata'] = 'metadata'
95
+ @_hash['closed'] = 'closed'
96
+ @_hash['checkouts'] = 'checkouts'
97
+ @_hash['ip'] = 'ip'
98
+ @_hash['session_id'] = 'session_id'
99
+ @_hash['location'] = 'location'
100
+ @_hash['device'] = 'device'
78
101
  @_hash
79
102
  end
80
103
 
@@ -90,7 +113,12 @@ module MundiApi
90
113
  invoice_url = nil,
91
114
  shipping = nil,
92
115
  metadata = nil,
93
- checkouts = nil)
116
+ closed = nil,
117
+ checkouts = nil,
118
+ ip = nil,
119
+ session_id = nil,
120
+ location = nil,
121
+ device = nil)
94
122
  @id = id
95
123
  @code = code
96
124
  @currency = currency
@@ -103,7 +131,12 @@ module MundiApi
103
131
  @invoice_url = invoice_url
104
132
  @shipping = shipping
105
133
  @metadata = metadata
134
+ @closed = closed
106
135
  @checkouts = checkouts
136
+ @ip = ip
137
+ @session_id = session_id
138
+ @location = location
139
+ @device = device
107
140
  end
108
141
 
109
142
  # Creates an instance of the object from a hash.
@@ -139,14 +172,20 @@ module MundiApi
139
172
  shipping = GetShippingResponse.from_hash(hash['shipping']) if
140
173
  hash['shipping']
141
174
  metadata = hash['metadata']
175
+ closed = hash['closed']
142
176
  # Parameter is an array, so we need to iterate through it
143
177
  checkouts = nil
144
178
  unless hash['checkouts'].nil?
145
179
  checkouts = []
146
180
  hash['checkouts'].each do |structure|
147
- checkouts << (GetCheckoutPaymentSettingsResponse.from_hash(structure) if structure)
181
+ checkouts << (GetCheckoutPaymentResponse.from_hash(structure) if structure)
148
182
  end
149
183
  end
184
+ ip = hash['ip']
185
+ session_id = hash['session_id']
186
+ location = GetLocationResponse.from_hash(hash['location']) if
187
+ hash['location']
188
+ device = GetDeviceResponse.from_hash(hash['device']) if hash['device']
150
189
 
151
190
  # Create object from extracted values.
152
191
  GetOrderResponse.new(id,
@@ -161,7 +200,12 @@ module MundiApi
161
200
  invoice_url,
162
201
  shipping,
163
202
  metadata,
164
- checkouts)
203
+ closed,
204
+ checkouts,
205
+ ip,
206
+ session_id,
207
+ location,
208
+ device)
165
209
  end
166
210
  end
167
211
  end