mercadopago-sdk 1.3.0 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (126) hide show
  1. checksums.yaml +4 -4
  2. data/.editorconfig +10 -0
  3. data/.github/ISSUE_TEMPLATE/bug_report.md +28 -0
  4. data/.github/ISSUE_TEMPLATE/feature_request.md +19 -0
  5. data/.github/workflows/ruby.yml +35 -0
  6. data/.rubocop.yml +1 -0
  7. data/.rubocop_todo.yml +104 -0
  8. data/.ruby-version +1 -0
  9. data/CODE_OF_CONDUCT.md +74 -0
  10. data/CODING_GUIDELINES.md +70 -0
  11. data/CONTRIBUTING.md +57 -0
  12. data/Gemfile +6 -1
  13. data/Gemfile.lock +45 -17
  14. data/LICENSE.txt +21 -0
  15. data/README.md +51 -27
  16. data/Rakefile +3 -1
  17. data/docs/CODE_OF_CONDUCT_md.html +154 -0
  18. data/docs/CODING_GUIDELINES_md.html +188 -0
  19. data/docs/CONTRIBUTING_md.html +165 -0
  20. data/docs/LICENSE_txt.html +96 -0
  21. data/docs/Mercadopago.html +123 -0
  22. data/docs/Mercadopago/AdvancedPayment.html +279 -0
  23. data/docs/Mercadopago/Card.html +204 -0
  24. data/docs/Mercadopago/CardToken.html +160 -0
  25. data/docs/Mercadopago/Config.html +266 -0
  26. data/docs/Mercadopago/Customer.html +228 -0
  27. data/docs/Mercadopago/DisbursementRefund.html +183 -0
  28. data/docs/Mercadopago/HttpClient.html +249 -0
  29. data/docs/Mercadopago/IdentificationType.html +136 -0
  30. data/docs/Mercadopago/MPBase.html +316 -0
  31. data/docs/Mercadopago/MerchantOrder.html +209 -0
  32. data/docs/Mercadopago/Payment.html +208 -0
  33. data/docs/Mercadopago/PaymentMethods.html +136 -0
  34. data/docs/Mercadopago/Preference.html +184 -0
  35. data/docs/Mercadopago/Refund.html +160 -0
  36. data/docs/Mercadopago/RequestOptions.html +433 -0
  37. data/docs/Mercadopago/SDK.html +528 -0
  38. data/docs/Mercadopago/User.html +136 -0
  39. data/docs/README_md.html +181 -0
  40. data/docs/created.rid +25 -0
  41. data/docs/css/fonts.css +167 -0
  42. data/docs/css/rdoc.css +619 -0
  43. data/docs/fonts/Lato-Light.ttf +0 -0
  44. data/docs/fonts/Lato-LightItalic.ttf +0 -0
  45. data/docs/fonts/Lato-Regular.ttf +0 -0
  46. data/docs/fonts/Lato-RegularItalic.ttf +0 -0
  47. data/docs/fonts/SourceCodePro-Bold.ttf +0 -0
  48. data/docs/fonts/SourceCodePro-Regular.ttf +0 -0
  49. data/docs/images/add.png +0 -0
  50. data/docs/images/arrow_up.png +0 -0
  51. data/docs/images/brick.png +0 -0
  52. data/docs/images/brick_link.png +0 -0
  53. data/docs/images/bug.png +0 -0
  54. data/docs/images/bullet_black.png +0 -0
  55. data/docs/images/bullet_toggle_minus.png +0 -0
  56. data/docs/images/bullet_toggle_plus.png +0 -0
  57. data/docs/images/date.png +0 -0
  58. data/docs/images/delete.png +0 -0
  59. data/docs/images/find.png +0 -0
  60. data/docs/images/loadingAnimation.gif +0 -0
  61. data/docs/images/macFFBgHack.png +0 -0
  62. data/docs/images/package.png +0 -0
  63. data/docs/images/page_green.png +0 -0
  64. data/docs/images/page_white_text.png +0 -0
  65. data/docs/images/page_white_width.png +0 -0
  66. data/docs/images/plugin.png +0 -0
  67. data/docs/images/ruby.png +0 -0
  68. data/docs/images/tag_blue.png +0 -0
  69. data/docs/images/tag_green.png +0 -0
  70. data/docs/images/transparent.png +0 -0
  71. data/docs/images/wrench.png +0 -0
  72. data/docs/images/wrench_orange.png +0 -0
  73. data/docs/images/zoom.png +0 -0
  74. data/docs/index.html +109 -0
  75. data/docs/js/darkfish.js +84 -0
  76. data/docs/js/navigation.js +105 -0
  77. data/docs/js/navigation.js.gz +0 -0
  78. data/docs/js/search.js +110 -0
  79. data/docs/js/search_index.js +1 -0
  80. data/docs/js/search_index.js.gz +0 -0
  81. data/docs/js/searcher.js +229 -0
  82. data/docs/js/searcher.js.gz +0 -0
  83. data/docs/table_of_contents.html +562 -0
  84. data/lib/mercadopago.rb +24 -295
  85. data/lib/mercadopago/config/config.rb +42 -0
  86. data/lib/mercadopago/config/request_options.rb +85 -0
  87. data/lib/mercadopago/core/mp_base.rb +77 -0
  88. data/lib/mercadopago/http/http_client.rb +74 -0
  89. data/lib/mercadopago/resources/advanced_payment.rb +48 -0
  90. data/lib/mercadopago/resources/card.rb +31 -0
  91. data/lib/mercadopago/resources/card_token.rb +19 -0
  92. data/lib/mercadopago/resources/customer.rb +36 -0
  93. data/lib/mercadopago/resources/disbursement_refund.rb +24 -0
  94. data/lib/mercadopago/resources/identification_type.rb +13 -0
  95. data/lib/mercadopago/resources/merchant_order.rb +32 -0
  96. data/lib/mercadopago/resources/payment.rb +35 -0
  97. data/lib/mercadopago/resources/payment_methods.rb +13 -0
  98. data/lib/mercadopago/resources/preference.rb +26 -0
  99. data/lib/mercadopago/resources/refund.rb +24 -0
  100. data/lib/mercadopago/resources/user.rb +13 -0
  101. data/lib/mercadopago/sdk.rb +85 -0
  102. data/mercadopago.gemspec +11 -11
  103. data/tests/test_card.rb +79 -0
  104. data/tests/test_card_token.rb +39 -0
  105. data/tests/test_customer.rb +54 -0
  106. data/tests/test_identification_type.rb +16 -0
  107. data/tests/test_merchant_order.rb +94 -0
  108. data/tests/test_payment.rb +102 -0
  109. data/tests/test_payment_methods.rb +14 -0
  110. data/tests/test_preference.rb +49 -0
  111. data/tests/test_refund.rb +88 -0
  112. data/tests/test_user.rb +17 -0
  113. data/tests/tests.rb +12 -56
  114. metadata +127 -24
  115. data/.travis.yml +0 -14
  116. data/examples/checkout-buttons/basic_preference/button.rb +0 -28
  117. data/examples/instant-payment-notifications/receive-ipn.rb +0 -25
  118. data/examples/payment-search/search-approved-payments.rb +0 -23
  119. data/examples/payment-search/search-creditcard-payments.rb +0 -23
  120. data/examples/payment-search/search-funded-payments-by-name.rb +0 -23
  121. data/examples/payment-search/search-payments-from-email-and-date.rb +0 -23
  122. data/examples/payment-search/search-payments.rb +0 -23
  123. data/examples/preapproval-payments/button.rb +0 -42
  124. data/lib/ssl_options_patch.rb +0 -15
  125. data/lib/version.rb +0 -2
  126. data/travis_Gemfile +0 -4
@@ -0,0 +1,184 @@
1
+ <!DOCTYPE html>
2
+
3
+ <html>
4
+ <head>
5
+ <meta charset="UTF-8">
6
+
7
+ <title>class Mercadopago::Preference - 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-update">#update</a>
78
+ </ul>
79
+ </div>
80
+
81
+ </div>
82
+ </nav>
83
+
84
+ <main role="main" aria-labelledby="class-Mercadopago::Preference">
85
+ <h1 id="class-Mercadopago::Preference" class="class">
86
+ class Mercadopago::Preference
87
+ </h1>
88
+
89
+ <section class="description">
90
+
91
+ <p>This class will allow you to charge your customers through our web form from any device in a simple, fast and secure way. [Click here for more infos](<a href="https://www.mercadopago.com.br/developers/en/guides/online-payments/checkout-pro/introduction">www.mercadopago.com.br/developers/en/guides/online-payments/checkout-pro/introduction</a>)</p>
92
+
93
+ </section>
94
+
95
+ <section id="5Buntitled-5D" class="documentation-section">
96
+
97
+
98
+
99
+
100
+
101
+ <section id="public-instance-5Buntitled-5D-method-details" class="method-section">
102
+ <header>
103
+ <h3>Public Instance Methods</h3>
104
+ </header>
105
+
106
+ <div id="method-i-create" class="method-detail ">
107
+ <div class="method-heading">
108
+ <span class="method-name">create</span><span
109
+ class="method-args">(preference_data, request_options: nil)</span>
110
+ <span class="method-click-advice">click to toggle source</span>
111
+ </div>
112
+
113
+ <div class="method-description">
114
+
115
+
116
+ <div class="method-source-code" id="create-source">
117
+ <pre><span class="ruby-comment"># File lib/mercadopago/resources/preference.rb, line 14</span>
118
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">create</span>(<span class="ruby-identifier">preference_data</span>, <span class="ruby-value">request_options:</span> <span class="ruby-keyword">nil</span>)
119
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">TypeError</span>, <span class="ruby-string">&#39;Param preference_data must be a Hash&#39;</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">preference_data</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Hash</span>)
120
+
121
+ <span class="ruby-identifier">_post</span>(<span class="ruby-value">uri:</span> <span class="ruby-string">&#39;/checkout/preferences&#39;</span>, <span class="ruby-value">data:</span> <span class="ruby-identifier">preference_data</span>, <span class="ruby-value">request_options:</span> <span class="ruby-identifier">request_options</span>)
122
+ <span class="ruby-keyword">end</span></pre>
123
+ </div>
124
+ </div>
125
+
126
+
127
+ </div>
128
+
129
+ <div id="method-i-get" class="method-detail ">
130
+ <div class="method-heading">
131
+ <span class="method-name">get</span><span
132
+ class="method-args">(preference_id, request_options: nil)</span>
133
+ <span class="method-click-advice">click to toggle source</span>
134
+ </div>
135
+
136
+ <div class="method-description">
137
+
138
+
139
+ <div class="method-source-code" id="get-source">
140
+ <pre><span class="ruby-comment"># File lib/mercadopago/resources/preference.rb, line 10</span>
141
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">get</span>(<span class="ruby-identifier">preference_id</span>, <span class="ruby-value">request_options:</span> <span class="ruby-keyword">nil</span>)
142
+ <span class="ruby-identifier">_get</span>(<span class="ruby-value">uri:</span> <span class="ruby-node">&quot;/checkout/preferences/#{preference_id}&quot;</span>, <span class="ruby-value">request_options:</span> <span class="ruby-identifier">request_options</span>)
143
+ <span class="ruby-keyword">end</span></pre>
144
+ </div>
145
+ </div>
146
+
147
+
148
+ </div>
149
+
150
+ <div id="method-i-update" class="method-detail ">
151
+ <div class="method-heading">
152
+ <span class="method-name">update</span><span
153
+ class="method-args">(preference_id, preference_data, request_options: nil)</span>
154
+ <span class="method-click-advice">click to toggle source</span>
155
+ </div>
156
+
157
+ <div class="method-description">
158
+
159
+
160
+ <div class="method-source-code" id="update-source">
161
+ <pre><span class="ruby-comment"># File lib/mercadopago/resources/preference.rb, line 20</span>
162
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">update</span>(<span class="ruby-identifier">preference_id</span>, <span class="ruby-identifier">preference_data</span>, <span class="ruby-value">request_options:</span> <span class="ruby-keyword">nil</span>)
163
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">TypeError</span>, <span class="ruby-string">&#39;Param preference_data must be a Hash&#39;</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">preference_data</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Hash</span>)
164
+
165
+ <span class="ruby-identifier">_put</span>(<span class="ruby-value">uri:</span> <span class="ruby-node">&quot;/checkout/preferences/#{preference_id}&quot;</span>, <span class="ruby-value">data:</span> <span class="ruby-identifier">preference_data</span>, <span class="ruby-value">request_options:</span> <span class="ruby-identifier">request_options</span>)
166
+ <span class="ruby-keyword">end</span></pre>
167
+ </div>
168
+ </div>
169
+
170
+
171
+ </div>
172
+
173
+ </section>
174
+
175
+ </section>
176
+ </main>
177
+
178
+
179
+ <footer id="validator-badges" role="contentinfo">
180
+ <p><a href="https://validator.w3.org/check/referer">Validate</a>
181
+ <p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.3.0.
182
+ <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
183
+ </footer>
184
+
@@ -0,0 +1,160 @@
1
+ <!DOCTYPE html>
2
+
3
+ <html>
4
+ <head>
5
+ <meta charset="UTF-8">
6
+
7
+ <title>class Mercadopago::Refund - 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-list">#list</a>
77
+ </ul>
78
+ </div>
79
+
80
+ </div>
81
+ </nav>
82
+
83
+ <main role="main" aria-labelledby="class-Mercadopago::Refund">
84
+ <h1 id="class-Mercadopago::Refund" class="class">
85
+ class Mercadopago::Refund
86
+ </h1>
87
+
88
+ <section class="description">
89
+
90
+ <p>[Click here for more infos](<a href="https://www.mercadopago.com.br/developers/en/guides/manage-account/account/cancellations-and-refunds#bookmark_refunds">www.mercadopago.com.br/developers/en/guides/manage-account/account/cancellations-and-refunds#bookmark_refunds</a>)</p>
91
+
92
+ </section>
93
+
94
+ <section id="5Buntitled-5D" class="documentation-section">
95
+
96
+
97
+
98
+
99
+
100
+ <section id="public-instance-5Buntitled-5D-method-details" class="method-section">
101
+ <header>
102
+ <h3>Public Instance Methods</h3>
103
+ </header>
104
+
105
+ <div id="method-i-create" class="method-detail ">
106
+ <div class="method-heading">
107
+ <span class="method-name">create</span><span
108
+ class="method-args">(payment_id, refund_data: nil, request_options: nil)</span>
109
+ <span class="method-click-advice">click to toggle source</span>
110
+ </div>
111
+
112
+ <div class="method-description">
113
+
114
+
115
+ <div class="method-source-code" id="create-source">
116
+ <pre><span class="ruby-comment"># File lib/mercadopago/resources/refund.rb, line 18</span>
117
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">create</span>(<span class="ruby-identifier">payment_id</span>, <span class="ruby-value">refund_data:</span> <span class="ruby-keyword">nil</span>, <span class="ruby-value">request_options:</span> <span class="ruby-keyword">nil</span>)
118
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">TypeError</span>, <span class="ruby-string">&#39;Param refund_data must be a Hash&#39;</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">refund_data</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">refund_data</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Hash</span>)
119
+
120
+ <span class="ruby-identifier">_post</span>(<span class="ruby-value">uri:</span> <span class="ruby-node">&quot;/v1/payments/#{payment_id}/refunds&quot;</span>, <span class="ruby-value">data:</span> <span class="ruby-identifier">refund_data</span>, <span class="ruby-value">request_options:</span> <span class="ruby-identifier">request_options</span>)
121
+ <span class="ruby-keyword">end</span></pre>
122
+ </div>
123
+ </div>
124
+
125
+
126
+ </div>
127
+
128
+ <div id="method-i-list" class="method-detail ">
129
+ <div class="method-heading">
130
+ <span class="method-name">list</span><span
131
+ class="method-args">(payment_id, request_options: nil)</span>
132
+ <span class="method-click-advice">click to toggle source</span>
133
+ </div>
134
+
135
+ <div class="method-description">
136
+
137
+
138
+ <div class="method-source-code" id="list-source">
139
+ <pre><span class="ruby-comment"># File lib/mercadopago/resources/refund.rb, line 14</span>
140
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">list</span>(<span class="ruby-identifier">payment_id</span>, <span class="ruby-value">request_options:</span> <span class="ruby-keyword">nil</span>)
141
+ <span class="ruby-identifier">_get</span>(<span class="ruby-value">uri:</span> <span class="ruby-node">&quot;/v1/payments/#{payment_id}/refunds&quot;</span>, <span class="ruby-value">request_options:</span> <span class="ruby-identifier">request_options</span>)
142
+ <span class="ruby-keyword">end</span></pre>
143
+ </div>
144
+ </div>
145
+
146
+
147
+ </div>
148
+
149
+ </section>
150
+
151
+ </section>
152
+ </main>
153
+
154
+
155
+ <footer id="validator-badges" role="contentinfo">
156
+ <p><a href="https://validator.w3.org/check/referer">Validate</a>
157
+ <p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.3.0.
158
+ <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
159
+ </footer>
160
+
@@ -0,0 +1,433 @@
1
+ <!DOCTYPE html>
2
+
3
+ <html>
4
+ <head>
5
+ <meta charset="UTF-8">
6
+
7
+ <title>class Mercadopago::RequestOptions - 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-access_token-3D">#access_token=</a>
77
+ <li ><a href="#method-i-connection_timeout-3D">#connection_timeout=</a>
78
+ <li ><a href="#method-i-corporation_id-3D">#corporation_id=</a>
79
+ <li ><a href="#method-i-custom_headers-3D">#custom_headers=</a>
80
+ <li ><a href="#method-i-get_headers">#get_headers</a>
81
+ <li ><a href="#method-i-integrator_id-3D">#integrator_id=</a>
82
+ <li ><a href="#method-i-max_retries-3D">#max_retries=</a>
83
+ <li ><a href="#method-i-platform_id-3D">#platform_id=</a>
84
+ </ul>
85
+ </div>
86
+
87
+ </div>
88
+ </nav>
89
+
90
+ <main role="main" aria-labelledby="class-Mercadopago::RequestOptions">
91
+ <h1 id="class-Mercadopago::RequestOptions" class="class">
92
+ class Mercadopago::RequestOptions
93
+ </h1>
94
+
95
+ <section class="description">
96
+
97
+ </section>
98
+
99
+ <section id="5Buntitled-5D" class="documentation-section">
100
+
101
+
102
+
103
+ <section class="attribute-method-details" class="method-section">
104
+ <header>
105
+ <h3>Attributes</h3>
106
+ </header>
107
+
108
+ <div id="attribute-i-access_token" class="method-detail">
109
+ <div class="method-heading attribute-method-heading">
110
+ <span class="method-name">access_token</span><span
111
+ class="attribute-access-type">[R]</span>
112
+ </div>
113
+
114
+ <div class="method-description">
115
+
116
+ </div>
117
+ </div>
118
+ <div id="attribute-i-connection_timeout" class="method-detail">
119
+ <div class="method-heading attribute-method-heading">
120
+ <span class="method-name">connection_timeout</span><span
121
+ class="attribute-access-type">[R]</span>
122
+ </div>
123
+
124
+ <div class="method-description">
125
+
126
+ </div>
127
+ </div>
128
+ <div id="attribute-i-corporation_id" class="method-detail">
129
+ <div class="method-heading attribute-method-heading">
130
+ <span class="method-name">corporation_id</span><span
131
+ class="attribute-access-type">[R]</span>
132
+ </div>
133
+
134
+ <div class="method-description">
135
+
136
+ </div>
137
+ </div>
138
+ <div id="attribute-i-custom_headers" class="method-detail">
139
+ <div class="method-heading attribute-method-heading">
140
+ <span class="method-name">custom_headers</span><span
141
+ class="attribute-access-type">[R]</span>
142
+ </div>
143
+
144
+ <div class="method-description">
145
+
146
+ </div>
147
+ </div>
148
+ <div id="attribute-i-integrator_id" class="method-detail">
149
+ <div class="method-heading attribute-method-heading">
150
+ <span class="method-name">integrator_id</span><span
151
+ class="attribute-access-type">[R]</span>
152
+ </div>
153
+
154
+ <div class="method-description">
155
+
156
+ </div>
157
+ </div>
158
+ <div id="attribute-i-max_retries" class="method-detail">
159
+ <div class="method-heading attribute-method-heading">
160
+ <span class="method-name">max_retries</span><span
161
+ class="attribute-access-type">[R]</span>
162
+ </div>
163
+
164
+ <div class="method-description">
165
+
166
+ </div>
167
+ </div>
168
+ <div id="attribute-i-platform_id" class="method-detail">
169
+ <div class="method-heading attribute-method-heading">
170
+ <span class="method-name">platform_id</span><span
171
+ class="attribute-access-type">[R]</span>
172
+ </div>
173
+
174
+ <div class="method-description">
175
+
176
+ </div>
177
+ </div>
178
+ </section>
179
+
180
+
181
+ <section id="public-class-5Buntitled-5D-method-details" class="method-section">
182
+ <header>
183
+ <h3>Public Class Methods</h3>
184
+ </header>
185
+
186
+ <div id="method-c-new" class="method-detail ">
187
+ <div class="method-heading">
188
+ <span class="method-name">new</span><span
189
+ class="method-args">(access_token: nil, connection_timeout: 60.0, custom_headers: nil, corporation_id: nil, integrator_id: nil, platform_id: nil, max_retries: 3)</span>
190
+ <span class="method-click-advice">click to toggle source</span>
191
+ </div>
192
+
193
+ <div class="method-description">
194
+
195
+
196
+ <div class="method-source-code" id="new-source">
197
+ <pre><span class="ruby-comment"># File lib/mercadopago/config/request_options.rb, line 9</span>
198
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">initialize</span>(<span class="ruby-value">access_token:</span> <span class="ruby-keyword">nil</span>,
199
+ <span class="ruby-value">connection_timeout:</span> <span class="ruby-value">60.0</span>,
200
+ <span class="ruby-value">custom_headers:</span> <span class="ruby-keyword">nil</span>,
201
+ <span class="ruby-value">corporation_id:</span> <span class="ruby-keyword">nil</span>,
202
+ <span class="ruby-value">integrator_id:</span> <span class="ruby-keyword">nil</span>,
203
+ <span class="ruby-value">platform_id:</span> <span class="ruby-keyword">nil</span>,
204
+ <span class="ruby-value">max_retries:</span> <span class="ruby-value">3</span>)
205
+ <span class="ruby-keyword">self</span>.<span class="ruby-identifier">access_token</span> = <span class="ruby-identifier">access_token</span>
206
+ <span class="ruby-keyword">self</span>.<span class="ruby-identifier">connection_timeout</span> = <span class="ruby-identifier">connection_timeout</span>
207
+ <span class="ruby-keyword">self</span>.<span class="ruby-identifier">custom_headers</span> = <span class="ruby-identifier">custom_headers</span>
208
+ <span class="ruby-keyword">self</span>.<span class="ruby-identifier">corporation_id</span> = <span class="ruby-identifier">corporation_id</span>
209
+ <span class="ruby-keyword">self</span>.<span class="ruby-identifier">integrator_id</span> = <span class="ruby-identifier">integrator_id</span>
210
+ <span class="ruby-keyword">self</span>.<span class="ruby-identifier">platform_id</span> = <span class="ruby-identifier">platform_id</span>
211
+ <span class="ruby-keyword">self</span>.<span class="ruby-identifier">max_retries</span> = <span class="ruby-identifier">max_retries</span>
212
+
213
+ <span class="ruby-ivar">@config</span> = <span class="ruby-constant">Config</span>.<span class="ruby-identifier">new</span>
214
+ <span class="ruby-keyword">end</span></pre>
215
+ </div>
216
+ </div>
217
+
218
+
219
+ </div>
220
+
221
+ </section>
222
+
223
+ <section id="public-instance-5Buntitled-5D-method-details" class="method-section">
224
+ <header>
225
+ <h3>Public Instance Methods</h3>
226
+ </header>
227
+
228
+ <div id="method-i-access_token-3D" class="method-detail ">
229
+ <div class="method-heading">
230
+ <span class="method-name">access_token=</span><span
231
+ class="method-args">(value)</span>
232
+ <span class="method-click-advice">click to toggle source</span>
233
+ </div>
234
+
235
+ <div class="method-description">
236
+
237
+
238
+ <div class="method-source-code" id="access_token-3D-source">
239
+ <pre><span class="ruby-comment"># File lib/mercadopago/config/request_options.rb, line 43</span>
240
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">access_token=</span>(<span class="ruby-identifier">value</span>)
241
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">TypeError</span>, <span class="ruby-string">&#39;Param access_token must be a String&#39;</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">access_token</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">String</span>)
242
+
243
+ <span class="ruby-ivar">@access_token</span> = <span class="ruby-identifier">value</span>
244
+ <span class="ruby-keyword">end</span></pre>
245
+ </div>
246
+ </div>
247
+
248
+
249
+ </div>
250
+
251
+ <div id="method-i-connection_timeout-3D" class="method-detail ">
252
+ <div class="method-heading">
253
+ <span class="method-name">connection_timeout=</span><span
254
+ class="method-args">(value)</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="connection_timeout-3D-source">
262
+ <pre><span class="ruby-comment"># File lib/mercadopago/config/request_options.rb, line 55</span>
263
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">connection_timeout=</span>(<span class="ruby-identifier">value</span>)
264
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">TypeError</span>, <span class="ruby-string">&#39;Param connection_timeout must be a Float&#39;</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Float</span>)
265
+
266
+ <span class="ruby-ivar">@connection_timeout</span> = <span class="ruby-identifier">value</span>
267
+ <span class="ruby-keyword">end</span></pre>
268
+ </div>
269
+ </div>
270
+
271
+
272
+ </div>
273
+
274
+ <div id="method-i-corporation_id-3D" class="method-detail ">
275
+ <div class="method-heading">
276
+ <span class="method-name">corporation_id=</span><span
277
+ class="method-args">(value)</span>
278
+ <span class="method-click-advice">click to toggle source</span>
279
+ </div>
280
+
281
+ <div class="method-description">
282
+
283
+
284
+ <div class="method-source-code" id="corporation_id-3D-source">
285
+ <pre><span class="ruby-comment"># File lib/mercadopago/config/request_options.rb, line 61</span>
286
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">corporation_id=</span>(<span class="ruby-identifier">value</span>)
287
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">TypeError</span>, <span class="ruby-string">&#39;Param corporation_id must be a String&#39;</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">String</span>)
288
+
289
+ <span class="ruby-ivar">@corporation_id</span> = <span class="ruby-identifier">value</span>
290
+ <span class="ruby-keyword">end</span></pre>
291
+ </div>
292
+ </div>
293
+
294
+
295
+ </div>
296
+
297
+ <div id="method-i-custom_headers-3D" class="method-detail ">
298
+ <div class="method-heading">
299
+ <span class="method-name">custom_headers=</span><span
300
+ class="method-args">(value)</span>
301
+ <span class="method-click-advice">click to toggle source</span>
302
+ </div>
303
+
304
+ <div class="method-description">
305
+
306
+
307
+ <div class="method-source-code" id="custom_headers-3D-source">
308
+ <pre><span class="ruby-comment"># File lib/mercadopago/config/request_options.rb, line 49</span>
309
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">custom_headers=</span>(<span class="ruby-identifier">value</span>)
310
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">TypeError</span>, <span class="ruby-string">&#39;Param custom_headers must be a Hash&#39;</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Hash</span>)
311
+
312
+ <span class="ruby-ivar">@custom_headers</span> = <span class="ruby-identifier">value</span>
313
+ <span class="ruby-keyword">end</span></pre>
314
+ </div>
315
+ </div>
316
+
317
+
318
+ </div>
319
+
320
+ <div id="method-i-get_headers" class="method-detail ">
321
+ <div class="method-heading">
322
+ <span class="method-name">get_headers</span><span
323
+ class="method-args">()</span>
324
+ <span class="method-click-advice">click to toggle source</span>
325
+ </div>
326
+
327
+ <div class="method-description">
328
+
329
+
330
+ <div class="method-source-code" id="get_headers-source">
331
+ <pre><span class="ruby-comment"># File lib/mercadopago/config/request_options.rb, line 27</span>
332
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">get_headers</span>
333
+ <span class="ruby-identifier">headers</span> = { <span class="ruby-value">&#39;Authorization&#39;:</span> <span class="ruby-node">&quot;Bearer #{@access_token}&quot;</span>,
334
+ <span class="ruby-string">&#39;x-product-id&#39;</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-ivar">@config</span>.<span class="ruby-identifier">product_id</span>,
335
+ <span class="ruby-string">&#39;x-tracking-id&#39;</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-ivar">@config</span>.<span class="ruby-identifier">tracking_id</span>,
336
+ <span class="ruby-string">&#39;User-Agent&#39;</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-ivar">@config</span>.<span class="ruby-identifier">user_agent</span>,
337
+ <span class="ruby-value">&#39;Accept&#39;:</span> <span class="ruby-ivar">@config</span>.<span class="ruby-identifier">mime_json</span> }
338
+
339
+ <span class="ruby-identifier">headers</span>[<span class="ruby-string">&#39;x-corporation-id&#39;</span>] = <span class="ruby-ivar">@corporation_id</span> <span class="ruby-keyword">unless</span> <span class="ruby-ivar">@corporation_id</span>.<span class="ruby-identifier">nil?</span>
340
+ <span class="ruby-identifier">headers</span>[<span class="ruby-string">&#39;x-integrator-id&#39;</span>] = <span class="ruby-ivar">@integrator_id</span> <span class="ruby-keyword">unless</span> <span class="ruby-ivar">@integrator_id</span>.<span class="ruby-identifier">nil?</span>
341
+ <span class="ruby-identifier">headers</span>[<span class="ruby-string">&#39;x-platform-id&#39;</span>] = <span class="ruby-ivar">@platform_id</span> <span class="ruby-keyword">unless</span> <span class="ruby-ivar">@platform_id</span>.<span class="ruby-identifier">nil?</span>
342
+
343
+ <span class="ruby-identifier">headers</span>.<span class="ruby-identifier">merge</span>(<span class="ruby-ivar">@custom_headers</span>) <span class="ruby-keyword">unless</span> <span class="ruby-ivar">@custom_headers</span>.<span class="ruby-identifier">nil?</span>
344
+
345
+ <span class="ruby-identifier">headers</span>
346
+ <span class="ruby-keyword">end</span></pre>
347
+ </div>
348
+ </div>
349
+
350
+
351
+ </div>
352
+
353
+ <div id="method-i-integrator_id-3D" class="method-detail ">
354
+ <div class="method-heading">
355
+ <span class="method-name">integrator_id=</span><span
356
+ class="method-args">(value)</span>
357
+ <span class="method-click-advice">click to toggle source</span>
358
+ </div>
359
+
360
+ <div class="method-description">
361
+
362
+
363
+ <div class="method-source-code" id="integrator_id-3D-source">
364
+ <pre><span class="ruby-comment"># File lib/mercadopago/config/request_options.rb, line 67</span>
365
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">integrator_id=</span>(<span class="ruby-identifier">value</span>)
366
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">TypeError</span>, <span class="ruby-string">&#39;Param integrator_id must be a String&#39;</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">String</span>)
367
+
368
+ <span class="ruby-ivar">@integrator_id</span> = <span class="ruby-identifier">value</span>
369
+ <span class="ruby-keyword">end</span></pre>
370
+ </div>
371
+ </div>
372
+
373
+
374
+ </div>
375
+
376
+ <div id="method-i-max_retries-3D" class="method-detail ">
377
+ <div class="method-heading">
378
+ <span class="method-name">max_retries=</span><span
379
+ class="method-args">(value)</span>
380
+ <span class="method-click-advice">click to toggle source</span>
381
+ </div>
382
+
383
+ <div class="method-description">
384
+
385
+
386
+ <div class="method-source-code" id="max_retries-3D-source">
387
+ <pre><span class="ruby-comment"># File lib/mercadopago/config/request_options.rb, line 79</span>
388
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">max_retries=</span>(<span class="ruby-identifier">value</span>)
389
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">TypeError</span>, <span class="ruby-string">&#39;Param max_retries must be a Integer&#39;</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Integer</span>)
390
+
391
+ <span class="ruby-ivar">@max_retries</span> = <span class="ruby-identifier">value</span>
392
+ <span class="ruby-keyword">end</span></pre>
393
+ </div>
394
+ </div>
395
+
396
+
397
+ </div>
398
+
399
+ <div id="method-i-platform_id-3D" class="method-detail ">
400
+ <div class="method-heading">
401
+ <span class="method-name">platform_id=</span><span
402
+ class="method-args">(value)</span>
403
+ <span class="method-click-advice">click to toggle source</span>
404
+ </div>
405
+
406
+ <div class="method-description">
407
+
408
+
409
+ <div class="method-source-code" id="platform_id-3D-source">
410
+ <pre><span class="ruby-comment"># File lib/mercadopago/config/request_options.rb, line 73</span>
411
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">platform_id=</span>(<span class="ruby-identifier">value</span>)
412
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">TypeError</span>, <span class="ruby-string">&#39;Param platform_id must be a String&#39;</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">String</span>)
413
+
414
+ <span class="ruby-ivar">@platform_id</span> = <span class="ruby-identifier">value</span>
415
+ <span class="ruby-keyword">end</span></pre>
416
+ </div>
417
+ </div>
418
+
419
+
420
+ </div>
421
+
422
+ </section>
423
+
424
+ </section>
425
+ </main>
426
+
427
+
428
+ <footer id="validator-badges" role="contentinfo">
429
+ <p><a href="https://validator.w3.org/check/referer">Validate</a>
430
+ <p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.3.0.
431
+ <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
432
+ </footer>
433
+