easypost 4.8.1 → 4.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. checksums.yaml +4 -4
  2. data/.gitattributes +5 -0
  3. data/.github/workflows/ci.yml +8 -0
  4. data/.gitignore +10 -14
  5. data/CHANGELOG.md +4 -0
  6. data/Makefile +10 -2
  7. data/README.md +5 -1
  8. data/VERSION +1 -1
  9. data/docs/EasyPost/Address.html +222 -0
  10. data/docs/EasyPost/ApiKey.html +99 -0
  11. data/docs/EasyPost/Batch.html +269 -0
  12. data/docs/EasyPost/Beta/EndShipper.html +225 -0
  13. data/docs/EasyPost/Beta/Referral.html +338 -0
  14. data/docs/EasyPost/Beta.html +91 -0
  15. data/docs/EasyPost/Billing.html +253 -0
  16. data/docs/EasyPost/Brand.html +140 -0
  17. data/docs/EasyPost/CarbonOffset.html +99 -0
  18. data/docs/EasyPost/CarrierAccount.html +136 -0
  19. data/docs/EasyPost/CarrierType.html +99 -0
  20. data/docs/EasyPost/CustomsInfo.html +136 -0
  21. data/docs/EasyPost/CustomsItem.html +136 -0
  22. data/docs/EasyPost/EasyPostObject.html +662 -0
  23. data/docs/EasyPost/EndShipper.html +175 -0
  24. data/docs/EasyPost/Error.html +258 -0
  25. data/docs/EasyPost/Event.html +136 -0
  26. data/docs/EasyPost/Insurance.html +99 -0
  27. data/docs/EasyPost/Order.html +222 -0
  28. data/docs/EasyPost/Parcel.html +136 -0
  29. data/docs/EasyPost/PaymentMethod.html +137 -0
  30. data/docs/EasyPost/Pickup.html +222 -0
  31. data/docs/EasyPost/PickupRate.html +99 -0
  32. data/docs/EasyPost/PostageLabel.html +99 -0
  33. data/docs/EasyPost/Rate.html +136 -0
  34. data/docs/EasyPost/Referral.html +334 -0
  35. data/docs/EasyPost/Refund.html +99 -0
  36. data/docs/EasyPost/Report.html +167 -0
  37. data/docs/EasyPost/Resource.html +399 -0
  38. data/docs/EasyPost/ScanForm.html +137 -0
  39. data/docs/EasyPost/Shipment.html +456 -0
  40. data/docs/EasyPost/TaxIdentifier.html +99 -0
  41. data/docs/EasyPost/Tracker.html +139 -0
  42. data/docs/EasyPost/User.html +307 -0
  43. data/docs/EasyPost/Util.html +462 -0
  44. data/docs/EasyPost/Webhook.html +221 -0
  45. data/docs/EasyPost.html +440 -0
  46. data/docs/created.rid +40 -0
  47. data/docs/css/fonts.css +167 -0
  48. data/docs/css/rdoc.css +639 -0
  49. data/docs/fonts/Lato-Light.ttf +0 -0
  50. data/docs/fonts/Lato-LightItalic.ttf +0 -0
  51. data/docs/fonts/Lato-Regular.ttf +0 -0
  52. data/docs/fonts/Lato-RegularItalic.ttf +0 -0
  53. data/docs/fonts/SourceCodePro-Bold.ttf +0 -0
  54. data/docs/fonts/SourceCodePro-Regular.ttf +0 -0
  55. data/docs/images/add.png +0 -0
  56. data/docs/images/arrow_up.png +0 -0
  57. data/docs/images/brick.png +0 -0
  58. data/docs/images/brick_link.png +0 -0
  59. data/docs/images/bug.png +0 -0
  60. data/docs/images/bullet_black.png +0 -0
  61. data/docs/images/bullet_toggle_minus.png +0 -0
  62. data/docs/images/bullet_toggle_plus.png +0 -0
  63. data/docs/images/date.png +0 -0
  64. data/docs/images/delete.png +0 -0
  65. data/docs/images/find.png +0 -0
  66. data/docs/images/loadingAnimation.gif +0 -0
  67. data/docs/images/macFFBgHack.png +0 -0
  68. data/docs/images/package.png +0 -0
  69. data/docs/images/page_green.png +0 -0
  70. data/docs/images/page_white_text.png +0 -0
  71. data/docs/images/page_white_width.png +0 -0
  72. data/docs/images/plugin.png +0 -0
  73. data/docs/images/ruby.png +0 -0
  74. data/docs/images/tag_blue.png +0 -0
  75. data/docs/images/tag_green.png +0 -0
  76. data/docs/images/transparent.png +0 -0
  77. data/docs/images/wrench.png +0 -0
  78. data/docs/images/wrench_orange.png +0 -0
  79. data/docs/images/zoom.png +0 -0
  80. data/docs/index.html +117 -0
  81. data/docs/js/darkfish.js +84 -0
  82. data/docs/js/navigation.js +105 -0
  83. data/docs/js/navigation.js.gz +0 -0
  84. data/docs/js/search.js +110 -0
  85. data/docs/js/search_index.js +1 -0
  86. data/docs/js/search_index.js.gz +0 -0
  87. data/docs/js/searcher.js +229 -0
  88. data/docs/js/searcher.js.gz +0 -0
  89. data/docs/table_of_contents.html +785 -0
  90. data/easypost.gemspec +3 -1
  91. data/lib/easypost/carrier_account.rb +17 -0
  92. data/lib/easypost/shipment.rb +1 -1
  93. data/lib/easypost/user.rb +5 -2
  94. data/lib/easypost/util.rb +2 -0
  95. metadata +115 -6
@@ -0,0 +1,334 @@
1
+ <!DOCTYPE html>
2
+
3
+ <html>
4
+ <head>
5
+ <meta charset="UTF-8">
6
+
7
+ <title>class EasyPost::Referral - EasyPost Ruby Docs</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="Resource.html">EasyPost::Resource</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-c-add_credit_card">::add_credit_card</a>
76
+ <li ><a href="#method-c-all">::all</a>
77
+ <li ><a href="#method-c-create">::create</a>
78
+ <li ><a href="#method-c-create_easypost_credit_card">::create_easypost_credit_card</a>
79
+ <li ><a href="#method-c-create_stripe_token">::create_stripe_token</a>
80
+ <li ><a href="#method-c-retrieve_easypost_stripe_api_key">::retrieve_easypost_stripe_api_key</a>
81
+ <li ><a href="#method-c-update_email">::update_email</a>
82
+ </ul>
83
+ </div>
84
+
85
+ </div>
86
+ </nav>
87
+
88
+ <main role="main" aria-labelledby="class-EasyPost::Referral">
89
+ <h1 id="class-EasyPost::Referral" class="class">
90
+ class EasyPost::Referral
91
+ </h1>
92
+
93
+ <section class="description">
94
+
95
+ <p><a href="Referral.html"><code>Referral</code></a> objects are User objects created from a Partner user.</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-add_credit_card" class="method-detail ">
111
+ <div class="method-heading">
112
+ <span class="method-name">add_credit_card</span><span
113
+ class="method-args">(referral_api_key, number, expiration_month, expiration_year, cvc, priority = &#39;primary&#39;)</span>
114
+ <span class="method-click-advice">click to toggle source</span>
115
+ </div>
116
+
117
+ <div class="method-description">
118
+ <p>Add credit card to a referral user. This function requires the <a href="Referral.html"><code>Referral</code></a> User’s API key.</p>
119
+
120
+ <div class="method-source-code" id="add_credit_card-source">
121
+ <pre><span class="ruby-comment"># File lib/easypost/referral.rb, line 84</span>
122
+ <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">add_credit_card</span>(<span class="ruby-identifier">referral_api_key</span>, <span class="ruby-identifier">number</span>, <span class="ruby-identifier">expiration_month</span>, <span class="ruby-identifier">expiration_year</span>, <span class="ruby-identifier">cvc</span>, <span class="ruby-identifier">priority</span> = <span class="ruby-string">&#39;primary&#39;</span>)
123
+ <span class="ruby-identifier">easypost_stripe_api_key</span> = <span class="ruby-identifier">retrieve_easypost_stripe_api_key</span>
124
+
125
+ <span class="ruby-keyword">begin</span>
126
+ <span class="ruby-identifier">stripe_credit_card_token</span> = <span class="ruby-identifier">create_stripe_token</span>(
127
+ <span class="ruby-identifier">number</span>,
128
+ <span class="ruby-identifier">expiration_month</span>,
129
+ <span class="ruby-identifier">expiration_year</span>,
130
+ <span class="ruby-identifier">cvc</span>,
131
+ <span class="ruby-identifier">easypost_stripe_api_key</span>,
132
+ )
133
+ <span class="ruby-keyword">rescue</span> <span class="ruby-constant">StandardError</span>
134
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">EasyPost</span><span class="ruby-operator">::</span><span class="ruby-constant">Error</span>.<span class="ruby-identifier">new</span>(<span class="ruby-string">&#39;Could not send card details to Stripe, please try again later.&#39;</span>)
135
+ <span class="ruby-keyword">end</span>
136
+
137
+ <span class="ruby-identifier">response</span> = <span class="ruby-identifier">create_easypost_credit_card</span>(<span class="ruby-identifier">referral_api_key</span>, <span class="ruby-identifier">stripe_credit_card_token</span>, <span class="ruby-identifier">priority</span>)
138
+ <span class="ruby-constant">EasyPost</span><span class="ruby-operator">::</span><span class="ruby-constant">Util</span>.<span class="ruby-identifier">convert_to_easypost_object</span>(<span class="ruby-identifier">response</span>, <span class="ruby-identifier">referral_api_key</span>)
139
+ <span class="ruby-keyword">end</span></pre>
140
+ </div>
141
+ </div>
142
+
143
+
144
+ </div>
145
+
146
+ <div id="method-c-all" class="method-detail ">
147
+ <div class="method-heading">
148
+ <span class="method-name">all</span><span
149
+ class="method-args">(params = {}, api_key = nil)</span>
150
+ <span class="method-click-advice">click to toggle source</span>
151
+ </div>
152
+
153
+ <div class="method-description">
154
+ <p>Retrieve a list of referral users. This function requires the Partner User’s API key.</p>
155
+
156
+ <div class="method-source-code" id="all-source">
157
+ <pre><span class="ruby-comment"># File lib/easypost/referral.rb, line 78</span>
158
+ <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">all</span>(<span class="ruby-identifier">params</span> = {}, <span class="ruby-identifier">api_key</span> = <span class="ruby-keyword">nil</span>)
159
+ <span class="ruby-identifier">response</span> = <span class="ruby-constant">EasyPost</span>.<span class="ruby-identifier">make_request</span>(<span class="ruby-value">:get</span>, <span class="ruby-string">&#39;/v2/referral_customers&#39;</span>, <span class="ruby-identifier">api_key</span>, <span class="ruby-identifier">params</span>)
160
+ <span class="ruby-constant">EasyPost</span><span class="ruby-operator">::</span><span class="ruby-constant">Util</span>.<span class="ruby-identifier">convert_to_easypost_object</span>(<span class="ruby-identifier">response</span>, <span class="ruby-identifier">api_key</span>)
161
+ <span class="ruby-keyword">end</span></pre>
162
+ </div>
163
+ </div>
164
+
165
+
166
+ </div>
167
+
168
+ <div id="method-c-create" class="method-detail ">
169
+ <div class="method-heading">
170
+ <span class="method-name">create</span><span
171
+ class="method-args">(params = {}, api_key = nil)</span>
172
+ <span class="method-click-advice">click to toggle source</span>
173
+ </div>
174
+
175
+ <div class="method-description">
176
+ <p>Create a referral user. This function requires the Partner User’s API key.</p>
177
+
178
+ <div class="method-source-code" id="create-source">
179
+ <pre><span class="ruby-comment"># File lib/easypost/referral.rb, line 59</span>
180
+ <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">create</span>(<span class="ruby-identifier">params</span> = {}, <span class="ruby-identifier">api_key</span> = <span class="ruby-keyword">nil</span>)
181
+ <span class="ruby-identifier">response</span> = <span class="ruby-constant">EasyPost</span>.<span class="ruby-identifier">make_request</span>(<span class="ruby-value">:post</span>, <span class="ruby-string">&#39;/v2/referral_customers&#39;</span>, <span class="ruby-identifier">api_key</span>, { <span class="ruby-value">user:</span> <span class="ruby-identifier">params</span> })
182
+ <span class="ruby-constant">EasyPost</span><span class="ruby-operator">::</span><span class="ruby-constant">Util</span>.<span class="ruby-identifier">convert_to_easypost_object</span>(<span class="ruby-identifier">response</span>, <span class="ruby-identifier">api_key</span>)
183
+ <span class="ruby-keyword">end</span></pre>
184
+ </div>
185
+ </div>
186
+
187
+
188
+ </div>
189
+
190
+ <div id="method-c-update_email" class="method-detail ">
191
+ <div class="method-heading">
192
+ <span class="method-name">update_email</span><span
193
+ class="method-args">(email, user_id, api_key = nil)</span>
194
+ <span class="method-click-advice">click to toggle source</span>
195
+ </div>
196
+
197
+ <div class="method-description">
198
+ <p>Update a referral user. This function requires the Partner User’s API key.</p>
199
+
200
+ <div class="method-source-code" id="update_email-source">
201
+ <pre><span class="ruby-comment"># File lib/easypost/referral.rb, line 65</span>
202
+ <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">update_email</span>(<span class="ruby-identifier">email</span>, <span class="ruby-identifier">user_id</span>, <span class="ruby-identifier">api_key</span> = <span class="ruby-keyword">nil</span>)
203
+ <span class="ruby-identifier">wrapped_params</span> = {
204
+ <span class="ruby-value">user:</span> {
205
+ <span class="ruby-value">email:</span> <span class="ruby-identifier">email</span>,
206
+ },
207
+ }
208
+ <span class="ruby-constant">EasyPost</span>.<span class="ruby-identifier">make_request</span>(<span class="ruby-value">:put</span>, <span class="ruby-node">&quot;/v2/referral_customers/#{user_id}&quot;</span>, <span class="ruby-identifier">api_key</span>, <span class="ruby-identifier">wrapped_params</span>)
209
+
210
+ <span class="ruby-comment"># return true if API succeeds, else an error is throw if it fails.</span>
211
+ <span class="ruby-keyword">true</span>
212
+ <span class="ruby-keyword">end</span></pre>
213
+ </div>
214
+ </div>
215
+
216
+
217
+ </div>
218
+
219
+ </section>
220
+
221
+ <section id="protected-class-5Buntitled-5D-method-details" class="method-section">
222
+ <header>
223
+ <h3>Protected Class Methods</h3>
224
+ </header>
225
+
226
+ <div id="method-c-create_easypost_credit_card" class="method-detail ">
227
+ <div class="method-heading">
228
+ <span class="method-name">create_easypost_credit_card</span><span
229
+ class="method-args">(referral_api_key, stripe_object_id, priority = &#39;primary&#39;)</span>
230
+ <span class="method-click-advice">click to toggle source</span>
231
+ </div>
232
+
233
+ <div class="method-description">
234
+ <p>Submit Stripe credit card token to <a href="../EasyPost.html"><code>EasyPost</code></a>.</p>
235
+
236
+ <div class="method-source-code" id="create_easypost_credit_card-source">
237
+ <pre><span class="ruby-comment"># File lib/easypost/referral.rb, line 46</span>
238
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">create_easypost_credit_card</span>(<span class="ruby-identifier">referral_api_key</span>, <span class="ruby-identifier">stripe_object_id</span>, <span class="ruby-identifier">priority</span> = <span class="ruby-string">&#39;primary&#39;</span>)
239
+ <span class="ruby-identifier">wrapped_params</span> = {
240
+ <span class="ruby-value">credit_card:</span> {
241
+ <span class="ruby-value">stripe_object_id:</span> <span class="ruby-identifier">stripe_object_id</span>,
242
+ <span class="ruby-value">priority:</span> <span class="ruby-identifier">priority</span>,
243
+ },
244
+ }
245
+ <span class="ruby-identifier">response</span> = <span class="ruby-constant">EasyPost</span>.<span class="ruby-identifier">make_request</span>(<span class="ruby-value">:post</span>, <span class="ruby-string">&#39;/beta/credit_cards&#39;</span>, <span class="ruby-identifier">referral_api_key</span>, <span class="ruby-identifier">wrapped_params</span>)
246
+ <span class="ruby-constant">EasyPost</span><span class="ruby-operator">::</span><span class="ruby-constant">Util</span>.<span class="ruby-identifier">convert_to_easypost_object</span>(<span class="ruby-identifier">response</span>, <span class="ruby-identifier">referral_api_key</span>)
247
+ <span class="ruby-keyword">end</span></pre>
248
+ </div>
249
+ </div>
250
+
251
+
252
+ </div>
253
+
254
+ <div id="method-c-create_stripe_token" class="method-detail ">
255
+ <div class="method-heading">
256
+ <span class="method-name">create_stripe_token</span><span
257
+ class="method-args">(number, expiration_month, expiration_year, cvc, easypost_stripe_token)</span>
258
+ <span class="method-click-advice">click to toggle source</span>
259
+ </div>
260
+
261
+ <div class="method-description">
262
+ <p>Get credit card token from Stripe.</p>
263
+
264
+ <div class="method-source-code" id="create_stripe_token-source">
265
+ <pre><span class="ruby-comment"># File lib/easypost/referral.rb, line 15</span>
266
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">create_stripe_token</span>(<span class="ruby-identifier">number</span>, <span class="ruby-identifier">expiration_month</span>, <span class="ruby-identifier">expiration_year</span>,
267
+ <span class="ruby-identifier">cvc</span>, <span class="ruby-identifier">easypost_stripe_token</span>)
268
+ <span class="ruby-identifier">headers</span> = {
269
+ <span class="ruby-comment"># This Stripe endpoint only accepts URL form encoded bodies.</span>
270
+ <span class="ruby-value">Authorization:</span> <span class="ruby-node">&quot;Bearer #{easypost_stripe_token}&quot;</span>,
271
+ <span class="ruby-value">&#39;Content-type&#39;:</span> <span class="ruby-string">&#39;application/x-www-form-urlencoded&#39;</span>,
272
+ }
273
+
274
+ <span class="ruby-identifier">credit_card_hash</span> = {
275
+ <span class="ruby-value">card:</span> {
276
+ <span class="ruby-value">number:</span> <span class="ruby-identifier">number</span>,
277
+ <span class="ruby-value">exp_month:</span> <span class="ruby-identifier">expiration_month</span>,
278
+ <span class="ruby-value">exp_year:</span> <span class="ruby-identifier">expiration_year</span>,
279
+ <span class="ruby-value">cvc:</span> <span class="ruby-identifier">cvc</span>,
280
+ },
281
+ }
282
+
283
+ <span class="ruby-identifier">form_encoded_params</span> = <span class="ruby-constant">EasyPost</span><span class="ruby-operator">::</span><span class="ruby-constant">Util</span>.<span class="ruby-identifier">form_encode_params</span>(<span class="ruby-identifier">credit_card_hash</span>)
284
+
285
+ <span class="ruby-identifier">uri</span> = <span class="ruby-constant">URI</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-string">&#39;https://api.stripe.com/v1/tokens&#39;</span>)
286
+ <span class="ruby-identifier">http</span> = <span class="ruby-constant">Net</span><span class="ruby-operator">::</span><span class="ruby-constant">HTTP</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">uri</span>.<span class="ruby-identifier">host</span>, <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">port</span>)
287
+ <span class="ruby-identifier">http</span>.<span class="ruby-identifier">use_ssl</span> = <span class="ruby-keyword">true</span>
288
+ <span class="ruby-identifier">request</span> = <span class="ruby-constant">Net</span><span class="ruby-operator">::</span><span class="ruby-constant">HTTP</span><span class="ruby-operator">::</span><span class="ruby-constant">Post</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">uri</span>.<span class="ruby-identifier">request_uri</span>, <span class="ruby-identifier">headers</span>)
289
+ <span class="ruby-identifier">query</span> = <span class="ruby-constant">URI</span>.<span class="ruby-identifier">encode_www_form</span>(<span class="ruby-identifier">form_encoded_params</span>)
290
+
291
+ <span class="ruby-identifier">response</span> = <span class="ruby-identifier">http</span>.<span class="ruby-identifier">request</span>(<span class="ruby-identifier">request</span>, <span class="ruby-identifier">query</span>)
292
+ <span class="ruby-identifier">response_json</span> = <span class="ruby-constant">JSON</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">response</span>.<span class="ruby-identifier">body</span>)
293
+ <span class="ruby-identifier">response_json</span>[<span class="ruby-string">&#39;id&#39;</span>]
294
+ <span class="ruby-keyword">end</span></pre>
295
+ </div>
296
+ </div>
297
+
298
+
299
+ </div>
300
+
301
+ <div id="method-c-retrieve_easypost_stripe_api_key" class="method-detail ">
302
+ <div class="method-heading">
303
+ <span class="method-name">retrieve_easypost_stripe_api_key</span><span
304
+ class="method-args">()</span>
305
+ <span class="method-click-advice">click to toggle source</span>
306
+ </div>
307
+
308
+ <div class="method-description">
309
+ <p>Retrieve EasyPost’s Stripe public API key.</p>
310
+
311
+ <div class="method-source-code" id="retrieve_easypost_stripe_api_key-source">
312
+ <pre><span class="ruby-comment"># File lib/easypost/referral.rb, line 9</span>
313
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">retrieve_easypost_stripe_api_key</span>
314
+ <span class="ruby-identifier">response</span> = <span class="ruby-constant">EasyPost</span>.<span class="ruby-identifier">make_request</span>(<span class="ruby-value">:get</span>, <span class="ruby-string">&#39;/beta/partners/stripe_public_key&#39;</span>, <span class="ruby-ivar">@api_key</span>)
315
+ <span class="ruby-identifier">response</span>[<span class="ruby-string">&#39;public_key&#39;</span>]
316
+ <span class="ruby-keyword">end</span></pre>
317
+ </div>
318
+ </div>
319
+
320
+
321
+ </div>
322
+
323
+ </section>
324
+
325
+ </section>
326
+ </main>
327
+
328
+
329
+ <footer id="validator-badges" role="contentinfo">
330
+ <p><a href="https://validator.w3.org/check/referer">Validate</a>
331
+ <p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.4.0.
332
+ <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
333
+ </footer>
334
+
@@ -0,0 +1,99 @@
1
+ <!DOCTYPE html>
2
+
3
+ <html>
4
+ <head>
5
+ <meta charset="UTF-8">
6
+
7
+ <title>class EasyPost::Refund - EasyPost Ruby Docs</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="Resource.html">EasyPost::Resource</a>
65
+ </div>
66
+
67
+
68
+
69
+
70
+ </div>
71
+ </nav>
72
+
73
+ <main role="main" aria-labelledby="class-EasyPost::Refund">
74
+ <h1 id="class-EasyPost::Refund" class="class">
75
+ class EasyPost::Refund
76
+ </h1>
77
+
78
+ <section class="description">
79
+
80
+ <p>The <a href="Refund.html"><code>Refund</code></a> object contains details about the <a href="Refund.html"><code>Refund</code></a> of a Shipment.</p>
81
+
82
+ </section>
83
+
84
+ <section id="5Buntitled-5D" class="documentation-section">
85
+
86
+
87
+
88
+
89
+
90
+ </section>
91
+ </main>
92
+
93
+
94
+ <footer id="validator-badges" role="contentinfo">
95
+ <p><a href="https://validator.w3.org/check/referer">Validate</a>
96
+ <p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.4.0.
97
+ <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
98
+ </footer>
99
+
@@ -0,0 +1,167 @@
1
+ <!DOCTYPE html>
2
+
3
+ <html>
4
+ <head>
5
+ <meta charset="UTF-8">
6
+
7
+ <title>class EasyPost::Report - EasyPost Ruby Docs</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="Resource.html">EasyPost::Resource</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-c-all">::all</a>
76
+ <li ><a href="#method-c-create">::create</a>
77
+ </ul>
78
+ </div>
79
+
80
+ </div>
81
+ </nav>
82
+
83
+ <main role="main" aria-labelledby="class-EasyPost::Report">
84
+ <h1 id="class-EasyPost::Report" class="class">
85
+ class EasyPost::Report
86
+ </h1>
87
+
88
+ <section class="description">
89
+
90
+ <p>A <a href="Report.html"><code>Report</code></a> contains a csv that is a log of all the objects created within a certain time frame.</p>
91
+
92
+ </section>
93
+
94
+ <section id="5Buntitled-5D" class="documentation-section">
95
+
96
+
97
+
98
+
99
+
100
+ <section id="public-class-5Buntitled-5D-method-details" class="method-section">
101
+ <header>
102
+ <h3>Public Class Methods</h3>
103
+ </header>
104
+
105
+ <div id="method-c-all" class="method-detail ">
106
+ <div class="method-heading">
107
+ <span class="method-name">all</span><span
108
+ class="method-args">(filters = {}, api_key = nil)</span>
109
+ <span class="method-click-advice">click to toggle source</span>
110
+ </div>
111
+
112
+ <div class="method-description">
113
+ <p>Retrieve a list of <a href="Report.html"><code>Report</code></a> objects.</p>
114
+
115
+ <div class="method-source-code" id="all-source">
116
+ <pre><span class="ruby-comment"># File lib/easypost/report.rb, line 17</span>
117
+ <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">all</span>(<span class="ruby-identifier">filters</span> = {}, <span class="ruby-identifier">api_key</span> = <span class="ruby-keyword">nil</span>)
118
+ <span class="ruby-identifier">url</span> = <span class="ruby-node">&quot;#{self.url}/#{filters[:type]}&quot;</span>
119
+
120
+ <span class="ruby-identifier">response</span> = <span class="ruby-constant">EasyPost</span>.<span class="ruby-identifier">make_request</span>(<span class="ruby-value">:get</span>, <span class="ruby-identifier">url</span>, <span class="ruby-identifier">api_key</span>, <span class="ruby-identifier">filters</span>)
121
+ <span class="ruby-constant">EasyPost</span><span class="ruby-operator">::</span><span class="ruby-constant">Util</span>.<span class="ruby-identifier">convert_to_easypost_object</span>(<span class="ruby-identifier">response</span>, <span class="ruby-identifier">api_key</span>)
122
+ <span class="ruby-keyword">end</span></pre>
123
+ </div>
124
+ </div>
125
+
126
+
127
+ </div>
128
+
129
+ <div id="method-c-create" class="method-detail ">
130
+ <div class="method-heading">
131
+ <span class="method-name">create</span><span
132
+ class="method-args">(params = {}, api_key = nil)</span>
133
+ <span class="method-click-advice">click to toggle source</span>
134
+ </div>
135
+
136
+ <div class="method-description">
137
+ <p>Create a <a href="Report.html"><code>Report</code></a>.</p>
138
+
139
+ <div class="method-source-code" id="create-source">
140
+ <pre><span class="ruby-comment"># File lib/easypost/report.rb, line 6</span>
141
+ <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">create</span>(<span class="ruby-identifier">params</span> = {}, <span class="ruby-identifier">api_key</span> = <span class="ruby-keyword">nil</span>)
142
+ <span class="ruby-identifier">url</span> = <span class="ruby-node">&quot;#{self.url}/#{params[:type]}&quot;</span>
143
+
144
+ <span class="ruby-identifier">wrapped_params</span> = {}
145
+ <span class="ruby-identifier">wrapped_params</span>[<span class="ruby-identifier">class_name</span>.<span class="ruby-identifier">to_sym</span>] = <span class="ruby-identifier">params</span>
146
+
147
+ <span class="ruby-identifier">response</span> = <span class="ruby-constant">EasyPost</span>.<span class="ruby-identifier">make_request</span>(<span class="ruby-value">:post</span>, <span class="ruby-identifier">url</span>, <span class="ruby-identifier">api_key</span>, <span class="ruby-identifier">params</span>)
148
+ <span class="ruby-constant">EasyPost</span><span class="ruby-operator">::</span><span class="ruby-constant">Util</span>.<span class="ruby-identifier">convert_to_easypost_object</span>(<span class="ruby-identifier">response</span>, <span class="ruby-identifier">api_key</span>)
149
+ <span class="ruby-keyword">end</span></pre>
150
+ </div>
151
+ </div>
152
+
153
+
154
+ </div>
155
+
156
+ </section>
157
+
158
+ </section>
159
+ </main>
160
+
161
+
162
+ <footer id="validator-badges" role="contentinfo">
163
+ <p><a href="https://validator.w3.org/check/referer">Validate</a>
164
+ <p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.4.0.
165
+ <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
166
+ </footer>
167
+