mercadopago-sdk 0.3.6 → 2.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.editorconfig +10 -0
- data/.github/ISSUE_TEMPLATE/bug_report.md +28 -0
- data/.github/ISSUE_TEMPLATE/feature_request.md +19 -0
- data/.github/workflows/ruby.yml +35 -0
- data/.gitignore +2 -1
- data/.rubocop.yml +1 -0
- data/.rubocop_todo.yml +104 -0
- data/.ruby-version +1 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/CODING_GUIDELINES.md +70 -0
- data/CONTRIBUTING.md +57 -0
- data/Gemfile +8 -0
- data/Gemfile.lock +51 -12
- data/LICENSE.txt +21 -0
- data/README.md +54 -143
- data/Rakefile +3 -1
- data/docs/CODE_OF_CONDUCT_md.html +154 -0
- data/docs/CODING_GUIDELINES_md.html +188 -0
- data/docs/CONTRIBUTING_md.html +165 -0
- data/docs/LICENSE_txt.html +96 -0
- data/docs/Mercadopago.html +123 -0
- data/docs/Mercadopago/AdvancedPayment.html +279 -0
- data/docs/Mercadopago/Card.html +204 -0
- data/docs/Mercadopago/CardToken.html +160 -0
- data/docs/Mercadopago/Config.html +266 -0
- data/docs/Mercadopago/Customer.html +228 -0
- data/docs/Mercadopago/DisbursementRefund.html +183 -0
- data/docs/Mercadopago/HttpClient.html +249 -0
- data/docs/Mercadopago/IdentificationType.html +136 -0
- data/docs/Mercadopago/MPBase.html +316 -0
- data/docs/Mercadopago/MerchantOrder.html +209 -0
- data/docs/Mercadopago/Payment.html +208 -0
- data/docs/Mercadopago/PaymentMethods.html +136 -0
- data/docs/Mercadopago/Preference.html +184 -0
- data/docs/Mercadopago/Refund.html +160 -0
- data/docs/Mercadopago/RequestOptions.html +433 -0
- data/docs/Mercadopago/SDK.html +528 -0
- data/docs/Mercadopago/User.html +136 -0
- data/docs/README_md.html +181 -0
- data/docs/created.rid +25 -0
- data/docs/css/fonts.css +167 -0
- data/docs/css/rdoc.css +619 -0
- data/docs/fonts/Lato-Light.ttf +0 -0
- data/docs/fonts/Lato-LightItalic.ttf +0 -0
- data/docs/fonts/Lato-Regular.ttf +0 -0
- data/docs/fonts/Lato-RegularItalic.ttf +0 -0
- data/docs/fonts/SourceCodePro-Bold.ttf +0 -0
- data/docs/fonts/SourceCodePro-Regular.ttf +0 -0
- data/docs/images/add.png +0 -0
- data/docs/images/arrow_up.png +0 -0
- data/docs/images/brick.png +0 -0
- data/docs/images/brick_link.png +0 -0
- data/docs/images/bug.png +0 -0
- data/docs/images/bullet_black.png +0 -0
- data/docs/images/bullet_toggle_minus.png +0 -0
- data/docs/images/bullet_toggle_plus.png +0 -0
- data/docs/images/date.png +0 -0
- data/docs/images/delete.png +0 -0
- data/docs/images/find.png +0 -0
- data/docs/images/loadingAnimation.gif +0 -0
- data/docs/images/macFFBgHack.png +0 -0
- data/docs/images/package.png +0 -0
- data/docs/images/page_green.png +0 -0
- data/docs/images/page_white_text.png +0 -0
- data/docs/images/page_white_width.png +0 -0
- data/docs/images/plugin.png +0 -0
- data/docs/images/ruby.png +0 -0
- data/docs/images/tag_blue.png +0 -0
- data/docs/images/tag_green.png +0 -0
- data/docs/images/transparent.png +0 -0
- data/docs/images/wrench.png +0 -0
- data/docs/images/wrench_orange.png +0 -0
- data/docs/images/zoom.png +0 -0
- data/docs/index.html +109 -0
- data/docs/js/darkfish.js +84 -0
- data/docs/js/navigation.js +105 -0
- data/docs/js/navigation.js.gz +0 -0
- data/docs/js/search.js +110 -0
- data/docs/js/search_index.js +1 -0
- data/docs/js/search_index.js.gz +0 -0
- data/docs/js/searcher.js +229 -0
- data/docs/js/searcher.js.gz +0 -0
- data/docs/table_of_contents.html +562 -0
- data/lib/mercadopago.rb +24 -349
- data/lib/mercadopago/config/config.rb +42 -0
- data/lib/mercadopago/config/request_options.rb +85 -0
- data/lib/mercadopago/core/mp_base.rb +77 -0
- data/lib/mercadopago/http/http_client.rb +74 -0
- data/lib/mercadopago/resources/advanced_payment.rb +48 -0
- data/lib/mercadopago/resources/card.rb +31 -0
- data/lib/mercadopago/resources/card_token.rb +19 -0
- data/lib/mercadopago/resources/customer.rb +36 -0
- data/lib/mercadopago/resources/disbursement_refund.rb +24 -0
- data/lib/mercadopago/resources/identification_type.rb +13 -0
- data/lib/mercadopago/resources/merchant_order.rb +32 -0
- data/lib/mercadopago/resources/payment.rb +35 -0
- data/lib/mercadopago/resources/payment_methods.rb +13 -0
- data/lib/mercadopago/resources/preference.rb +26 -0
- data/lib/mercadopago/resources/refund.rb +24 -0
- data/lib/mercadopago/resources/user.rb +13 -0
- data/lib/mercadopago/sdk.rb +85 -0
- data/mercadopago.gemspec +15 -15
- data/tests/test_card.rb +79 -0
- data/tests/test_card_token.rb +39 -0
- data/tests/test_customer.rb +54 -0
- data/tests/test_identification_type.rb +16 -0
- data/tests/test_merchant_order.rb +94 -0
- data/tests/test_payment.rb +102 -0
- data/tests/test_payment_methods.rb +14 -0
- data/tests/test_preference.rb +49 -0
- data/tests/test_refund.rb +88 -0
- data/tests/test_user.rb +17 -0
- data/tests/tests.rb +12 -56
- metadata +154 -37
- data/examples/checkout-buttons/basic_preference/button.rb +0 -28
- data/examples/instant-payment-notifications/receive-ipn.rb +0 -25
- data/examples/payment-search/search-approved-payments.rb +0 -23
- data/examples/payment-search/search-creditcard-payments.rb +0 -23
- data/examples/payment-search/search-funded-payments-by-name.rb +0 -23
- data/examples/payment-search/search-payments-from-email-and-date.rb +0 -23
- data/examples/payment-search/search-payments.rb +0 -23
- data/examples/preapproval-payments/button.rb +0 -42
- data/lib/ssl_options_patch.rb +0 -15
- data/lib/version.rb +0 -1
- data/mercadopago-sdk-0.3.2.gem +0 -0
- data/mercadopago-sdk-0.3.3.gem +0 -0
@@ -0,0 +1,316 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta charset="UTF-8">
|
6
|
+
|
7
|
+
<title>class Mercadopago::MPBase - RDoc Documentation</title>
|
8
|
+
|
9
|
+
<script type="text/javascript">
|
10
|
+
var rdoc_rel_prefix = "../";
|
11
|
+
var index_rel_prefix = "../";
|
12
|
+
</script>
|
13
|
+
|
14
|
+
<script src="../js/navigation.js" defer></script>
|
15
|
+
<script src="../js/search.js" defer></script>
|
16
|
+
<script src="../js/search_index.js" defer></script>
|
17
|
+
<script src="../js/searcher.js" defer></script>
|
18
|
+
<script src="../js/darkfish.js" defer></script>
|
19
|
+
|
20
|
+
<link href="../css/fonts.css" rel="stylesheet">
|
21
|
+
<link href="../css/rdoc.css" rel="stylesheet">
|
22
|
+
|
23
|
+
|
24
|
+
<body id="top" role="document" class="class">
|
25
|
+
<nav role="navigation">
|
26
|
+
<div id="project-navigation">
|
27
|
+
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
28
|
+
<h2>
|
29
|
+
<a href="../index.html" rel="home">Home</a>
|
30
|
+
</h2>
|
31
|
+
|
32
|
+
<div id="table-of-contents-navigation">
|
33
|
+
<a href="../table_of_contents.html#pages">Pages</a>
|
34
|
+
<a href="../table_of_contents.html#classes">Classes</a>
|
35
|
+
<a href="../table_of_contents.html#methods">Methods</a>
|
36
|
+
</div>
|
37
|
+
</div>
|
38
|
+
|
39
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
40
|
+
<form action="#" method="get" accept-charset="utf-8">
|
41
|
+
<div id="search-field-wrapper">
|
42
|
+
<input id="search-field" role="combobox" aria-label="Search"
|
43
|
+
aria-autocomplete="list" aria-controls="search-results"
|
44
|
+
type="text" name="search" placeholder="Search" spellcheck="false"
|
45
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
46
|
+
</div>
|
47
|
+
|
48
|
+
<ul id="search-results" aria-label="Search Results"
|
49
|
+
aria-busy="false" aria-expanded="false"
|
50
|
+
aria-atomic="false" class="initially-hidden"></ul>
|
51
|
+
</form>
|
52
|
+
</div>
|
53
|
+
|
54
|
+
</div>
|
55
|
+
|
56
|
+
|
57
|
+
|
58
|
+
<div id="class-metadata">
|
59
|
+
|
60
|
+
|
61
|
+
<div id="parent-class-section" class="nav-section">
|
62
|
+
<h3>Parent</h3>
|
63
|
+
|
64
|
+
<p class="link">Object
|
65
|
+
</div>
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
<!-- Method Quickref -->
|
71
|
+
<div id="method-list-section" class="nav-section">
|
72
|
+
<h3>Methods</h3>
|
73
|
+
|
74
|
+
<ul class="link-list" role="directory">
|
75
|
+
<li ><a href="#method-c-new">::new</a>
|
76
|
+
<li ><a href="#method-i-_check_headers">#_check_headers</a>
|
77
|
+
<li ><a href="#method-i-_check_request_options">#_check_request_options</a>
|
78
|
+
<li ><a href="#method-i-_delete">#_delete</a>
|
79
|
+
<li ><a href="#method-i-_get">#_get</a>
|
80
|
+
<li ><a href="#method-i-_post">#_post</a>
|
81
|
+
<li ><a href="#method-i-_put">#_put</a>
|
82
|
+
</ul>
|
83
|
+
</div>
|
84
|
+
|
85
|
+
</div>
|
86
|
+
</nav>
|
87
|
+
|
88
|
+
<main role="main" aria-labelledby="class-Mercadopago::MPBase">
|
89
|
+
<h1 id="class-Mercadopago::MPBase" class="class">
|
90
|
+
class Mercadopago::MPBase
|
91
|
+
</h1>
|
92
|
+
|
93
|
+
<section class="description">
|
94
|
+
|
95
|
+
<p>Module Base</p>
|
96
|
+
|
97
|
+
</section>
|
98
|
+
|
99
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
100
|
+
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
<section id="public-class-5Buntitled-5D-method-details" class="method-section">
|
106
|
+
<header>
|
107
|
+
<h3>Public Class Methods</h3>
|
108
|
+
</header>
|
109
|
+
|
110
|
+
<div id="method-c-new" class="method-detail ">
|
111
|
+
<div class="method-heading">
|
112
|
+
<span class="method-name">new</span><span
|
113
|
+
class="method-args">(request_options, http_client)</span>
|
114
|
+
<span class="method-click-advice">click to toggle source</span>
|
115
|
+
</div>
|
116
|
+
|
117
|
+
<div class="method-description">
|
118
|
+
|
119
|
+
|
120
|
+
<div class="method-source-code" id="new-source">
|
121
|
+
<pre><span class="ruby-comment"># File lib/mercadopago/core/mp_base.rb, line 8</span>
|
122
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">initialize</span>(<span class="ruby-identifier">request_options</span>, <span class="ruby-identifier">http_client</span>)
|
123
|
+
<span class="ruby-keyword">unless</span> <span class="ruby-identifier">request_options</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">RequestOptions</span>)
|
124
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">TypeError</span>,
|
125
|
+
<span class="ruby-string">'Param request_options must be a RequestOptions object'</span>
|
126
|
+
<span class="ruby-keyword">end</span>
|
127
|
+
|
128
|
+
<span class="ruby-ivar">@request_options</span> = <span class="ruby-identifier">request_options</span>
|
129
|
+
<span class="ruby-ivar">@http_client</span> = <span class="ruby-identifier">http_client</span>
|
130
|
+
<span class="ruby-ivar">@config</span> = <span class="ruby-constant">Config</span>.<span class="ruby-identifier">new</span>
|
131
|
+
<span class="ruby-keyword">end</span></pre>
|
132
|
+
</div>
|
133
|
+
</div>
|
134
|
+
|
135
|
+
|
136
|
+
</div>
|
137
|
+
|
138
|
+
</section>
|
139
|
+
|
140
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section">
|
141
|
+
<header>
|
142
|
+
<h3>Public Instance Methods</h3>
|
143
|
+
</header>
|
144
|
+
|
145
|
+
<div id="method-i-_check_headers" class="method-detail ">
|
146
|
+
<div class="method-heading">
|
147
|
+
<span class="method-name">_check_headers</span><span
|
148
|
+
class="method-args">(request_options = nil, extra_headers = nil)</span>
|
149
|
+
<span class="method-click-advice">click to toggle source</span>
|
150
|
+
</div>
|
151
|
+
|
152
|
+
<div class="method-description">
|
153
|
+
|
154
|
+
|
155
|
+
<div class="method-source-code" id="_check_headers-source">
|
156
|
+
<pre><span class="ruby-comment"># File lib/mercadopago/core/mp_base.rb, line 31</span>
|
157
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">_check_headers</span>(<span class="ruby-identifier">request_options</span> = <span class="ruby-keyword">nil</span>, <span class="ruby-identifier">extra_headers</span> = <span class="ruby-keyword">nil</span>)
|
158
|
+
<span class="ruby-identifier">headers</span> = <span class="ruby-identifier">request_options</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">request_options</span>.<span class="ruby-identifier">get_headers</span> <span class="ruby-operator">:</span> <span class="ruby-ivar">@request_options</span>.<span class="ruby-identifier">get_headers</span>
|
159
|
+
|
160
|
+
<span class="ruby-identifier">headers</span>.<span class="ruby-identifier">merge!</span>(<span class="ruby-identifier">extra_headers</span>) <span class="ruby-keyword">unless</span> <span class="ruby-identifier">extra_headers</span>.<span class="ruby-identifier">nil?</span>
|
161
|
+
|
162
|
+
<span class="ruby-identifier">headers</span>
|
163
|
+
<span class="ruby-keyword">end</span></pre>
|
164
|
+
</div>
|
165
|
+
</div>
|
166
|
+
|
167
|
+
|
168
|
+
</div>
|
169
|
+
|
170
|
+
<div id="method-i-_check_request_options" class="method-detail ">
|
171
|
+
<div class="method-heading">
|
172
|
+
<span class="method-name">_check_request_options</span><span
|
173
|
+
class="method-args">(request_options = nil)</span>
|
174
|
+
<span class="method-click-advice">click to toggle source</span>
|
175
|
+
</div>
|
176
|
+
|
177
|
+
<div class="method-description">
|
178
|
+
|
179
|
+
|
180
|
+
<div class="method-source-code" id="_check_request_options-source">
|
181
|
+
<pre><span class="ruby-comment"># File lib/mercadopago/core/mp_base.rb, line 19</span>
|
182
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">_check_request_options</span>(<span class="ruby-identifier">request_options</span> = <span class="ruby-keyword">nil</span>)
|
183
|
+
<span class="ruby-identifier">request_options</span> = <span class="ruby-ivar">@request_options</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">request_options</span>.<span class="ruby-identifier">nil?</span>
|
184
|
+
<span class="ruby-keyword">unless</span> <span class="ruby-identifier">request_options</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">RequestOptions</span>)
|
185
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">TypeError</span>,
|
186
|
+
<span class="ruby-string">'Param request_options must be a RequestOptions object'</span>
|
187
|
+
<span class="ruby-keyword">end</span>
|
188
|
+
|
189
|
+
<span class="ruby-identifier">request_options</span>.<span class="ruby-identifier">access_token</span> = <span class="ruby-ivar">@request_options</span>.<span class="ruby-identifier">access_token</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">request_options</span>.<span class="ruby-identifier">access_token</span>.<span class="ruby-identifier">nil?</span>
|
190
|
+
|
191
|
+
<span class="ruby-identifier">request_options</span>
|
192
|
+
<span class="ruby-keyword">end</span></pre>
|
193
|
+
</div>
|
194
|
+
</div>
|
195
|
+
|
196
|
+
|
197
|
+
</div>
|
198
|
+
|
199
|
+
<div id="method-i-_delete" class="method-detail ">
|
200
|
+
<div class="method-heading">
|
201
|
+
<span class="method-name">_delete</span><span
|
202
|
+
class="method-args">(uri:, request_options: nil)</span>
|
203
|
+
<span class="method-click-advice">click to toggle source</span>
|
204
|
+
</div>
|
205
|
+
|
206
|
+
<div class="method-description">
|
207
|
+
|
208
|
+
|
209
|
+
<div class="method-source-code" id="_delete-source">
|
210
|
+
<pre><span class="ruby-comment"># File lib/mercadopago/core/mp_base.rb, line 69</span>
|
211
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">_delete</span>(<span class="ruby-value">uri:</span>, <span class="ruby-value">request_options:</span> <span class="ruby-keyword">nil</span>)
|
212
|
+
<span class="ruby-identifier">request_options</span> = <span class="ruby-identifier">_check_request_options</span>(<span class="ruby-identifier">request_options</span>)
|
213
|
+
<span class="ruby-identifier">headers</span> = <span class="ruby-identifier">_check_headers</span>(<span class="ruby-identifier">request_options</span>)
|
214
|
+
|
215
|
+
<span class="ruby-ivar">@http_client</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-value">url:</span> <span class="ruby-ivar">@config</span>.<span class="ruby-identifier">api_base_url</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">uri</span>, <span class="ruby-value">headers:</span> <span class="ruby-identifier">headers</span>,
|
216
|
+
<span class="ruby-value">timeout:</span> <span class="ruby-identifier">request_options</span>.<span class="ruby-identifier">connection_timeout</span>)
|
217
|
+
<span class="ruby-keyword">end</span></pre>
|
218
|
+
</div>
|
219
|
+
</div>
|
220
|
+
|
221
|
+
|
222
|
+
</div>
|
223
|
+
|
224
|
+
<div id="method-i-_get" class="method-detail ">
|
225
|
+
<div class="method-heading">
|
226
|
+
<span class="method-name">_get</span><span
|
227
|
+
class="method-args">(uri:, filters: nil, request_options: nil)</span>
|
228
|
+
<span class="method-click-advice">click to toggle source</span>
|
229
|
+
</div>
|
230
|
+
|
231
|
+
<div class="method-description">
|
232
|
+
|
233
|
+
|
234
|
+
<div class="method-source-code" id="_get-source">
|
235
|
+
<pre><span class="ruby-comment"># File lib/mercadopago/core/mp_base.rb, line 39</span>
|
236
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">_get</span>(<span class="ruby-value">uri:</span>, <span class="ruby-value">filters:</span> <span class="ruby-keyword">nil</span>, <span class="ruby-value">request_options:</span> <span class="ruby-keyword">nil</span>)
|
237
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">TypeError</span>, <span class="ruby-string">'Filters must be a Hash'</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">filters</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">filters</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Hash</span>)
|
238
|
+
|
239
|
+
<span class="ruby-identifier">request_options</span> = <span class="ruby-identifier">_check_request_options</span>(<span class="ruby-identifier">request_options</span>)
|
240
|
+
<span class="ruby-identifier">headers</span> = <span class="ruby-identifier">_check_headers</span>(<span class="ruby-identifier">request_options</span>)
|
241
|
+
|
242
|
+
<span class="ruby-ivar">@http_client</span>.<span class="ruby-identifier">get</span>(<span class="ruby-value">url:</span> <span class="ruby-ivar">@config</span>.<span class="ruby-identifier">api_base_url</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">uri</span>, <span class="ruby-value">headers:</span> <span class="ruby-identifier">headers</span>, <span class="ruby-value">params:</span> <span class="ruby-identifier">filters</span>,
|
243
|
+
<span class="ruby-value">timeout:</span> <span class="ruby-identifier">request_options</span>.<span class="ruby-identifier">connection_timeout</span>, <span class="ruby-value">maxretries:</span> <span class="ruby-identifier">request_options</span>.<span class="ruby-identifier">max_retries</span>)
|
244
|
+
<span class="ruby-keyword">end</span></pre>
|
245
|
+
</div>
|
246
|
+
</div>
|
247
|
+
|
248
|
+
|
249
|
+
</div>
|
250
|
+
|
251
|
+
<div id="method-i-_post" class="method-detail ">
|
252
|
+
<div class="method-heading">
|
253
|
+
<span class="method-name">_post</span><span
|
254
|
+
class="method-args">(uri:, data:, request_options: nil)</span>
|
255
|
+
<span class="method-click-advice">click to toggle source</span>
|
256
|
+
</div>
|
257
|
+
|
258
|
+
<div class="method-description">
|
259
|
+
|
260
|
+
|
261
|
+
<div class="method-source-code" id="_post-source">
|
262
|
+
<pre><span class="ruby-comment"># File lib/mercadopago/core/mp_base.rb, line 49</span>
|
263
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">_post</span>(<span class="ruby-value">uri:</span>, <span class="ruby-value">data:</span>, <span class="ruby-value">request_options:</span> <span class="ruby-keyword">nil</span>)
|
264
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">TypeError</span>, <span class="ruby-string">'Data must be a Hash'</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">data</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">data</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Hash</span>)
|
265
|
+
|
266
|
+
<span class="ruby-identifier">request_options</span> = <span class="ruby-identifier">_check_request_options</span>(<span class="ruby-identifier">request_options</span>)
|
267
|
+
<span class="ruby-identifier">headers</span> = <span class="ruby-identifier">_check_headers</span>(<span class="ruby-identifier">request_options</span>, { <span class="ruby-value">'Content-Type':</span> <span class="ruby-ivar">@config</span>.<span class="ruby-identifier">mime_json</span> })
|
268
|
+
|
269
|
+
<span class="ruby-ivar">@http_client</span>.<span class="ruby-identifier">post</span>(<span class="ruby-value">url:</span> <span class="ruby-ivar">@config</span>.<span class="ruby-identifier">api_base_url</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">uri</span>, <span class="ruby-value">data:</span> <span class="ruby-identifier">data</span>.<span class="ruby-identifier">to_json</span>, <span class="ruby-value">headers:</span> <span class="ruby-identifier">headers</span>,
|
270
|
+
<span class="ruby-value">timeout:</span> <span class="ruby-identifier">request_options</span>.<span class="ruby-identifier">connection_timeout</span>)
|
271
|
+
<span class="ruby-keyword">end</span></pre>
|
272
|
+
</div>
|
273
|
+
</div>
|
274
|
+
|
275
|
+
|
276
|
+
</div>
|
277
|
+
|
278
|
+
<div id="method-i-_put" class="method-detail ">
|
279
|
+
<div class="method-heading">
|
280
|
+
<span class="method-name">_put</span><span
|
281
|
+
class="method-args">(uri:, data:, request_options: nil)</span>
|
282
|
+
<span class="method-click-advice">click to toggle source</span>
|
283
|
+
</div>
|
284
|
+
|
285
|
+
<div class="method-description">
|
286
|
+
|
287
|
+
|
288
|
+
<div class="method-source-code" id="_put-source">
|
289
|
+
<pre><span class="ruby-comment"># File lib/mercadopago/core/mp_base.rb, line 59</span>
|
290
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">_put</span>(<span class="ruby-value">uri:</span>, <span class="ruby-value">data:</span>, <span class="ruby-value">request_options:</span> <span class="ruby-keyword">nil</span>)
|
291
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">TypeError</span>, <span class="ruby-string">'Data must be a Hash'</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">data</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">data</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Hash</span>)
|
292
|
+
|
293
|
+
<span class="ruby-identifier">request_options</span> = <span class="ruby-identifier">_check_request_options</span>(<span class="ruby-identifier">request_options</span>)
|
294
|
+
<span class="ruby-identifier">headers</span> = <span class="ruby-identifier">_check_headers</span>(<span class="ruby-identifier">request_options</span>, { <span class="ruby-value">'Content-Type':</span> <span class="ruby-ivar">@config</span>.<span class="ruby-identifier">mime_json</span> })
|
295
|
+
|
296
|
+
<span class="ruby-ivar">@http_client</span>.<span class="ruby-identifier">put</span>(<span class="ruby-value">url:</span> <span class="ruby-ivar">@config</span>.<span class="ruby-identifier">api_base_url</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">uri</span>, <span class="ruby-value">data:</span> <span class="ruby-identifier">data</span>.<span class="ruby-identifier">to_json</span>, <span class="ruby-value">headers:</span> <span class="ruby-identifier">headers</span>,
|
297
|
+
<span class="ruby-value">timeout:</span> <span class="ruby-identifier">request_options</span>.<span class="ruby-identifier">connection_timeout</span>)
|
298
|
+
<span class="ruby-keyword">end</span></pre>
|
299
|
+
</div>
|
300
|
+
</div>
|
301
|
+
|
302
|
+
|
303
|
+
</div>
|
304
|
+
|
305
|
+
</section>
|
306
|
+
|
307
|
+
</section>
|
308
|
+
</main>
|
309
|
+
|
310
|
+
|
311
|
+
<footer id="validator-badges" role="contentinfo">
|
312
|
+
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
313
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.3.0.
|
314
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
315
|
+
</footer>
|
316
|
+
|
@@ -0,0 +1,209 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta charset="UTF-8">
|
6
|
+
|
7
|
+
<title>class Mercadopago::MerchantOrder - RDoc Documentation</title>
|
8
|
+
|
9
|
+
<script type="text/javascript">
|
10
|
+
var rdoc_rel_prefix = "../";
|
11
|
+
var index_rel_prefix = "../";
|
12
|
+
</script>
|
13
|
+
|
14
|
+
<script src="../js/navigation.js" defer></script>
|
15
|
+
<script src="../js/search.js" defer></script>
|
16
|
+
<script src="../js/search_index.js" defer></script>
|
17
|
+
<script src="../js/searcher.js" defer></script>
|
18
|
+
<script src="../js/darkfish.js" defer></script>
|
19
|
+
|
20
|
+
<link href="../css/fonts.css" rel="stylesheet">
|
21
|
+
<link href="../css/rdoc.css" rel="stylesheet">
|
22
|
+
|
23
|
+
|
24
|
+
<body id="top" role="document" class="class">
|
25
|
+
<nav role="navigation">
|
26
|
+
<div id="project-navigation">
|
27
|
+
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
28
|
+
<h2>
|
29
|
+
<a href="../index.html" rel="home">Home</a>
|
30
|
+
</h2>
|
31
|
+
|
32
|
+
<div id="table-of-contents-navigation">
|
33
|
+
<a href="../table_of_contents.html#pages">Pages</a>
|
34
|
+
<a href="../table_of_contents.html#classes">Classes</a>
|
35
|
+
<a href="../table_of_contents.html#methods">Methods</a>
|
36
|
+
</div>
|
37
|
+
</div>
|
38
|
+
|
39
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
40
|
+
<form action="#" method="get" accept-charset="utf-8">
|
41
|
+
<div id="search-field-wrapper">
|
42
|
+
<input id="search-field" role="combobox" aria-label="Search"
|
43
|
+
aria-autocomplete="list" aria-controls="search-results"
|
44
|
+
type="text" name="search" placeholder="Search" spellcheck="false"
|
45
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
46
|
+
</div>
|
47
|
+
|
48
|
+
<ul id="search-results" aria-label="Search Results"
|
49
|
+
aria-busy="false" aria-expanded="false"
|
50
|
+
aria-atomic="false" class="initially-hidden"></ul>
|
51
|
+
</form>
|
52
|
+
</div>
|
53
|
+
|
54
|
+
</div>
|
55
|
+
|
56
|
+
|
57
|
+
|
58
|
+
<div id="class-metadata">
|
59
|
+
|
60
|
+
|
61
|
+
<div id="parent-class-section" class="nav-section">
|
62
|
+
<h3>Parent</h3>
|
63
|
+
|
64
|
+
<p class="link"><a href="MPBase.html">Mercadopago::MPBase</a>
|
65
|
+
</div>
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
<!-- Method Quickref -->
|
71
|
+
<div id="method-list-section" class="nav-section">
|
72
|
+
<h3>Methods</h3>
|
73
|
+
|
74
|
+
<ul class="link-list" role="directory">
|
75
|
+
<li ><a href="#method-i-create">#create</a>
|
76
|
+
<li ><a href="#method-i-get">#get</a>
|
77
|
+
<li ><a href="#method-i-search">#search</a>
|
78
|
+
<li ><a href="#method-i-update">#update</a>
|
79
|
+
</ul>
|
80
|
+
</div>
|
81
|
+
|
82
|
+
</div>
|
83
|
+
</nav>
|
84
|
+
|
85
|
+
<main role="main" aria-labelledby="class-Mercadopago::MerchantOrder">
|
86
|
+
<h1 id="class-Mercadopago::MerchantOrder" class="class">
|
87
|
+
class Mercadopago::MerchantOrder
|
88
|
+
</h1>
|
89
|
+
|
90
|
+
<section class="description">
|
91
|
+
|
92
|
+
<p>This class will allow you to create and manage your orders. You can attach one or more payments in your merchant order.</p>
|
93
|
+
|
94
|
+
</section>
|
95
|
+
|
96
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
97
|
+
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
|
102
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section">
|
103
|
+
<header>
|
104
|
+
<h3>Public Instance Methods</h3>
|
105
|
+
</header>
|
106
|
+
|
107
|
+
<div id="method-i-create" class="method-detail ">
|
108
|
+
<div class="method-heading">
|
109
|
+
<span class="method-name">create</span><span
|
110
|
+
class="method-args">(merchant_order_data, request_options: nil)</span>
|
111
|
+
<span class="method-click-advice">click to toggle source</span>
|
112
|
+
</div>
|
113
|
+
|
114
|
+
<div class="method-description">
|
115
|
+
|
116
|
+
|
117
|
+
<div class="method-source-code" id="create-source">
|
118
|
+
<pre><span class="ruby-comment"># File lib/mercadopago/resources/merchant_order.rb, line 19</span>
|
119
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">create</span>(<span class="ruby-identifier">merchant_order_data</span>, <span class="ruby-value">request_options:</span> <span class="ruby-keyword">nil</span>)
|
120
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">TypeError</span>, <span class="ruby-string">'Param merchant_orders_object must be a Hash'</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">merchant_order_data</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Hash</span>)
|
121
|
+
|
122
|
+
<span class="ruby-identifier">_post</span>(<span class="ruby-value">uri:</span> <span class="ruby-string">'/merchant_orders'</span>, <span class="ruby-value">data:</span> <span class="ruby-identifier">merchant_order_data</span>, <span class="ruby-value">request_options:</span> <span class="ruby-identifier">request_options</span>)
|
123
|
+
<span class="ruby-keyword">end</span></pre>
|
124
|
+
</div>
|
125
|
+
</div>
|
126
|
+
|
127
|
+
|
128
|
+
</div>
|
129
|
+
|
130
|
+
<div id="method-i-get" class="method-detail ">
|
131
|
+
<div class="method-heading">
|
132
|
+
<span class="method-name">get</span><span
|
133
|
+
class="method-args">(merchant_order_id, request_options: nil)</span>
|
134
|
+
<span class="method-click-advice">click to toggle source</span>
|
135
|
+
</div>
|
136
|
+
|
137
|
+
<div class="method-description">
|
138
|
+
|
139
|
+
|
140
|
+
<div class="method-source-code" id="get-source">
|
141
|
+
<pre><span class="ruby-comment"># File lib/mercadopago/resources/merchant_order.rb, line 15</span>
|
142
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">get</span>(<span class="ruby-identifier">merchant_order_id</span>, <span class="ruby-value">request_options:</span> <span class="ruby-keyword">nil</span>)
|
143
|
+
<span class="ruby-identifier">_get</span>(<span class="ruby-value">uri:</span> <span class="ruby-node">"/merchant_orders/#{merchant_order_id}"</span>, <span class="ruby-value">request_options:</span> <span class="ruby-identifier">request_options</span>)
|
144
|
+
<span class="ruby-keyword">end</span></pre>
|
145
|
+
</div>
|
146
|
+
</div>
|
147
|
+
|
148
|
+
|
149
|
+
</div>
|
150
|
+
|
151
|
+
<div id="method-i-search" class="method-detail ">
|
152
|
+
<div class="method-heading">
|
153
|
+
<span class="method-name">search</span><span
|
154
|
+
class="method-args">(filters: nil, request_options: nil)</span>
|
155
|
+
<span class="method-click-advice">click to toggle source</span>
|
156
|
+
</div>
|
157
|
+
|
158
|
+
<div class="method-description">
|
159
|
+
|
160
|
+
|
161
|
+
<div class="method-source-code" id="search-source">
|
162
|
+
<pre><span class="ruby-comment"># File lib/mercadopago/resources/merchant_order.rb, line 9</span>
|
163
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">search</span>(<span class="ruby-value">filters:</span> <span class="ruby-keyword">nil</span>, <span class="ruby-value">request_options:</span> <span class="ruby-keyword">nil</span>)
|
164
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">TypeError</span>, <span class="ruby-string">'Param filters must be a Hash'</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">filters</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">filters</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Hash</span>)
|
165
|
+
|
166
|
+
<span class="ruby-identifier">_get</span>(<span class="ruby-value">uri:</span> <span class="ruby-string">'/merchant_orders/search'</span>, <span class="ruby-value">filters:</span> <span class="ruby-identifier">filters</span>, <span class="ruby-value">request_options:</span> <span class="ruby-identifier">request_options</span>)
|
167
|
+
<span class="ruby-keyword">end</span></pre>
|
168
|
+
</div>
|
169
|
+
</div>
|
170
|
+
|
171
|
+
|
172
|
+
</div>
|
173
|
+
|
174
|
+
<div id="method-i-update" class="method-detail ">
|
175
|
+
<div class="method-heading">
|
176
|
+
<span class="method-name">update</span><span
|
177
|
+
class="method-args">(merchant_order_id, merchant_order_data, request_options: nil)</span>
|
178
|
+
<span class="method-click-advice">click to toggle source</span>
|
179
|
+
</div>
|
180
|
+
|
181
|
+
<div class="method-description">
|
182
|
+
|
183
|
+
|
184
|
+
<div class="method-source-code" id="update-source">
|
185
|
+
<pre><span class="ruby-comment"># File lib/mercadopago/resources/merchant_order.rb, line 25</span>
|
186
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">update</span>(<span class="ruby-identifier">merchant_order_id</span>, <span class="ruby-identifier">merchant_order_data</span>, <span class="ruby-value">request_options:</span> <span class="ruby-keyword">nil</span>)
|
187
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">TypeError</span>, <span class="ruby-string">'Param merchant_orders_object must be a Hash'</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">merchant_order_data</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Hash</span>)
|
188
|
+
|
189
|
+
<span class="ruby-identifier">_put</span>(<span class="ruby-value">uri:</span> <span class="ruby-node">"/merchant_orders/#{merchant_order_id}"</span>, <span class="ruby-value">data:</span> <span class="ruby-identifier">merchant_order_data</span>,
|
190
|
+
<span class="ruby-value">request_options:</span> <span class="ruby-identifier">request_options</span>)
|
191
|
+
<span class="ruby-keyword">end</span></pre>
|
192
|
+
</div>
|
193
|
+
</div>
|
194
|
+
|
195
|
+
|
196
|
+
</div>
|
197
|
+
|
198
|
+
</section>
|
199
|
+
|
200
|
+
</section>
|
201
|
+
</main>
|
202
|
+
|
203
|
+
|
204
|
+
<footer id="validator-badges" role="contentinfo">
|
205
|
+
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
206
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.3.0.
|
207
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
208
|
+
</footer>
|
209
|
+
|