easypost 4.11.0 → 4.12.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/README.md +5 -1
- data/VERSION +1 -1
- data/easypost.gemspec +2 -2
- data/lib/easypost/beta/rate.rb +14 -0
- data/lib/easypost/beta.rb +1 -0
- data/lib/easypost/billing.rb +6 -6
- data/lib/easypost/util.rb +52 -0
- metadata +3 -83
- data/docs/EasyPost/Address.html +0 -222
- data/docs/EasyPost/ApiKey.html +0 -99
- data/docs/EasyPost/Batch.html +0 -269
- data/docs/EasyPost/Beta/EndShipper.html +0 -225
- data/docs/EasyPost/Beta/Referral.html +0 -338
- data/docs/EasyPost/Beta.html +0 -91
- data/docs/EasyPost/Billing.html +0 -253
- data/docs/EasyPost/Brand.html +0 -140
- data/docs/EasyPost/CarbonOffset.html +0 -99
- data/docs/EasyPost/CarrierAccount.html +0 -136
- data/docs/EasyPost/CarrierType.html +0 -99
- data/docs/EasyPost/CustomsInfo.html +0 -136
- data/docs/EasyPost/CustomsItem.html +0 -136
- data/docs/EasyPost/EasyPostObject.html +0 -662
- data/docs/EasyPost/EndShipper.html +0 -175
- data/docs/EasyPost/Error.html +0 -258
- data/docs/EasyPost/Event.html +0 -136
- data/docs/EasyPost/Insurance.html +0 -99
- data/docs/EasyPost/Order.html +0 -222
- data/docs/EasyPost/Parcel.html +0 -136
- data/docs/EasyPost/PaymentMethod.html +0 -137
- data/docs/EasyPost/Pickup.html +0 -222
- data/docs/EasyPost/PickupRate.html +0 -99
- data/docs/EasyPost/PostageLabel.html +0 -99
- data/docs/EasyPost/Rate.html +0 -136
- data/docs/EasyPost/Referral.html +0 -334
- data/docs/EasyPost/Refund.html +0 -99
- data/docs/EasyPost/Report.html +0 -167
- data/docs/EasyPost/Resource.html +0 -399
- data/docs/EasyPost/ScanForm.html +0 -137
- data/docs/EasyPost/Shipment.html +0 -456
- data/docs/EasyPost/TaxIdentifier.html +0 -99
- data/docs/EasyPost/Tracker.html +0 -139
- data/docs/EasyPost/User.html +0 -307
- data/docs/EasyPost/Util.html +0 -462
- data/docs/EasyPost/Webhook.html +0 -221
- data/docs/EasyPost.html +0 -440
- data/docs/created.rid +0 -40
- data/docs/css/fonts.css +0 -167
- data/docs/css/rdoc.css +0 -639
- 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 +0 -117
- data/docs/js/darkfish.js +0 -84
- data/docs/js/navigation.js +0 -105
- data/docs/js/navigation.js.gz +0 -0
- data/docs/js/search.js +0 -110
- data/docs/js/search_index.js +0 -1
- data/docs/js/search_index.js.gz +0 -0
- data/docs/js/searcher.js +0 -229
- data/docs/js/searcher.js.gz +0 -0
- data/docs/table_of_contents.html +0 -785
data/docs/EasyPost/Referral.html
DELETED
@@ -1,334 +0,0 @@
|
|
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 = 'primary')</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 customer. 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">'primary'</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">'Could not send card details to Stripe, please try again later.'</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 customers. 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">'/v2/referral_customers'</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 customer. 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">'/v2/referral_customers'</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 customer. 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">"/v2/referral_customers/#{user_id}"</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 = 'primary')</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">'primary'</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">'/beta/credit_cards'</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">"Bearer #{easypost_stripe_token}"</span>,
|
271
|
-
<span class="ruby-value">'Content-type':</span> <span class="ruby-string">'application/x-www-form-urlencoded'</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">'https://api.stripe.com/v1/tokens'</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">'id'</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">'/beta/partners/stripe_public_key'</span>, <span class="ruby-ivar">@api_key</span>)
|
315
|
-
<span class="ruby-identifier">response</span>[<span class="ruby-string">'public_key'</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
|
-
|
data/docs/EasyPost/Refund.html
DELETED
@@ -1,99 +0,0 @@
|
|
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
|
-
|
data/docs/EasyPost/Report.html
DELETED
@@ -1,167 +0,0 @@
|
|
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">"#{self.url}/#{filters[:type]}"</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">"#{self.url}/#{params[:type]}"</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
|
-
|