venice 0.4.3 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +4 -4
- data/README.md +1 -0
- data/coverage/assets/0.10.2/application.css +799 -0
- data/coverage/assets/0.10.2/application.js +1707 -0
- data/coverage/assets/0.10.2/colorbox/border.png +0 -0
- data/coverage/assets/0.10.2/colorbox/controls.png +0 -0
- data/coverage/assets/0.10.2/colorbox/loading.gif +0 -0
- data/coverage/assets/0.10.2/colorbox/loading_background.png +0 -0
- data/coverage/assets/0.10.2/favicon_green.png +0 -0
- data/coverage/assets/0.10.2/favicon_red.png +0 -0
- data/coverage/assets/0.10.2/favicon_yellow.png +0 -0
- data/coverage/assets/0.10.2/loading.gif +0 -0
- data/coverage/assets/0.10.2/magnify.png +0 -0
- data/coverage/assets/0.10.2/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/coverage/assets/0.10.2/smoothness/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/coverage/assets/0.10.2/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- data/coverage/assets/0.10.2/smoothness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/coverage/assets/0.10.2/smoothness/images/ui-bg_glass_75_dadada_1x400.png +0 -0
- data/coverage/assets/0.10.2/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- data/coverage/assets/0.10.2/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/coverage/assets/0.10.2/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- data/coverage/assets/0.10.2/smoothness/images/ui-icons_222222_256x240.png +0 -0
- data/coverage/assets/0.10.2/smoothness/images/ui-icons_2e83ff_256x240.png +0 -0
- data/coverage/assets/0.10.2/smoothness/images/ui-icons_454545_256x240.png +0 -0
- data/coverage/assets/0.10.2/smoothness/images/ui-icons_888888_256x240.png +0 -0
- data/coverage/assets/0.10.2/smoothness/images/ui-icons_cd0a0a_256x240.png +0 -0
- data/coverage/index.html +2988 -0
- data/lib/venice/client.rb +8 -4
- data/lib/venice/in_app_receipt.rb +5 -3
- data/lib/venice/version.rb +1 -1
- data/spec/client_spec.rb +1 -1
- data/spec/in_app_receipt_spec.rb +5 -3
- data/venice.gemspec +2 -3
- metadata +28 -3
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
data/coverage/index.html
ADDED
@@ -0,0 +1,2988 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html xmlns='http://www.w3.org/1999/xhtml'>
|
3
|
+
<head>
|
4
|
+
<title>Code coverage for Venice</title>
|
5
|
+
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
6
|
+
<script src='./assets/0.10.2/application.js' type='text/javascript'></script>
|
7
|
+
<link href='./assets/0.10.2/application.css' media='screen, projection, print' rel='stylesheet' type='text/css'>
|
8
|
+
<link rel="shortcut icon" type="image/png" href="./assets/0.10.2/favicon_yellow.png" />
|
9
|
+
<link rel="icon" type="image/png" href="./assets/0.10.2/favicon.png" />
|
10
|
+
</head>
|
11
|
+
|
12
|
+
<body>
|
13
|
+
<div id="loading">
|
14
|
+
<img src="./assets/0.10.2/loading.gif" alt="loading"/>
|
15
|
+
</div>
|
16
|
+
<div id="wrapper" style="display:none;">
|
17
|
+
<div class="timestamp">Generated <abbr class="timeago" title="2018-07-30T19:20:03+03:00">2018-07-30T19:20:03+03:00</abbr></div>
|
18
|
+
<ul class="group_tabs"></ul>
|
19
|
+
|
20
|
+
<div id="content">
|
21
|
+
<div class="file_list_container" id="AllFiles">
|
22
|
+
<h2>
|
23
|
+
<span class="group_name">All Files</span>
|
24
|
+
(<span class="covered_percent"><span class="yellow">86.82%</span></span>
|
25
|
+
covered at
|
26
|
+
<span class="covered_strength">
|
27
|
+
<span class="green">
|
28
|
+
4.22
|
29
|
+
</span>
|
30
|
+
</span> hits/line)
|
31
|
+
</h2>
|
32
|
+
<a name="AllFiles"></a>
|
33
|
+
<div>
|
34
|
+
<b>6</b> files in total.
|
35
|
+
<b>220</b> relevant lines.
|
36
|
+
<span class="green"><b>191</b> lines covered</span> and
|
37
|
+
<span class="red"><b>29</b> lines missed </span>
|
38
|
+
</div>
|
39
|
+
<table class="file_list">
|
40
|
+
<thead>
|
41
|
+
<tr>
|
42
|
+
<th>File</th>
|
43
|
+
<th>% covered</th>
|
44
|
+
<th>Lines</th>
|
45
|
+
<th>Relevant Lines</th>
|
46
|
+
<th>Lines covered</th>
|
47
|
+
<th>Lines missed</th>
|
48
|
+
<th>Avg. Hits / Line</th>
|
49
|
+
</tr>
|
50
|
+
</thead>
|
51
|
+
<tbody>
|
52
|
+
|
53
|
+
<tr>
|
54
|
+
<td class="strong"><a href="#e251f68a6261445ba7457451b6ed5056cd38632f" class="src_link" title="lib/venice.rb">lib/venice.rb</a></td>
|
55
|
+
<td class="green strong">100.0 %</td>
|
56
|
+
<td>5</td>
|
57
|
+
<td>5</td>
|
58
|
+
<td>5</td>
|
59
|
+
<td>0</td>
|
60
|
+
<td>1.0</td>
|
61
|
+
</tr>
|
62
|
+
|
63
|
+
<tr>
|
64
|
+
<td class="strong"><a href="#98805fb05519de199f58f381b2fc69059000262c" class="src_link" title="lib/venice/client.rb">lib/venice/client.rb</a></td>
|
65
|
+
<td class="green strong">90.16 %</td>
|
66
|
+
<td>107</td>
|
67
|
+
<td>61</td>
|
68
|
+
<td>55</td>
|
69
|
+
<td>6</td>
|
70
|
+
<td>2.9</td>
|
71
|
+
</tr>
|
72
|
+
|
73
|
+
<tr>
|
74
|
+
<td class="strong"><a href="#00078d08685c036723fa2dda323c4912a6d636fc" class="src_link" title="lib/venice/in_app_receipt.rb">lib/venice/in_app_receipt.rb</a></td>
|
75
|
+
<td class="green strong">97.67 %</td>
|
76
|
+
<td>107</td>
|
77
|
+
<td>43</td>
|
78
|
+
<td>42</td>
|
79
|
+
<td>1</td>
|
80
|
+
<td>10.1</td>
|
81
|
+
</tr>
|
82
|
+
|
83
|
+
<tr>
|
84
|
+
<td class="strong"><a href="#1597d9fcc7a2e1275029900749d07a8311092fee" class="src_link" title="lib/venice/pending_renewal_info.rb">lib/venice/pending_renewal_info.rb</a></td>
|
85
|
+
<td class="green strong">95.65 %</td>
|
86
|
+
<td>64</td>
|
87
|
+
<td>23</td>
|
88
|
+
<td>22</td>
|
89
|
+
<td>1</td>
|
90
|
+
<td>3.4</td>
|
91
|
+
</tr>
|
92
|
+
|
93
|
+
<tr>
|
94
|
+
<td class="strong"><a href="#77ad70939c4d9b01595773040694e97b058d41a1" class="src_link" title="lib/venice/receipt.rb">lib/venice/receipt.rb</a></td>
|
95
|
+
<td class="red strong">75.58 %</td>
|
96
|
+
<td>171</td>
|
97
|
+
<td>86</td>
|
98
|
+
<td>65</td>
|
99
|
+
<td>21</td>
|
100
|
+
<td>2.7</td>
|
101
|
+
</tr>
|
102
|
+
|
103
|
+
<tr>
|
104
|
+
<td class="strong"><a href="#3ebfcfc298ce125918d25fd4c50e966d39734a2b" class="src_link" title="lib/venice/version.rb">lib/venice/version.rb</a></td>
|
105
|
+
<td class="green strong">100.0 %</td>
|
106
|
+
<td>3</td>
|
107
|
+
<td>2</td>
|
108
|
+
<td>2</td>
|
109
|
+
<td>0</td>
|
110
|
+
<td>1.0</td>
|
111
|
+
</tr>
|
112
|
+
|
113
|
+
</tbody>
|
114
|
+
</table>
|
115
|
+
</div>
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
</div>
|
120
|
+
|
121
|
+
<div id="footer">
|
122
|
+
Generated by <a href="http://github.com/colszowka/simplecov">simplecov</a> v0.16.1
|
123
|
+
and simplecov-html v0.10.2<br/>
|
124
|
+
using RSpec
|
125
|
+
</div>
|
126
|
+
|
127
|
+
<div class="source_files">
|
128
|
+
|
129
|
+
<div class="source_table" id="e251f68a6261445ba7457451b6ed5056cd38632f">
|
130
|
+
<div class="header">
|
131
|
+
<h3>lib/venice.rb</h3>
|
132
|
+
<h4><span class="green">100.0 %</span> covered</h4>
|
133
|
+
<div>
|
134
|
+
<b>5</b> relevant lines.
|
135
|
+
<span class="green"><b>5</b> lines covered</span> and
|
136
|
+
<span class="red"><b>0</b> lines missed.</span>
|
137
|
+
</div>
|
138
|
+
</div>
|
139
|
+
|
140
|
+
<pre>
|
141
|
+
<ol>
|
142
|
+
|
143
|
+
<li class="covered" data-hits="1" data-linenumber="1">
|
144
|
+
<span class="hits">1</span>
|
145
|
+
|
146
|
+
<code class="ruby">require 'venice/version'</code>
|
147
|
+
</li>
|
148
|
+
|
149
|
+
<li class="covered" data-hits="1" data-linenumber="2">
|
150
|
+
<span class="hits">1</span>
|
151
|
+
|
152
|
+
<code class="ruby">require 'venice/client'</code>
|
153
|
+
</li>
|
154
|
+
|
155
|
+
<li class="covered" data-hits="1" data-linenumber="3">
|
156
|
+
<span class="hits">1</span>
|
157
|
+
|
158
|
+
<code class="ruby">require 'venice/in_app_receipt'</code>
|
159
|
+
</li>
|
160
|
+
|
161
|
+
<li class="covered" data-hits="1" data-linenumber="4">
|
162
|
+
<span class="hits">1</span>
|
163
|
+
|
164
|
+
<code class="ruby">require 'venice/receipt'</code>
|
165
|
+
</li>
|
166
|
+
|
167
|
+
<li class="covered" data-hits="1" data-linenumber="5">
|
168
|
+
<span class="hits">1</span>
|
169
|
+
|
170
|
+
<code class="ruby">require 'venice/pending_renewal_info'</code>
|
171
|
+
</li>
|
172
|
+
|
173
|
+
</ol>
|
174
|
+
</pre>
|
175
|
+
</div>
|
176
|
+
|
177
|
+
|
178
|
+
<div class="source_table" id="98805fb05519de199f58f381b2fc69059000262c">
|
179
|
+
<div class="header">
|
180
|
+
<h3>lib/venice/client.rb</h3>
|
181
|
+
<h4><span class="green">90.16 %</span> covered</h4>
|
182
|
+
<div>
|
183
|
+
<b>61</b> relevant lines.
|
184
|
+
<span class="green"><b>55</b> lines covered</span> and
|
185
|
+
<span class="red"><b>6</b> lines missed.</span>
|
186
|
+
</div>
|
187
|
+
</div>
|
188
|
+
|
189
|
+
<pre>
|
190
|
+
<ol>
|
191
|
+
|
192
|
+
<li class="covered" data-hits="1" data-linenumber="1">
|
193
|
+
<span class="hits">1</span>
|
194
|
+
|
195
|
+
<code class="ruby">require 'json'</code>
|
196
|
+
</li>
|
197
|
+
|
198
|
+
<li class="covered" data-hits="1" data-linenumber="2">
|
199
|
+
<span class="hits">1</span>
|
200
|
+
|
201
|
+
<code class="ruby">require 'net/https'</code>
|
202
|
+
</li>
|
203
|
+
|
204
|
+
<li class="covered" data-hits="1" data-linenumber="3">
|
205
|
+
<span class="hits">1</span>
|
206
|
+
|
207
|
+
<code class="ruby">require 'uri'</code>
|
208
|
+
</li>
|
209
|
+
|
210
|
+
<li class="never" data-hits="" data-linenumber="4">
|
211
|
+
|
212
|
+
|
213
|
+
<code class="ruby"></code>
|
214
|
+
</li>
|
215
|
+
|
216
|
+
<li class="covered" data-hits="1" data-linenumber="5">
|
217
|
+
<span class="hits">1</span>
|
218
|
+
|
219
|
+
<code class="ruby">module Venice</code>
|
220
|
+
</li>
|
221
|
+
|
222
|
+
<li class="covered" data-hits="1" data-linenumber="6">
|
223
|
+
<span class="hits">1</span>
|
224
|
+
|
225
|
+
<code class="ruby"> ITUNES_PRODUCTION_RECEIPT_VERIFICATION_ENDPOINT = 'https://buy.itunes.apple.com/verifyReceipt'</code>
|
226
|
+
</li>
|
227
|
+
|
228
|
+
<li class="covered" data-hits="1" data-linenumber="7">
|
229
|
+
<span class="hits">1</span>
|
230
|
+
|
231
|
+
<code class="ruby"> ITUNES_DEVELOPMENT_RECEIPT_VERIFICATION_ENDPOINT = 'https://sandbox.itunes.apple.com/verifyReceipt'</code>
|
232
|
+
</li>
|
233
|
+
|
234
|
+
<li class="never" data-hits="" data-linenumber="8">
|
235
|
+
|
236
|
+
|
237
|
+
<code class="ruby"></code>
|
238
|
+
</li>
|
239
|
+
|
240
|
+
<li class="covered" data-hits="1" data-linenumber="9">
|
241
|
+
<span class="hits">1</span>
|
242
|
+
|
243
|
+
<code class="ruby"> class Client</code>
|
244
|
+
</li>
|
245
|
+
|
246
|
+
<li class="covered" data-hits="1" data-linenumber="10">
|
247
|
+
<span class="hits">1</span>
|
248
|
+
|
249
|
+
<code class="ruby"> attr_accessor :verification_url</code>
|
250
|
+
</li>
|
251
|
+
|
252
|
+
<li class="covered" data-hits="1" data-linenumber="11">
|
253
|
+
<span class="hits">1</span>
|
254
|
+
|
255
|
+
<code class="ruby"> attr_writer :shared_secret</code>
|
256
|
+
</li>
|
257
|
+
|
258
|
+
<li class="covered" data-hits="1" data-linenumber="12">
|
259
|
+
<span class="hits">1</span>
|
260
|
+
|
261
|
+
<code class="ruby"> attr_writer :exclude_old_transactions</code>
|
262
|
+
</li>
|
263
|
+
|
264
|
+
<li class="never" data-hits="" data-linenumber="13">
|
265
|
+
|
266
|
+
|
267
|
+
<code class="ruby"></code>
|
268
|
+
</li>
|
269
|
+
|
270
|
+
<li class="covered" data-hits="1" data-linenumber="14">
|
271
|
+
<span class="hits">1</span>
|
272
|
+
|
273
|
+
<code class="ruby"> class << self</code>
|
274
|
+
</li>
|
275
|
+
|
276
|
+
<li class="covered" data-hits="1" data-linenumber="15">
|
277
|
+
<span class="hits">1</span>
|
278
|
+
|
279
|
+
<code class="ruby"> def development</code>
|
280
|
+
</li>
|
281
|
+
|
282
|
+
<li class="missed" data-hits="0" data-linenumber="16">
|
283
|
+
|
284
|
+
|
285
|
+
<code class="ruby"> client = new</code>
|
286
|
+
</li>
|
287
|
+
|
288
|
+
<li class="missed" data-hits="0" data-linenumber="17">
|
289
|
+
|
290
|
+
|
291
|
+
<code class="ruby"> client.verification_url = ITUNES_DEVELOPMENT_RECEIPT_VERIFICATION_ENDPOINT</code>
|
292
|
+
</li>
|
293
|
+
|
294
|
+
<li class="missed" data-hits="0" data-linenumber="18">
|
295
|
+
|
296
|
+
|
297
|
+
<code class="ruby"> client</code>
|
298
|
+
</li>
|
299
|
+
|
300
|
+
<li class="never" data-hits="" data-linenumber="19">
|
301
|
+
|
302
|
+
|
303
|
+
<code class="ruby"> end</code>
|
304
|
+
</li>
|
305
|
+
|
306
|
+
<li class="never" data-hits="" data-linenumber="20">
|
307
|
+
|
308
|
+
|
309
|
+
<code class="ruby"></code>
|
310
|
+
</li>
|
311
|
+
|
312
|
+
<li class="covered" data-hits="1" data-linenumber="21">
|
313
|
+
<span class="hits">1</span>
|
314
|
+
|
315
|
+
<code class="ruby"> def production</code>
|
316
|
+
</li>
|
317
|
+
|
318
|
+
<li class="covered" data-hits="1" data-linenumber="22">
|
319
|
+
<span class="hits">1</span>
|
320
|
+
|
321
|
+
<code class="ruby"> client = new</code>
|
322
|
+
</li>
|
323
|
+
|
324
|
+
<li class="covered" data-hits="1" data-linenumber="23">
|
325
|
+
<span class="hits">1</span>
|
326
|
+
|
327
|
+
<code class="ruby"> client.verification_url = ITUNES_PRODUCTION_RECEIPT_VERIFICATION_ENDPOINT</code>
|
328
|
+
</li>
|
329
|
+
|
330
|
+
<li class="covered" data-hits="1" data-linenumber="24">
|
331
|
+
<span class="hits">1</span>
|
332
|
+
|
333
|
+
<code class="ruby"> client</code>
|
334
|
+
</li>
|
335
|
+
|
336
|
+
<li class="never" data-hits="" data-linenumber="25">
|
337
|
+
|
338
|
+
|
339
|
+
<code class="ruby"> end</code>
|
340
|
+
</li>
|
341
|
+
|
342
|
+
<li class="never" data-hits="" data-linenumber="26">
|
343
|
+
|
344
|
+
|
345
|
+
<code class="ruby"> end</code>
|
346
|
+
</li>
|
347
|
+
|
348
|
+
<li class="never" data-hits="" data-linenumber="27">
|
349
|
+
|
350
|
+
|
351
|
+
<code class="ruby"></code>
|
352
|
+
</li>
|
353
|
+
|
354
|
+
<li class="covered" data-hits="1" data-linenumber="28">
|
355
|
+
<span class="hits">1</span>
|
356
|
+
|
357
|
+
<code class="ruby"> def initialize</code>
|
358
|
+
</li>
|
359
|
+
|
360
|
+
<li class="covered" data-hits="9" data-linenumber="29">
|
361
|
+
<span class="hits">9</span>
|
362
|
+
|
363
|
+
<code class="ruby"> @verification_url = ENV['IAP_VERIFICATION_ENDPOINT']</code>
|
364
|
+
</li>
|
365
|
+
|
366
|
+
<li class="never" data-hits="" data-linenumber="30">
|
367
|
+
|
368
|
+
|
369
|
+
<code class="ruby"> end</code>
|
370
|
+
</li>
|
371
|
+
|
372
|
+
<li class="never" data-hits="" data-linenumber="31">
|
373
|
+
|
374
|
+
|
375
|
+
<code class="ruby"></code>
|
376
|
+
</li>
|
377
|
+
|
378
|
+
<li class="covered" data-hits="1" data-linenumber="32">
|
379
|
+
<span class="hits">1</span>
|
380
|
+
|
381
|
+
<code class="ruby"> def verify!(data, options = {})</code>
|
382
|
+
</li>
|
383
|
+
|
384
|
+
<li class="covered" data-hits="9" data-linenumber="33">
|
385
|
+
<span class="hits">9</span>
|
386
|
+
|
387
|
+
<code class="ruby"> @verification_url ||= ITUNES_DEVELOPMENT_RECEIPT_VERIFICATION_ENDPOINT</code>
|
388
|
+
</li>
|
389
|
+
|
390
|
+
<li class="covered" data-hits="9" data-linenumber="34">
|
391
|
+
<span class="hits">9</span>
|
392
|
+
|
393
|
+
<code class="ruby"> @shared_secret = options[:shared_secret] if options[:shared_secret]</code>
|
394
|
+
</li>
|
395
|
+
|
396
|
+
<li class="covered" data-hits="9" data-linenumber="35">
|
397
|
+
<span class="hits">9</span>
|
398
|
+
|
399
|
+
<code class="ruby"> @exclude_old_transactions = options[:exclude_old_transactions] if options[:exclude_old_transactions]</code>
|
400
|
+
</li>
|
401
|
+
|
402
|
+
<li class="never" data-hits="" data-linenumber="36">
|
403
|
+
|
404
|
+
|
405
|
+
<code class="ruby"></code>
|
406
|
+
</li>
|
407
|
+
|
408
|
+
<li class="covered" data-hits="9" data-linenumber="37">
|
409
|
+
<span class="hits">9</span>
|
410
|
+
|
411
|
+
<code class="ruby"> json = json_response_from_verifying_data(data, options)</code>
|
412
|
+
</li>
|
413
|
+
|
414
|
+
<li class="covered" data-hits="9" data-linenumber="38">
|
415
|
+
<span class="hits">9</span>
|
416
|
+
|
417
|
+
<code class="ruby"> receipt_attributes = json['receipt'].dup if json['receipt']</code>
|
418
|
+
</li>
|
419
|
+
|
420
|
+
<li class="covered" data-hits="9" data-linenumber="39">
|
421
|
+
<span class="hits">9</span>
|
422
|
+
|
423
|
+
<code class="ruby"> receipt_attributes['original_json_response'] = json if receipt_attributes</code>
|
424
|
+
</li>
|
425
|
+
|
426
|
+
<li class="never" data-hits="" data-linenumber="40">
|
427
|
+
|
428
|
+
|
429
|
+
<code class="ruby"></code>
|
430
|
+
</li>
|
431
|
+
|
432
|
+
<li class="covered" data-hits="9" data-linenumber="41">
|
433
|
+
<span class="hits">9</span>
|
434
|
+
|
435
|
+
<code class="ruby"> case json['status'].to_i</code>
|
436
|
+
</li>
|
437
|
+
|
438
|
+
<li class="never" data-hits="" data-linenumber="42">
|
439
|
+
|
440
|
+
|
441
|
+
<code class="ruby"> when 0, 21006</code>
|
442
|
+
</li>
|
443
|
+
|
444
|
+
<li class="covered" data-hits="7" data-linenumber="43">
|
445
|
+
<span class="hits">7</span>
|
446
|
+
|
447
|
+
<code class="ruby"> receipt = Receipt.new(receipt_attributes)</code>
|
448
|
+
</li>
|
449
|
+
|
450
|
+
<li class="never" data-hits="" data-linenumber="44">
|
451
|
+
|
452
|
+
|
453
|
+
<code class="ruby"></code>
|
454
|
+
</li>
|
455
|
+
|
456
|
+
<li class="never" data-hits="" data-linenumber="45">
|
457
|
+
|
458
|
+
|
459
|
+
<code class="ruby"> # From Apple docs:</code>
|
460
|
+
</li>
|
461
|
+
|
462
|
+
<li class="never" data-hits="" data-linenumber="46">
|
463
|
+
|
464
|
+
|
465
|
+
<code class="ruby"> # > Only returned for iOS 6 style transaction receipts for auto-renewable subscriptions.</code>
|
466
|
+
</li>
|
467
|
+
|
468
|
+
<li class="never" data-hits="" data-linenumber="47">
|
469
|
+
|
470
|
+
|
471
|
+
<code class="ruby"> # > The JSON representation of the receipt for the most recent renewal</code>
|
472
|
+
</li>
|
473
|
+
|
474
|
+
<li class="covered" data-hits="7" data-linenumber="48">
|
475
|
+
<span class="hits">7</span>
|
476
|
+
|
477
|
+
<code class="ruby"> if latest_receipt_info_attributes = json['latest_receipt_info']</code>
|
478
|
+
</li>
|
479
|
+
|
480
|
+
<li class="covered" data-hits="2" data-linenumber="49">
|
481
|
+
<span class="hits">2</span>
|
482
|
+
|
483
|
+
<code class="ruby"> latest_receipt_info_attributes = [latest_receipt_info_attributes] if latest_receipt_info_attributes.is_a?(Hash)</code>
|
484
|
+
</li>
|
485
|
+
|
486
|
+
<li class="never" data-hits="" data-linenumber="50">
|
487
|
+
|
488
|
+
|
489
|
+
<code class="ruby"></code>
|
490
|
+
</li>
|
491
|
+
|
492
|
+
<li class="never" data-hits="" data-linenumber="51">
|
493
|
+
|
494
|
+
|
495
|
+
<code class="ruby"> # AppStore returns 'latest_receipt_info' even if we use over iOS 6. Besides, its format is an Array.</code>
|
496
|
+
</li>
|
497
|
+
|
498
|
+
<li class="covered" data-hits="2" data-linenumber="52">
|
499
|
+
<span class="hits">2</span>
|
500
|
+
|
501
|
+
<code class="ruby"> if latest_receipt_info_attributes.is_a?(Array)</code>
|
502
|
+
</li>
|
503
|
+
|
504
|
+
<li class="covered" data-hits="2" data-linenumber="53">
|
505
|
+
<span class="hits">2</span>
|
506
|
+
|
507
|
+
<code class="ruby"> receipt.latest_receipt_info = []</code>
|
508
|
+
</li>
|
509
|
+
|
510
|
+
<li class="covered" data-hits="2" data-linenumber="54">
|
511
|
+
<span class="hits">2</span>
|
512
|
+
|
513
|
+
<code class="ruby"> latest_receipt_info_attributes.each do |latest_receipt_info_attribute|</code>
|
514
|
+
</li>
|
515
|
+
|
516
|
+
<li class="never" data-hits="" data-linenumber="55">
|
517
|
+
|
518
|
+
|
519
|
+
<code class="ruby"> # latest_receipt_info format is identical with in_app</code>
|
520
|
+
</li>
|
521
|
+
|
522
|
+
<li class="covered" data-hits="2" data-linenumber="56">
|
523
|
+
<span class="hits">2</span>
|
524
|
+
|
525
|
+
<code class="ruby"> receipt.latest_receipt_info << InAppReceipt.new(latest_receipt_info_attribute)</code>
|
526
|
+
</li>
|
527
|
+
|
528
|
+
<li class="never" data-hits="" data-linenumber="57">
|
529
|
+
|
530
|
+
|
531
|
+
<code class="ruby"> end</code>
|
532
|
+
</li>
|
533
|
+
|
534
|
+
<li class="never" data-hits="" data-linenumber="58">
|
535
|
+
|
536
|
+
|
537
|
+
<code class="ruby"> else</code>
|
538
|
+
</li>
|
539
|
+
|
540
|
+
<li class="missed" data-hits="0" data-linenumber="59">
|
541
|
+
|
542
|
+
|
543
|
+
<code class="ruby"> receipt.latest_receipt_info = latest_receipt_info_attributes</code>
|
544
|
+
</li>
|
545
|
+
|
546
|
+
<li class="never" data-hits="" data-linenumber="60">
|
547
|
+
|
548
|
+
|
549
|
+
<code class="ruby"> end</code>
|
550
|
+
</li>
|
551
|
+
|
552
|
+
<li class="never" data-hits="" data-linenumber="61">
|
553
|
+
|
554
|
+
|
555
|
+
<code class="ruby"> end</code>
|
556
|
+
</li>
|
557
|
+
|
558
|
+
<li class="never" data-hits="" data-linenumber="62">
|
559
|
+
|
560
|
+
|
561
|
+
<code class="ruby"></code>
|
562
|
+
</li>
|
563
|
+
|
564
|
+
<li class="covered" data-hits="7" data-linenumber="63">
|
565
|
+
<span class="hits">7</span>
|
566
|
+
|
567
|
+
<code class="ruby"> return receipt</code>
|
568
|
+
</li>
|
569
|
+
|
570
|
+
<li class="never" data-hits="" data-linenumber="64">
|
571
|
+
|
572
|
+
|
573
|
+
<code class="ruby"> else</code>
|
574
|
+
</li>
|
575
|
+
|
576
|
+
<li class="covered" data-hits="2" data-linenumber="65">
|
577
|
+
<span class="hits">2</span>
|
578
|
+
|
579
|
+
<code class="ruby"> raise Receipt::VerificationError, json</code>
|
580
|
+
</li>
|
581
|
+
|
582
|
+
<li class="never" data-hits="" data-linenumber="66">
|
583
|
+
|
584
|
+
|
585
|
+
<code class="ruby"> end</code>
|
586
|
+
</li>
|
587
|
+
|
588
|
+
<li class="never" data-hits="" data-linenumber="67">
|
589
|
+
|
590
|
+
|
591
|
+
<code class="ruby"> end</code>
|
592
|
+
</li>
|
593
|
+
|
594
|
+
<li class="never" data-hits="" data-linenumber="68">
|
595
|
+
|
596
|
+
|
597
|
+
<code class="ruby"></code>
|
598
|
+
</li>
|
599
|
+
|
600
|
+
<li class="covered" data-hits="1" data-linenumber="69">
|
601
|
+
<span class="hits">1</span>
|
602
|
+
|
603
|
+
<code class="ruby"> private</code>
|
604
|
+
</li>
|
605
|
+
|
606
|
+
<li class="never" data-hits="" data-linenumber="70">
|
607
|
+
|
608
|
+
|
609
|
+
<code class="ruby"></code>
|
610
|
+
</li>
|
611
|
+
|
612
|
+
<li class="covered" data-hits="1" data-linenumber="71">
|
613
|
+
<span class="hits">1</span>
|
614
|
+
|
615
|
+
<code class="ruby"> def json_response_from_verifying_data(data, options = {})</code>
|
616
|
+
</li>
|
617
|
+
|
618
|
+
<li class="covered" data-hits="3" data-linenumber="72">
|
619
|
+
<span class="hits">3</span>
|
620
|
+
|
621
|
+
<code class="ruby"> parameters = {</code>
|
622
|
+
</li>
|
623
|
+
|
624
|
+
<li class="never" data-hits="" data-linenumber="73">
|
625
|
+
|
626
|
+
|
627
|
+
<code class="ruby"> 'receipt-data' => data</code>
|
628
|
+
</li>
|
629
|
+
|
630
|
+
<li class="never" data-hits="" data-linenumber="74">
|
631
|
+
|
632
|
+
|
633
|
+
<code class="ruby"> }</code>
|
634
|
+
</li>
|
635
|
+
|
636
|
+
<li class="never" data-hits="" data-linenumber="75">
|
637
|
+
|
638
|
+
|
639
|
+
<code class="ruby"></code>
|
640
|
+
</li>
|
641
|
+
|
642
|
+
<li class="covered" data-hits="3" data-linenumber="76">
|
643
|
+
<span class="hits">3</span>
|
644
|
+
|
645
|
+
<code class="ruby"> parameters['password'] = @shared_secret if @shared_secret</code>
|
646
|
+
</li>
|
647
|
+
|
648
|
+
<li class="covered" data-hits="3" data-linenumber="77">
|
649
|
+
<span class="hits">3</span>
|
650
|
+
|
651
|
+
<code class="ruby"> parameters['exclude-old-transactions'] = @exclude_old_transactions if @exclude_old_transactions</code>
|
652
|
+
</li>
|
653
|
+
|
654
|
+
<li class="never" data-hits="" data-linenumber="78">
|
655
|
+
|
656
|
+
|
657
|
+
<code class="ruby"></code>
|
658
|
+
</li>
|
659
|
+
|
660
|
+
<li class="covered" data-hits="3" data-linenumber="79">
|
661
|
+
<span class="hits">3</span>
|
662
|
+
|
663
|
+
<code class="ruby"> uri = URI(@verification_url)</code>
|
664
|
+
</li>
|
665
|
+
|
666
|
+
<li class="covered" data-hits="3" data-linenumber="80">
|
667
|
+
<span class="hits">3</span>
|
668
|
+
|
669
|
+
<code class="ruby"> http = Net::HTTP.new(uri.host, uri.port)</code>
|
670
|
+
</li>
|
671
|
+
|
672
|
+
<li class="covered" data-hits="3" data-linenumber="81">
|
673
|
+
<span class="hits">3</span>
|
674
|
+
|
675
|
+
<code class="ruby"> http.use_ssl = true</code>
|
676
|
+
</li>
|
677
|
+
|
678
|
+
<li class="covered" data-hits="3" data-linenumber="82">
|
679
|
+
<span class="hits">3</span>
|
680
|
+
|
681
|
+
<code class="ruby"> http.verify_mode = OpenSSL::SSL::VERIFY_PEER</code>
|
682
|
+
</li>
|
683
|
+
|
684
|
+
<li class="never" data-hits="" data-linenumber="83">
|
685
|
+
|
686
|
+
|
687
|
+
<code class="ruby"></code>
|
688
|
+
</li>
|
689
|
+
|
690
|
+
<li class="covered" data-hits="3" data-linenumber="84">
|
691
|
+
<span class="hits">3</span>
|
692
|
+
|
693
|
+
<code class="ruby"> http.open_timeout = options[:open_timeout] if options[:open_timeout]</code>
|
694
|
+
</li>
|
695
|
+
|
696
|
+
<li class="covered" data-hits="3" data-linenumber="85">
|
697
|
+
<span class="hits">3</span>
|
698
|
+
|
699
|
+
<code class="ruby"> http.read_timeout = options[:read_timeout] if options[:read_timeout]</code>
|
700
|
+
</li>
|
701
|
+
|
702
|
+
<li class="never" data-hits="" data-linenumber="86">
|
703
|
+
|
704
|
+
|
705
|
+
<code class="ruby"></code>
|
706
|
+
</li>
|
707
|
+
|
708
|
+
<li class="covered" data-hits="3" data-linenumber="87">
|
709
|
+
<span class="hits">3</span>
|
710
|
+
|
711
|
+
<code class="ruby"> request = Net::HTTP::Post.new(uri.request_uri)</code>
|
712
|
+
</li>
|
713
|
+
|
714
|
+
<li class="covered" data-hits="3" data-linenumber="88">
|
715
|
+
<span class="hits">3</span>
|
716
|
+
|
717
|
+
<code class="ruby"> request['Accept'] = 'application/json'</code>
|
718
|
+
</li>
|
719
|
+
|
720
|
+
<li class="covered" data-hits="3" data-linenumber="89">
|
721
|
+
<span class="hits">3</span>
|
722
|
+
|
723
|
+
<code class="ruby"> request['Content-Type'] = 'application/json'</code>
|
724
|
+
</li>
|
725
|
+
|
726
|
+
<li class="covered" data-hits="3" data-linenumber="90">
|
727
|
+
<span class="hits">3</span>
|
728
|
+
|
729
|
+
<code class="ruby"> request.body = parameters.to_json</code>
|
730
|
+
</li>
|
731
|
+
|
732
|
+
<li class="never" data-hits="" data-linenumber="91">
|
733
|
+
|
734
|
+
|
735
|
+
<code class="ruby"></code>
|
736
|
+
</li>
|
737
|
+
|
738
|
+
<li class="covered" data-hits="3" data-linenumber="92">
|
739
|
+
<span class="hits">3</span>
|
740
|
+
|
741
|
+
<code class="ruby"> begin</code>
|
742
|
+
</li>
|
743
|
+
|
744
|
+
<li class="covered" data-hits="3" data-linenumber="93">
|
745
|
+
<span class="hits">3</span>
|
746
|
+
|
747
|
+
<code class="ruby"> response = http.request(request)</code>
|
748
|
+
</li>
|
749
|
+
|
750
|
+
<li class="never" data-hits="" data-linenumber="94">
|
751
|
+
|
752
|
+
|
753
|
+
<code class="ruby"> rescue Timeout::Error</code>
|
754
|
+
</li>
|
755
|
+
|
756
|
+
<li class="missed" data-hits="0" data-linenumber="95">
|
757
|
+
|
758
|
+
|
759
|
+
<code class="ruby"> raise TimeoutError</code>
|
760
|
+
</li>
|
761
|
+
|
762
|
+
<li class="never" data-hits="" data-linenumber="96">
|
763
|
+
|
764
|
+
|
765
|
+
<code class="ruby"> end</code>
|
766
|
+
</li>
|
767
|
+
|
768
|
+
<li class="never" data-hits="" data-linenumber="97">
|
769
|
+
|
770
|
+
|
771
|
+
<code class="ruby"></code>
|
772
|
+
</li>
|
773
|
+
|
774
|
+
<li class="covered" data-hits="3" data-linenumber="98">
|
775
|
+
<span class="hits">3</span>
|
776
|
+
|
777
|
+
<code class="ruby"> JSON.parse(response.body)</code>
|
778
|
+
</li>
|
779
|
+
|
780
|
+
<li class="never" data-hits="" data-linenumber="99">
|
781
|
+
|
782
|
+
|
783
|
+
<code class="ruby"> end</code>
|
784
|
+
</li>
|
785
|
+
|
786
|
+
<li class="never" data-hits="" data-linenumber="100">
|
787
|
+
|
788
|
+
|
789
|
+
<code class="ruby"> end</code>
|
790
|
+
</li>
|
791
|
+
|
792
|
+
<li class="never" data-hits="" data-linenumber="101">
|
793
|
+
|
794
|
+
|
795
|
+
<code class="ruby"></code>
|
796
|
+
</li>
|
797
|
+
|
798
|
+
<li class="covered" data-hits="1" data-linenumber="102">
|
799
|
+
<span class="hits">1</span>
|
800
|
+
|
801
|
+
<code class="ruby"> class Client::TimeoutError < Timeout::Error</code>
|
802
|
+
</li>
|
803
|
+
|
804
|
+
<li class="covered" data-hits="1" data-linenumber="103">
|
805
|
+
<span class="hits">1</span>
|
806
|
+
|
807
|
+
<code class="ruby"> def message</code>
|
808
|
+
</li>
|
809
|
+
|
810
|
+
<li class="missed" data-hits="0" data-linenumber="104">
|
811
|
+
|
812
|
+
|
813
|
+
<code class="ruby"> 'The App Store timed out.'</code>
|
814
|
+
</li>
|
815
|
+
|
816
|
+
<li class="never" data-hits="" data-linenumber="105">
|
817
|
+
|
818
|
+
|
819
|
+
<code class="ruby"> end</code>
|
820
|
+
</li>
|
821
|
+
|
822
|
+
<li class="never" data-hits="" data-linenumber="106">
|
823
|
+
|
824
|
+
|
825
|
+
<code class="ruby"> end</code>
|
826
|
+
</li>
|
827
|
+
|
828
|
+
<li class="never" data-hits="" data-linenumber="107">
|
829
|
+
|
830
|
+
|
831
|
+
<code class="ruby">end</code>
|
832
|
+
</li>
|
833
|
+
|
834
|
+
</ol>
|
835
|
+
</pre>
|
836
|
+
</div>
|
837
|
+
|
838
|
+
|
839
|
+
<div class="source_table" id="00078d08685c036723fa2dda323c4912a6d636fc">
|
840
|
+
<div class="header">
|
841
|
+
<h3>lib/venice/in_app_receipt.rb</h3>
|
842
|
+
<h4><span class="green">97.67 %</span> covered</h4>
|
843
|
+
<div>
|
844
|
+
<b>43</b> relevant lines.
|
845
|
+
<span class="green"><b>42</b> lines covered</span> and
|
846
|
+
<span class="red"><b>1</b> lines missed.</span>
|
847
|
+
</div>
|
848
|
+
</div>
|
849
|
+
|
850
|
+
<pre>
|
851
|
+
<ol>
|
852
|
+
|
853
|
+
<li class="covered" data-hits="1" data-linenumber="1">
|
854
|
+
<span class="hits">1</span>
|
855
|
+
|
856
|
+
<code class="ruby">require 'time'</code>
|
857
|
+
</li>
|
858
|
+
|
859
|
+
<li class="never" data-hits="" data-linenumber="2">
|
860
|
+
|
861
|
+
|
862
|
+
<code class="ruby"></code>
|
863
|
+
</li>
|
864
|
+
|
865
|
+
<li class="covered" data-hits="1" data-linenumber="3">
|
866
|
+
<span class="hits">1</span>
|
867
|
+
|
868
|
+
<code class="ruby">module Venice</code>
|
869
|
+
</li>
|
870
|
+
|
871
|
+
<li class="covered" data-hits="1" data-linenumber="4">
|
872
|
+
<span class="hits">1</span>
|
873
|
+
|
874
|
+
<code class="ruby"> class InAppReceipt</code>
|
875
|
+
</li>
|
876
|
+
|
877
|
+
<li class="never" data-hits="" data-linenumber="5">
|
878
|
+
|
879
|
+
|
880
|
+
<code class="ruby"> # For detailed explanations on these keys/values, see</code>
|
881
|
+
</li>
|
882
|
+
|
883
|
+
<li class="never" data-hits="" data-linenumber="6">
|
884
|
+
|
885
|
+
|
886
|
+
<code class="ruby"> # https://developer.apple.com/library/ios/releasenotes/General/ValidateAppStoreReceipt/Chapters/ReceiptFields.html#//apple_ref/doc/uid/TP40010573-CH106-SW12</code>
|
887
|
+
</li>
|
888
|
+
|
889
|
+
<li class="never" data-hits="" data-linenumber="7">
|
890
|
+
|
891
|
+
|
892
|
+
<code class="ruby"></code>
|
893
|
+
</li>
|
894
|
+
|
895
|
+
<li class="never" data-hits="" data-linenumber="8">
|
896
|
+
|
897
|
+
|
898
|
+
<code class="ruby"> # The number of items purchased. This value corresponds to the quantity property of</code>
|
899
|
+
</li>
|
900
|
+
|
901
|
+
<li class="never" data-hits="" data-linenumber="9">
|
902
|
+
|
903
|
+
|
904
|
+
<code class="ruby"> # the SKPayment object stored in the transaction’s payment property.</code>
|
905
|
+
</li>
|
906
|
+
|
907
|
+
<li class="covered" data-hits="1" data-linenumber="10">
|
908
|
+
<span class="hits">1</span>
|
909
|
+
|
910
|
+
<code class="ruby"> attr_reader :quantity</code>
|
911
|
+
</li>
|
912
|
+
|
913
|
+
<li class="never" data-hits="" data-linenumber="11">
|
914
|
+
|
915
|
+
|
916
|
+
<code class="ruby"></code>
|
917
|
+
</li>
|
918
|
+
|
919
|
+
<li class="never" data-hits="" data-linenumber="12">
|
920
|
+
|
921
|
+
|
922
|
+
<code class="ruby"> # The product identifier of the item that was purchased. This value corresponds to</code>
|
923
|
+
</li>
|
924
|
+
|
925
|
+
<li class="never" data-hits="" data-linenumber="13">
|
926
|
+
|
927
|
+
|
928
|
+
<code class="ruby"> # the productIdentifier property of the SKPayment object stored in the transaction’s</code>
|
929
|
+
</li>
|
930
|
+
|
931
|
+
<li class="never" data-hits="" data-linenumber="14">
|
932
|
+
|
933
|
+
|
934
|
+
<code class="ruby"> # payment property.</code>
|
935
|
+
</li>
|
936
|
+
|
937
|
+
<li class="covered" data-hits="1" data-linenumber="15">
|
938
|
+
<span class="hits">1</span>
|
939
|
+
|
940
|
+
<code class="ruby"> attr_reader :product_id</code>
|
941
|
+
</li>
|
942
|
+
|
943
|
+
<li class="never" data-hits="" data-linenumber="16">
|
944
|
+
|
945
|
+
|
946
|
+
<code class="ruby"></code>
|
947
|
+
</li>
|
948
|
+
|
949
|
+
<li class="never" data-hits="" data-linenumber="17">
|
950
|
+
|
951
|
+
|
952
|
+
<code class="ruby"> # The transaction identifier of the item that was purchased. This value corresponds</code>
|
953
|
+
</li>
|
954
|
+
|
955
|
+
<li class="never" data-hits="" data-linenumber="18">
|
956
|
+
|
957
|
+
|
958
|
+
<code class="ruby"> # to the transaction’s transactionIdentifier property.</code>
|
959
|
+
</li>
|
960
|
+
|
961
|
+
<li class="covered" data-hits="1" data-linenumber="19">
|
962
|
+
<span class="hits">1</span>
|
963
|
+
|
964
|
+
<code class="ruby"> attr_reader :transaction_id</code>
|
965
|
+
</li>
|
966
|
+
|
967
|
+
<li class="never" data-hits="" data-linenumber="20">
|
968
|
+
|
969
|
+
|
970
|
+
<code class="ruby"></code>
|
971
|
+
</li>
|
972
|
+
|
973
|
+
<li class="never" data-hits="" data-linenumber="21">
|
974
|
+
|
975
|
+
|
976
|
+
<code class="ruby"> # The primary key for identifying subscription purchases. This value is a unique ID that identifies purchase events across devices, including subscription renewal purchase events.</code>
|
977
|
+
</li>
|
978
|
+
|
979
|
+
<li class="never" data-hits="" data-linenumber="22">
|
980
|
+
|
981
|
+
|
982
|
+
<code class="ruby"> # When restoring purchase, transaction_id could change</code>
|
983
|
+
</li>
|
984
|
+
|
985
|
+
<li class="covered" data-hits="1" data-linenumber="23">
|
986
|
+
<span class="hits">1</span>
|
987
|
+
|
988
|
+
<code class="ruby"> attr_reader :web_order_line_item_id</code>
|
989
|
+
</li>
|
990
|
+
|
991
|
+
<li class="never" data-hits="" data-linenumber="24">
|
992
|
+
|
993
|
+
|
994
|
+
<code class="ruby"></code>
|
995
|
+
</li>
|
996
|
+
|
997
|
+
<li class="never" data-hits="" data-linenumber="25">
|
998
|
+
|
999
|
+
|
1000
|
+
<code class="ruby"> # The date and time this transaction occurred. This value corresponds to the</code>
|
1001
|
+
</li>
|
1002
|
+
|
1003
|
+
<li class="never" data-hits="" data-linenumber="26">
|
1004
|
+
|
1005
|
+
|
1006
|
+
<code class="ruby"> # transaction’s transactionDate property.</code>
|
1007
|
+
</li>
|
1008
|
+
|
1009
|
+
<li class="covered" data-hits="1" data-linenumber="27">
|
1010
|
+
<span class="hits">1</span>
|
1011
|
+
|
1012
|
+
<code class="ruby"> attr_reader :purchased_at</code>
|
1013
|
+
</li>
|
1014
|
+
|
1015
|
+
<li class="never" data-hits="" data-linenumber="28">
|
1016
|
+
|
1017
|
+
|
1018
|
+
<code class="ruby"></code>
|
1019
|
+
</li>
|
1020
|
+
|
1021
|
+
<li class="never" data-hits="" data-linenumber="29">
|
1022
|
+
|
1023
|
+
|
1024
|
+
<code class="ruby"> # A string that the App Store uses to uniquely identify the application that created</code>
|
1025
|
+
</li>
|
1026
|
+
|
1027
|
+
<li class="never" data-hits="" data-linenumber="30">
|
1028
|
+
|
1029
|
+
|
1030
|
+
<code class="ruby"> # the payment transaction. If your server supports multiple applications, you can use</code>
|
1031
|
+
</li>
|
1032
|
+
|
1033
|
+
<li class="never" data-hits="" data-linenumber="31">
|
1034
|
+
|
1035
|
+
|
1036
|
+
<code class="ruby"> # this value to differentiate between them. Applications that are executing in the</code>
|
1037
|
+
</li>
|
1038
|
+
|
1039
|
+
<li class="never" data-hits="" data-linenumber="32">
|
1040
|
+
|
1041
|
+
|
1042
|
+
<code class="ruby"> # sandbox do not yet have an app-item-id assigned to them, so this key is missing from</code>
|
1043
|
+
</li>
|
1044
|
+
|
1045
|
+
<li class="never" data-hits="" data-linenumber="33">
|
1046
|
+
|
1047
|
+
|
1048
|
+
<code class="ruby"> # receipts created by the sandbox.</code>
|
1049
|
+
</li>
|
1050
|
+
|
1051
|
+
<li class="covered" data-hits="1" data-linenumber="34">
|
1052
|
+
<span class="hits">1</span>
|
1053
|
+
|
1054
|
+
<code class="ruby"> attr_reader :app_item_id</code>
|
1055
|
+
</li>
|
1056
|
+
|
1057
|
+
<li class="never" data-hits="" data-linenumber="35">
|
1058
|
+
|
1059
|
+
|
1060
|
+
<code class="ruby"></code>
|
1061
|
+
</li>
|
1062
|
+
|
1063
|
+
<li class="never" data-hits="" data-linenumber="36">
|
1064
|
+
|
1065
|
+
|
1066
|
+
<code class="ruby"> # An arbitrary number that uniquely identifies a revision of your application. This key</code>
|
1067
|
+
</li>
|
1068
|
+
|
1069
|
+
<li class="never" data-hits="" data-linenumber="37">
|
1070
|
+
|
1071
|
+
|
1072
|
+
<code class="ruby"> # is missing in receipts created by the sandbox.</code>
|
1073
|
+
</li>
|
1074
|
+
|
1075
|
+
<li class="covered" data-hits="1" data-linenumber="38">
|
1076
|
+
<span class="hits">1</span>
|
1077
|
+
|
1078
|
+
<code class="ruby"> attr_reader :version_external_identifier</code>
|
1079
|
+
</li>
|
1080
|
+
|
1081
|
+
<li class="never" data-hits="" data-linenumber="39">
|
1082
|
+
|
1083
|
+
|
1084
|
+
<code class="ruby"></code>
|
1085
|
+
</li>
|
1086
|
+
|
1087
|
+
<li class="never" data-hits="" data-linenumber="40">
|
1088
|
+
|
1089
|
+
|
1090
|
+
<code class="ruby"> # For a transaction that restores a previous transaction, this is the original receipt</code>
|
1091
|
+
</li>
|
1092
|
+
|
1093
|
+
<li class="covered" data-hits="1" data-linenumber="41">
|
1094
|
+
<span class="hits">1</span>
|
1095
|
+
|
1096
|
+
<code class="ruby"> attr_accessor :original</code>
|
1097
|
+
</li>
|
1098
|
+
|
1099
|
+
<li class="never" data-hits="" data-linenumber="42">
|
1100
|
+
|
1101
|
+
|
1102
|
+
<code class="ruby"></code>
|
1103
|
+
</li>
|
1104
|
+
|
1105
|
+
<li class="never" data-hits="" data-linenumber="43">
|
1106
|
+
|
1107
|
+
|
1108
|
+
<code class="ruby"> # For auto-renewable subscriptions, returns the date the subscription will expire</code>
|
1109
|
+
</li>
|
1110
|
+
|
1111
|
+
<li class="covered" data-hits="1" data-linenumber="44">
|
1112
|
+
<span class="hits">1</span>
|
1113
|
+
|
1114
|
+
<code class="ruby"> attr_reader :expires_at</code>
|
1115
|
+
</li>
|
1116
|
+
|
1117
|
+
<li class="never" data-hits="" data-linenumber="45">
|
1118
|
+
|
1119
|
+
|
1120
|
+
<code class="ruby"></code>
|
1121
|
+
</li>
|
1122
|
+
|
1123
|
+
<li class="never" data-hits="" data-linenumber="46">
|
1124
|
+
|
1125
|
+
|
1126
|
+
<code class="ruby"> # For a transaction that was canceled by Apple customer support, the time and date of the cancellation.</code>
|
1127
|
+
</li>
|
1128
|
+
|
1129
|
+
<li class="covered" data-hits="1" data-linenumber="47">
|
1130
|
+
<span class="hits">1</span>
|
1131
|
+
|
1132
|
+
<code class="ruby"> attr_reader :cancellation_at</code>
|
1133
|
+
</li>
|
1134
|
+
|
1135
|
+
<li class="never" data-hits="" data-linenumber="48">
|
1136
|
+
|
1137
|
+
|
1138
|
+
<code class="ruby"></code>
|
1139
|
+
</li>
|
1140
|
+
|
1141
|
+
<li class="covered" data-hits="1" data-linenumber="49">
|
1142
|
+
<span class="hits">1</span>
|
1143
|
+
|
1144
|
+
<code class="ruby"> def initialize(attributes = {})</code>
|
1145
|
+
</li>
|
1146
|
+
|
1147
|
+
<li class="covered" data-hits="30" data-linenumber="50">
|
1148
|
+
<span class="hits">30</span>
|
1149
|
+
|
1150
|
+
<code class="ruby"> @quantity = Integer(attributes['quantity']) if attributes['quantity']</code>
|
1151
|
+
</li>
|
1152
|
+
|
1153
|
+
<li class="covered" data-hits="30" data-linenumber="51">
|
1154
|
+
<span class="hits">30</span>
|
1155
|
+
|
1156
|
+
<code class="ruby"> @product_id = attributes['product_id']</code>
|
1157
|
+
</li>
|
1158
|
+
|
1159
|
+
<li class="covered" data-hits="30" data-linenumber="52">
|
1160
|
+
<span class="hits">30</span>
|
1161
|
+
|
1162
|
+
<code class="ruby"> @transaction_id = attributes['transaction_id']</code>
|
1163
|
+
</li>
|
1164
|
+
|
1165
|
+
<li class="covered" data-hits="30" data-linenumber="53">
|
1166
|
+
<span class="hits">30</span>
|
1167
|
+
|
1168
|
+
<code class="ruby"> @web_order_line_item_id = attributes['web_order_line_item_id']</code>
|
1169
|
+
</li>
|
1170
|
+
|
1171
|
+
<li class="covered" data-hits="30" data-linenumber="54">
|
1172
|
+
<span class="hits">30</span>
|
1173
|
+
|
1174
|
+
<code class="ruby"> @purchased_at = DateTime.parse(attributes['purchase_date']) if attributes['purchase_date']</code>
|
1175
|
+
</li>
|
1176
|
+
|
1177
|
+
<li class="covered" data-hits="30" data-linenumber="55">
|
1178
|
+
<span class="hits">30</span>
|
1179
|
+
|
1180
|
+
<code class="ruby"> @app_item_id = attributes['app_item_id']</code>
|
1181
|
+
</li>
|
1182
|
+
|
1183
|
+
<li class="covered" data-hits="30" data-linenumber="56">
|
1184
|
+
<span class="hits">30</span>
|
1185
|
+
|
1186
|
+
<code class="ruby"> @version_external_identifier = attributes['version_external_identifier']</code>
|
1187
|
+
</li>
|
1188
|
+
|
1189
|
+
<li class="covered" data-hits="30" data-linenumber="57">
|
1190
|
+
<span class="hits">30</span>
|
1191
|
+
|
1192
|
+
<code class="ruby"> @is_trial_period = attributes['is_trial_period'].to_s == 'true'</code>
|
1193
|
+
</li>
|
1194
|
+
|
1195
|
+
<li class="never" data-hits="" data-linenumber="58">
|
1196
|
+
|
1197
|
+
|
1198
|
+
<code class="ruby"></code>
|
1199
|
+
</li>
|
1200
|
+
|
1201
|
+
<li class="never" data-hits="" data-linenumber="59">
|
1202
|
+
|
1203
|
+
|
1204
|
+
<code class="ruby"> # expires_date is in ms since the Epoch, Time.at expects seconds</code>
|
1205
|
+
</li>
|
1206
|
+
|
1207
|
+
<li class="covered" data-hits="30" data-linenumber="60">
|
1208
|
+
<span class="hits">30</span>
|
1209
|
+
|
1210
|
+
<code class="ruby"> if attributes['expires_date_ms']</code>
|
1211
|
+
</li>
|
1212
|
+
|
1213
|
+
<li class="covered" data-hits="5" data-linenumber="61">
|
1214
|
+
<span class="hits">5</span>
|
1215
|
+
|
1216
|
+
<code class="ruby"> @expires_at = Time.at(attributes['expires_date_ms'].to_i / 1000)</code>
|
1217
|
+
</li>
|
1218
|
+
|
1219
|
+
<li class="covered" data-hits="25" data-linenumber="62">
|
1220
|
+
<span class="hits">25</span>
|
1221
|
+
|
1222
|
+
<code class="ruby"> elsif attributes['expires_date'] && is_number?(attributes['expires_date'])</code>
|
1223
|
+
</li>
|
1224
|
+
|
1225
|
+
<li class="covered" data-hits="3" data-linenumber="63">
|
1226
|
+
<span class="hits">3</span>
|
1227
|
+
|
1228
|
+
<code class="ruby"> @expires_at = Time.at(attributes['expires_date'].to_i / 1000)</code>
|
1229
|
+
</li>
|
1230
|
+
|
1231
|
+
<li class="never" data-hits="" data-linenumber="64">
|
1232
|
+
|
1233
|
+
|
1234
|
+
<code class="ruby"> end</code>
|
1235
|
+
</li>
|
1236
|
+
|
1237
|
+
<li class="never" data-hits="" data-linenumber="65">
|
1238
|
+
|
1239
|
+
|
1240
|
+
<code class="ruby"></code>
|
1241
|
+
</li>
|
1242
|
+
|
1243
|
+
<li class="never" data-hits="" data-linenumber="66">
|
1244
|
+
|
1245
|
+
|
1246
|
+
<code class="ruby"> # cancellation_date is in ms since the Epoch, Time.at expects seconds</code>
|
1247
|
+
</li>
|
1248
|
+
|
1249
|
+
<li class="covered" data-hits="30" data-linenumber="67">
|
1250
|
+
<span class="hits">30</span>
|
1251
|
+
|
1252
|
+
<code class="ruby"> @cancellation_at = Time.at(attributes['cancellation_date_ms'].to_i / 1000) if attributes['cancellation_date_ms']</code>
|
1253
|
+
</li>
|
1254
|
+
|
1255
|
+
<li class="never" data-hits="" data-linenumber="68">
|
1256
|
+
|
1257
|
+
|
1258
|
+
<code class="ruby"></code>
|
1259
|
+
</li>
|
1260
|
+
|
1261
|
+
<li class="covered" data-hits="30" data-linenumber="69">
|
1262
|
+
<span class="hits">30</span>
|
1263
|
+
|
1264
|
+
<code class="ruby"> if attributes['original_transaction_id'] || attributes['original_purchase_date']</code>
|
1265
|
+
</li>
|
1266
|
+
|
1267
|
+
<li class="covered" data-hits="15" data-linenumber="70">
|
1268
|
+
<span class="hits">15</span>
|
1269
|
+
|
1270
|
+
<code class="ruby"> original_attributes = {</code>
|
1271
|
+
</li>
|
1272
|
+
|
1273
|
+
<li class="never" data-hits="" data-linenumber="71">
|
1274
|
+
|
1275
|
+
|
1276
|
+
<code class="ruby"> 'transaction_id' => attributes['original_transaction_id'],</code>
|
1277
|
+
</li>
|
1278
|
+
|
1279
|
+
<li class="never" data-hits="" data-linenumber="72">
|
1280
|
+
|
1281
|
+
|
1282
|
+
<code class="ruby"> 'purchase_date' => attributes['original_purchase_date']</code>
|
1283
|
+
</li>
|
1284
|
+
|
1285
|
+
<li class="never" data-hits="" data-linenumber="73">
|
1286
|
+
|
1287
|
+
|
1288
|
+
<code class="ruby"> }</code>
|
1289
|
+
</li>
|
1290
|
+
|
1291
|
+
<li class="never" data-hits="" data-linenumber="74">
|
1292
|
+
|
1293
|
+
|
1294
|
+
<code class="ruby"></code>
|
1295
|
+
</li>
|
1296
|
+
|
1297
|
+
<li class="covered" data-hits="15" data-linenumber="75">
|
1298
|
+
<span class="hits">15</span>
|
1299
|
+
|
1300
|
+
<code class="ruby"> self.original = InAppReceipt.new(original_attributes)</code>
|
1301
|
+
</li>
|
1302
|
+
|
1303
|
+
<li class="never" data-hits="" data-linenumber="76">
|
1304
|
+
|
1305
|
+
|
1306
|
+
<code class="ruby"> end</code>
|
1307
|
+
</li>
|
1308
|
+
|
1309
|
+
<li class="never" data-hits="" data-linenumber="77">
|
1310
|
+
|
1311
|
+
|
1312
|
+
<code class="ruby"> end</code>
|
1313
|
+
</li>
|
1314
|
+
|
1315
|
+
<li class="never" data-hits="" data-linenumber="78">
|
1316
|
+
|
1317
|
+
|
1318
|
+
<code class="ruby"></code>
|
1319
|
+
</li>
|
1320
|
+
|
1321
|
+
<li class="covered" data-hits="1" data-linenumber="79">
|
1322
|
+
<span class="hits">1</span>
|
1323
|
+
|
1324
|
+
<code class="ruby"> def to_hash</code>
|
1325
|
+
</li>
|
1326
|
+
|
1327
|
+
<li class="covered" data-hits="2" data-linenumber="80">
|
1328
|
+
<span class="hits">2</span>
|
1329
|
+
|
1330
|
+
<code class="ruby"> {</code>
|
1331
|
+
</li>
|
1332
|
+
|
1333
|
+
<li class="never" data-hits="" data-linenumber="81">
|
1334
|
+
|
1335
|
+
|
1336
|
+
<code class="ruby"> quantity: @quantity,</code>
|
1337
|
+
</li>
|
1338
|
+
|
1339
|
+
<li class="never" data-hits="" data-linenumber="82">
|
1340
|
+
|
1341
|
+
|
1342
|
+
<code class="ruby"> product_id: @product_id,</code>
|
1343
|
+
</li>
|
1344
|
+
|
1345
|
+
<li class="never" data-hits="" data-linenumber="83">
|
1346
|
+
|
1347
|
+
|
1348
|
+
<code class="ruby"> transaction_id: @transaction_id,</code>
|
1349
|
+
</li>
|
1350
|
+
|
1351
|
+
<li class="never" data-hits="" data-linenumber="84">
|
1352
|
+
|
1353
|
+
|
1354
|
+
<code class="ruby"> web_order_line_item_id: @web_order_line_item_id,</code>
|
1355
|
+
</li>
|
1356
|
+
|
1357
|
+
<li class="covered" data-hits="2" data-linenumber="85">
|
1358
|
+
<span class="hits">2</span>
|
1359
|
+
|
1360
|
+
<code class="ruby"> purchase_date: (@purchased_at.httpdate rescue nil),</code>
|
1361
|
+
</li>
|
1362
|
+
|
1363
|
+
<li class="covered" data-hits="2" data-linenumber="86">
|
1364
|
+
<span class="hits">2</span>
|
1365
|
+
|
1366
|
+
<code class="ruby"> original_transaction_id: (@original.transaction_id rescue nil),</code>
|
1367
|
+
</li>
|
1368
|
+
|
1369
|
+
<li class="covered" data-hits="2" data-linenumber="87">
|
1370
|
+
<span class="hits">2</span>
|
1371
|
+
|
1372
|
+
<code class="ruby"> original_purchase_date: (@original.purchased_at.httpdate rescue nil),</code>
|
1373
|
+
</li>
|
1374
|
+
|
1375
|
+
<li class="never" data-hits="" data-linenumber="88">
|
1376
|
+
|
1377
|
+
|
1378
|
+
<code class="ruby"> app_item_id: @app_item_id,</code>
|
1379
|
+
</li>
|
1380
|
+
|
1381
|
+
<li class="never" data-hits="" data-linenumber="89">
|
1382
|
+
|
1383
|
+
|
1384
|
+
<code class="ruby"> version_external_identifier: @version_external_identifier,</code>
|
1385
|
+
</li>
|
1386
|
+
|
1387
|
+
<li class="never" data-hits="" data-linenumber="90">
|
1388
|
+
|
1389
|
+
|
1390
|
+
<code class="ruby"> is_trial_period: @is_trial_period,</code>
|
1391
|
+
</li>
|
1392
|
+
|
1393
|
+
<li class="covered" data-hits="2" data-linenumber="91">
|
1394
|
+
<span class="hits">2</span>
|
1395
|
+
|
1396
|
+
<code class="ruby"> expires_at: (@expires_at.httpdate rescue nil),</code>
|
1397
|
+
</li>
|
1398
|
+
|
1399
|
+
<li class="covered" data-hits="2" data-linenumber="92">
|
1400
|
+
<span class="hits">2</span>
|
1401
|
+
|
1402
|
+
<code class="ruby"> cancellation_at: (@cancellation_at.httpdate rescue nil)</code>
|
1403
|
+
</li>
|
1404
|
+
|
1405
|
+
<li class="never" data-hits="" data-linenumber="93">
|
1406
|
+
|
1407
|
+
|
1408
|
+
<code class="ruby"> }</code>
|
1409
|
+
</li>
|
1410
|
+
|
1411
|
+
<li class="never" data-hits="" data-linenumber="94">
|
1412
|
+
|
1413
|
+
|
1414
|
+
<code class="ruby"> end</code>
|
1415
|
+
</li>
|
1416
|
+
|
1417
|
+
<li class="covered" data-hits="1" data-linenumber="95">
|
1418
|
+
<span class="hits">1</span>
|
1419
|
+
|
1420
|
+
<code class="ruby"> alias_method :to_h, :to_hash</code>
|
1421
|
+
</li>
|
1422
|
+
|
1423
|
+
<li class="never" data-hits="" data-linenumber="96">
|
1424
|
+
|
1425
|
+
|
1426
|
+
<code class="ruby"></code>
|
1427
|
+
</li>
|
1428
|
+
|
1429
|
+
<li class="covered" data-hits="1" data-linenumber="97">
|
1430
|
+
<span class="hits">1</span>
|
1431
|
+
|
1432
|
+
<code class="ruby"> def to_json</code>
|
1433
|
+
</li>
|
1434
|
+
|
1435
|
+
<li class="missed" data-hits="0" data-linenumber="98">
|
1436
|
+
|
1437
|
+
|
1438
|
+
<code class="ruby"> to_hash.to_json</code>
|
1439
|
+
</li>
|
1440
|
+
|
1441
|
+
<li class="never" data-hits="" data-linenumber="99">
|
1442
|
+
|
1443
|
+
|
1444
|
+
<code class="ruby"> end</code>
|
1445
|
+
</li>
|
1446
|
+
|
1447
|
+
<li class="never" data-hits="" data-linenumber="100">
|
1448
|
+
|
1449
|
+
|
1450
|
+
<code class="ruby"></code>
|
1451
|
+
</li>
|
1452
|
+
|
1453
|
+
<li class="covered" data-hits="1" data-linenumber="101">
|
1454
|
+
<span class="hits">1</span>
|
1455
|
+
|
1456
|
+
<code class="ruby"> private</code>
|
1457
|
+
</li>
|
1458
|
+
|
1459
|
+
<li class="never" data-hits="" data-linenumber="102">
|
1460
|
+
|
1461
|
+
|
1462
|
+
<code class="ruby"></code>
|
1463
|
+
</li>
|
1464
|
+
|
1465
|
+
<li class="covered" data-hits="1" data-linenumber="103">
|
1466
|
+
<span class="hits">1</span>
|
1467
|
+
|
1468
|
+
<code class="ruby"> def is_number?(string)</code>
|
1469
|
+
</li>
|
1470
|
+
|
1471
|
+
<li class="covered" data-hits="10" data-linenumber="104">
|
1472
|
+
<span class="hits">10</span>
|
1473
|
+
|
1474
|
+
<code class="ruby"> !!(string && string.to_s =~ /^[0-9]+$/)</code>
|
1475
|
+
</li>
|
1476
|
+
|
1477
|
+
<li class="never" data-hits="" data-linenumber="105">
|
1478
|
+
|
1479
|
+
|
1480
|
+
<code class="ruby"> end</code>
|
1481
|
+
</li>
|
1482
|
+
|
1483
|
+
<li class="never" data-hits="" data-linenumber="106">
|
1484
|
+
|
1485
|
+
|
1486
|
+
<code class="ruby"> end</code>
|
1487
|
+
</li>
|
1488
|
+
|
1489
|
+
<li class="never" data-hits="" data-linenumber="107">
|
1490
|
+
|
1491
|
+
|
1492
|
+
<code class="ruby">end</code>
|
1493
|
+
</li>
|
1494
|
+
|
1495
|
+
</ol>
|
1496
|
+
</pre>
|
1497
|
+
</div>
|
1498
|
+
|
1499
|
+
|
1500
|
+
<div class="source_table" id="1597d9fcc7a2e1275029900749d07a8311092fee">
|
1501
|
+
<div class="header">
|
1502
|
+
<h3>lib/venice/pending_renewal_info.rb</h3>
|
1503
|
+
<h4><span class="green">95.65 %</span> covered</h4>
|
1504
|
+
<div>
|
1505
|
+
<b>23</b> relevant lines.
|
1506
|
+
<span class="green"><b>22</b> lines covered</span> and
|
1507
|
+
<span class="red"><b>1</b> lines missed.</span>
|
1508
|
+
</div>
|
1509
|
+
</div>
|
1510
|
+
|
1511
|
+
<pre>
|
1512
|
+
<ol>
|
1513
|
+
|
1514
|
+
<li class="covered" data-hits="1" data-linenumber="1">
|
1515
|
+
<span class="hits">1</span>
|
1516
|
+
|
1517
|
+
<code class="ruby">module Venice</code>
|
1518
|
+
</li>
|
1519
|
+
|
1520
|
+
<li class="covered" data-hits="1" data-linenumber="2">
|
1521
|
+
<span class="hits">1</span>
|
1522
|
+
|
1523
|
+
<code class="ruby"> class PendingRenewalInfo</code>
|
1524
|
+
</li>
|
1525
|
+
|
1526
|
+
<li class="never" data-hits="" data-linenumber="3">
|
1527
|
+
|
1528
|
+
|
1529
|
+
<code class="ruby"> # For an expired subscription, the reason for the subscription expiration.</code>
|
1530
|
+
</li>
|
1531
|
+
|
1532
|
+
<li class="never" data-hits="" data-linenumber="4">
|
1533
|
+
|
1534
|
+
|
1535
|
+
<code class="ruby"> # This key is only present for a receipt containing an expired auto-renewable subscription.</code>
|
1536
|
+
</li>
|
1537
|
+
|
1538
|
+
<li class="covered" data-hits="1" data-linenumber="5">
|
1539
|
+
<span class="hits">1</span>
|
1540
|
+
|
1541
|
+
<code class="ruby"> attr_reader :expiration_intent</code>
|
1542
|
+
</li>
|
1543
|
+
|
1544
|
+
<li class="never" data-hits="" data-linenumber="6">
|
1545
|
+
|
1546
|
+
|
1547
|
+
<code class="ruby"></code>
|
1548
|
+
</li>
|
1549
|
+
|
1550
|
+
<li class="never" data-hits="" data-linenumber="7">
|
1551
|
+
|
1552
|
+
|
1553
|
+
<code class="ruby"> # The current renewal status for the auto-renewable subscription.</code>
|
1554
|
+
</li>
|
1555
|
+
|
1556
|
+
<li class="never" data-hits="" data-linenumber="8">
|
1557
|
+
|
1558
|
+
|
1559
|
+
<code class="ruby"> # This key is only present for auto-renewable subscription receipts, for active or expired subscriptions</code>
|
1560
|
+
</li>
|
1561
|
+
|
1562
|
+
<li class="covered" data-hits="1" data-linenumber="9">
|
1563
|
+
<span class="hits">1</span>
|
1564
|
+
|
1565
|
+
<code class="ruby"> attr_reader :auto_renew_status</code>
|
1566
|
+
</li>
|
1567
|
+
|
1568
|
+
<li class="never" data-hits="" data-linenumber="10">
|
1569
|
+
|
1570
|
+
|
1571
|
+
<code class="ruby"></code>
|
1572
|
+
</li>
|
1573
|
+
|
1574
|
+
<li class="never" data-hits="" data-linenumber="11">
|
1575
|
+
|
1576
|
+
|
1577
|
+
<code class="ruby"> # The current renewal preference for the auto-renewable subscription.</code>
|
1578
|
+
</li>
|
1579
|
+
|
1580
|
+
<li class="never" data-hits="" data-linenumber="12">
|
1581
|
+
|
1582
|
+
|
1583
|
+
<code class="ruby"> # The value for this key corresponds to the productIdentifier property of the product that the customer’s subscription renews.</code>
|
1584
|
+
</li>
|
1585
|
+
|
1586
|
+
<li class="covered" data-hits="1" data-linenumber="13">
|
1587
|
+
<span class="hits">1</span>
|
1588
|
+
|
1589
|
+
<code class="ruby"> attr_reader :auto_renew_product_id</code>
|
1590
|
+
</li>
|
1591
|
+
|
1592
|
+
<li class="never" data-hits="" data-linenumber="14">
|
1593
|
+
|
1594
|
+
|
1595
|
+
<code class="ruby"></code>
|
1596
|
+
</li>
|
1597
|
+
|
1598
|
+
<li class="never" data-hits="" data-linenumber="15">
|
1599
|
+
|
1600
|
+
|
1601
|
+
<code class="ruby"> # For an expired subscription, whether or not Apple is still attempting to automatically renew the subscription.</code>
|
1602
|
+
</li>
|
1603
|
+
|
1604
|
+
<li class="never" data-hits="" data-linenumber="16">
|
1605
|
+
|
1606
|
+
|
1607
|
+
<code class="ruby"> # If the customer’s subscription failed to renew because the App Store was unable to complete the transaction, this value will reflect whether or not the App Store is still trying to renew the subscription.</code>
|
1608
|
+
</li>
|
1609
|
+
|
1610
|
+
<li class="covered" data-hits="1" data-linenumber="17">
|
1611
|
+
<span class="hits">1</span>
|
1612
|
+
|
1613
|
+
<code class="ruby"> attr_reader :is_in_billing_retry_period</code>
|
1614
|
+
</li>
|
1615
|
+
|
1616
|
+
<li class="never" data-hits="" data-linenumber="18">
|
1617
|
+
|
1618
|
+
|
1619
|
+
<code class="ruby"></code>
|
1620
|
+
</li>
|
1621
|
+
|
1622
|
+
<li class="never" data-hits="" data-linenumber="19">
|
1623
|
+
|
1624
|
+
|
1625
|
+
<code class="ruby"> # The product identifier of the item that was purchased.</code>
|
1626
|
+
</li>
|
1627
|
+
|
1628
|
+
<li class="never" data-hits="" data-linenumber="20">
|
1629
|
+
|
1630
|
+
|
1631
|
+
<code class="ruby"> # This value corresponds to the productIdentifier property of the SKPayment object stored in the transaction’s payment property.</code>
|
1632
|
+
</li>
|
1633
|
+
|
1634
|
+
<li class="covered" data-hits="1" data-linenumber="21">
|
1635
|
+
<span class="hits">1</span>
|
1636
|
+
|
1637
|
+
<code class="ruby"> attr_reader :product_id</code>
|
1638
|
+
</li>
|
1639
|
+
|
1640
|
+
<li class="never" data-hits="" data-linenumber="22">
|
1641
|
+
|
1642
|
+
|
1643
|
+
<code class="ruby"></code>
|
1644
|
+
</li>
|
1645
|
+
|
1646
|
+
<li class="never" data-hits="" data-linenumber="23">
|
1647
|
+
|
1648
|
+
|
1649
|
+
<code class="ruby"> # The current price consent status for a subscription price increase</code>
|
1650
|
+
</li>
|
1651
|
+
|
1652
|
+
<li class="never" data-hits="" data-linenumber="24">
|
1653
|
+
|
1654
|
+
|
1655
|
+
<code class="ruby"> # This key is only present for auto-renewable subscription receipts if the subscription price was increased without keeping the existing price for active subscribers</code>
|
1656
|
+
</li>
|
1657
|
+
|
1658
|
+
<li class="covered" data-hits="1" data-linenumber="25">
|
1659
|
+
<span class="hits">1</span>
|
1660
|
+
|
1661
|
+
<code class="ruby"> attr_reader :price_consent_status</code>
|
1662
|
+
</li>
|
1663
|
+
|
1664
|
+
<li class="never" data-hits="" data-linenumber="26">
|
1665
|
+
|
1666
|
+
|
1667
|
+
<code class="ruby"></code>
|
1668
|
+
</li>
|
1669
|
+
|
1670
|
+
<li class="never" data-hits="" data-linenumber="27">
|
1671
|
+
|
1672
|
+
|
1673
|
+
<code class="ruby"> # For a transaction that was cancelled, the reason for cancellation.</code>
|
1674
|
+
</li>
|
1675
|
+
|
1676
|
+
<li class="never" data-hits="" data-linenumber="28">
|
1677
|
+
|
1678
|
+
|
1679
|
+
<code class="ruby"> # Use this value along with the cancellation date to identify possible issues in your app that may lead customers to contact Apple customer support.</code>
|
1680
|
+
</li>
|
1681
|
+
|
1682
|
+
<li class="covered" data-hits="1" data-linenumber="29">
|
1683
|
+
<span class="hits">1</span>
|
1684
|
+
|
1685
|
+
<code class="ruby"> attr_reader :cancellation_reason</code>
|
1686
|
+
</li>
|
1687
|
+
|
1688
|
+
<li class="never" data-hits="" data-linenumber="30">
|
1689
|
+
|
1690
|
+
|
1691
|
+
<code class="ruby"></code>
|
1692
|
+
</li>
|
1693
|
+
|
1694
|
+
<li class="covered" data-hits="1" data-linenumber="31">
|
1695
|
+
<span class="hits">1</span>
|
1696
|
+
|
1697
|
+
<code class="ruby"> def initialize(attributes)</code>
|
1698
|
+
</li>
|
1699
|
+
|
1700
|
+
<li class="covered" data-hits="8" data-linenumber="32">
|
1701
|
+
<span class="hits">8</span>
|
1702
|
+
|
1703
|
+
<code class="ruby"> @expiration_intent = Integer(attributes['expiration_intent']) if attributes['expiration_intent']</code>
|
1704
|
+
</li>
|
1705
|
+
|
1706
|
+
<li class="covered" data-hits="8" data-linenumber="33">
|
1707
|
+
<span class="hits">8</span>
|
1708
|
+
|
1709
|
+
<code class="ruby"> @auto_renew_status = Integer(attributes['auto_renew_status']) if attributes['auto_renew_status']</code>
|
1710
|
+
</li>
|
1711
|
+
|
1712
|
+
<li class="covered" data-hits="8" data-linenumber="34">
|
1713
|
+
<span class="hits">8</span>
|
1714
|
+
|
1715
|
+
<code class="ruby"> @auto_renew_product_id = attributes['auto_renew_product_id']</code>
|
1716
|
+
</li>
|
1717
|
+
|
1718
|
+
<li class="never" data-hits="" data-linenumber="35">
|
1719
|
+
|
1720
|
+
|
1721
|
+
<code class="ruby"></code>
|
1722
|
+
</li>
|
1723
|
+
|
1724
|
+
<li class="covered" data-hits="8" data-linenumber="36">
|
1725
|
+
<span class="hits">8</span>
|
1726
|
+
|
1727
|
+
<code class="ruby"> if attributes['is_in_billing_retry_period']</code>
|
1728
|
+
</li>
|
1729
|
+
|
1730
|
+
<li class="covered" data-hits="8" data-linenumber="37">
|
1731
|
+
<span class="hits">8</span>
|
1732
|
+
|
1733
|
+
<code class="ruby"> @is_in_billing_retry_period = (attributes['is_in_billing_retry_period'] == '1')</code>
|
1734
|
+
</li>
|
1735
|
+
|
1736
|
+
<li class="never" data-hits="" data-linenumber="38">
|
1737
|
+
|
1738
|
+
|
1739
|
+
<code class="ruby"> end</code>
|
1740
|
+
</li>
|
1741
|
+
|
1742
|
+
<li class="never" data-hits="" data-linenumber="39">
|
1743
|
+
|
1744
|
+
|
1745
|
+
<code class="ruby"></code>
|
1746
|
+
</li>
|
1747
|
+
|
1748
|
+
<li class="covered" data-hits="8" data-linenumber="40">
|
1749
|
+
<span class="hits">8</span>
|
1750
|
+
|
1751
|
+
<code class="ruby"> @product_id = attributes['product_id']</code>
|
1752
|
+
</li>
|
1753
|
+
|
1754
|
+
<li class="never" data-hits="" data-linenumber="41">
|
1755
|
+
|
1756
|
+
|
1757
|
+
<code class="ruby"></code>
|
1758
|
+
</li>
|
1759
|
+
|
1760
|
+
<li class="covered" data-hits="8" data-linenumber="42">
|
1761
|
+
<span class="hits">8</span>
|
1762
|
+
|
1763
|
+
<code class="ruby"> @price_consent_status = Integer(attributes['price_consent_status']) if attributes['price_consent_status']</code>
|
1764
|
+
</li>
|
1765
|
+
|
1766
|
+
<li class="covered" data-hits="8" data-linenumber="43">
|
1767
|
+
<span class="hits">8</span>
|
1768
|
+
|
1769
|
+
<code class="ruby"> @cancellation_reason = Integer(attributes['cancellation_reason']) if attributes['cancellation_reason']</code>
|
1770
|
+
</li>
|
1771
|
+
|
1772
|
+
<li class="never" data-hits="" data-linenumber="44">
|
1773
|
+
|
1774
|
+
|
1775
|
+
<code class="ruby"> end</code>
|
1776
|
+
</li>
|
1777
|
+
|
1778
|
+
<li class="never" data-hits="" data-linenumber="45">
|
1779
|
+
|
1780
|
+
|
1781
|
+
<code class="ruby"></code>
|
1782
|
+
</li>
|
1783
|
+
|
1784
|
+
<li class="covered" data-hits="1" data-linenumber="46">
|
1785
|
+
<span class="hits">1</span>
|
1786
|
+
|
1787
|
+
<code class="ruby"> def to_hash</code>
|
1788
|
+
</li>
|
1789
|
+
|
1790
|
+
<li class="covered" data-hits="2" data-linenumber="47">
|
1791
|
+
<span class="hits">2</span>
|
1792
|
+
|
1793
|
+
<code class="ruby"> {</code>
|
1794
|
+
</li>
|
1795
|
+
|
1796
|
+
<li class="never" data-hits="" data-linenumber="48">
|
1797
|
+
|
1798
|
+
|
1799
|
+
<code class="ruby"> expiration_intent: @expiration_intent,</code>
|
1800
|
+
</li>
|
1801
|
+
|
1802
|
+
<li class="never" data-hits="" data-linenumber="49">
|
1803
|
+
|
1804
|
+
|
1805
|
+
<code class="ruby"> auto_renew_status: @auto_renew_status,</code>
|
1806
|
+
</li>
|
1807
|
+
|
1808
|
+
<li class="never" data-hits="" data-linenumber="50">
|
1809
|
+
|
1810
|
+
|
1811
|
+
<code class="ruby"> auto_renew_product_id: @auto_renew_product_id,</code>
|
1812
|
+
</li>
|
1813
|
+
|
1814
|
+
<li class="never" data-hits="" data-linenumber="51">
|
1815
|
+
|
1816
|
+
|
1817
|
+
<code class="ruby"> is_in_billing_retry_period: @is_in_billing_retry_period,</code>
|
1818
|
+
</li>
|
1819
|
+
|
1820
|
+
<li class="never" data-hits="" data-linenumber="52">
|
1821
|
+
|
1822
|
+
|
1823
|
+
<code class="ruby"> product_id: @product_id,</code>
|
1824
|
+
</li>
|
1825
|
+
|
1826
|
+
<li class="never" data-hits="" data-linenumber="53">
|
1827
|
+
|
1828
|
+
|
1829
|
+
<code class="ruby"> price_consent_status: @price_consent_status,</code>
|
1830
|
+
</li>
|
1831
|
+
|
1832
|
+
<li class="never" data-hits="" data-linenumber="54">
|
1833
|
+
|
1834
|
+
|
1835
|
+
<code class="ruby"> cancellation_reason: @cancellation_reason</code>
|
1836
|
+
</li>
|
1837
|
+
|
1838
|
+
<li class="never" data-hits="" data-linenumber="55">
|
1839
|
+
|
1840
|
+
|
1841
|
+
<code class="ruby"> }</code>
|
1842
|
+
</li>
|
1843
|
+
|
1844
|
+
<li class="never" data-hits="" data-linenumber="56">
|
1845
|
+
|
1846
|
+
|
1847
|
+
<code class="ruby"> end</code>
|
1848
|
+
</li>
|
1849
|
+
|
1850
|
+
<li class="never" data-hits="" data-linenumber="57">
|
1851
|
+
|
1852
|
+
|
1853
|
+
<code class="ruby"></code>
|
1854
|
+
</li>
|
1855
|
+
|
1856
|
+
<li class="covered" data-hits="1" data-linenumber="58">
|
1857
|
+
<span class="hits">1</span>
|
1858
|
+
|
1859
|
+
<code class="ruby"> alias_method :to_h, :to_hash</code>
|
1860
|
+
</li>
|
1861
|
+
|
1862
|
+
<li class="never" data-hits="" data-linenumber="59">
|
1863
|
+
|
1864
|
+
|
1865
|
+
<code class="ruby"></code>
|
1866
|
+
</li>
|
1867
|
+
|
1868
|
+
<li class="covered" data-hits="1" data-linenumber="60">
|
1869
|
+
<span class="hits">1</span>
|
1870
|
+
|
1871
|
+
<code class="ruby"> def to_json</code>
|
1872
|
+
</li>
|
1873
|
+
|
1874
|
+
<li class="missed" data-hits="0" data-linenumber="61">
|
1875
|
+
|
1876
|
+
|
1877
|
+
<code class="ruby"> to_hash.to_json</code>
|
1878
|
+
</li>
|
1879
|
+
|
1880
|
+
<li class="never" data-hits="" data-linenumber="62">
|
1881
|
+
|
1882
|
+
|
1883
|
+
<code class="ruby"> end</code>
|
1884
|
+
</li>
|
1885
|
+
|
1886
|
+
<li class="never" data-hits="" data-linenumber="63">
|
1887
|
+
|
1888
|
+
|
1889
|
+
<code class="ruby"> end</code>
|
1890
|
+
</li>
|
1891
|
+
|
1892
|
+
<li class="never" data-hits="" data-linenumber="64">
|
1893
|
+
|
1894
|
+
|
1895
|
+
<code class="ruby">end</code>
|
1896
|
+
</li>
|
1897
|
+
|
1898
|
+
</ol>
|
1899
|
+
</pre>
|
1900
|
+
</div>
|
1901
|
+
|
1902
|
+
|
1903
|
+
<div class="source_table" id="77ad70939c4d9b01595773040694e97b058d41a1">
|
1904
|
+
<div class="header">
|
1905
|
+
<h3>lib/venice/receipt.rb</h3>
|
1906
|
+
<h4><span class="red">75.58 %</span> covered</h4>
|
1907
|
+
<div>
|
1908
|
+
<b>86</b> relevant lines.
|
1909
|
+
<span class="green"><b>65</b> lines covered</span> and
|
1910
|
+
<span class="red"><b>21</b> lines missed.</span>
|
1911
|
+
</div>
|
1912
|
+
</div>
|
1913
|
+
|
1914
|
+
<pre>
|
1915
|
+
<ol>
|
1916
|
+
|
1917
|
+
<li class="covered" data-hits="1" data-linenumber="1">
|
1918
|
+
<span class="hits">1</span>
|
1919
|
+
|
1920
|
+
<code class="ruby">require 'time'</code>
|
1921
|
+
</li>
|
1922
|
+
|
1923
|
+
<li class="never" data-hits="" data-linenumber="2">
|
1924
|
+
|
1925
|
+
|
1926
|
+
<code class="ruby"></code>
|
1927
|
+
</li>
|
1928
|
+
|
1929
|
+
<li class="covered" data-hits="1" data-linenumber="3">
|
1930
|
+
<span class="hits">1</span>
|
1931
|
+
|
1932
|
+
<code class="ruby">module Venice</code>
|
1933
|
+
</li>
|
1934
|
+
|
1935
|
+
<li class="covered" data-hits="1" data-linenumber="4">
|
1936
|
+
<span class="hits">1</span>
|
1937
|
+
|
1938
|
+
<code class="ruby"> class Receipt</code>
|
1939
|
+
</li>
|
1940
|
+
|
1941
|
+
<li class="never" data-hits="" data-linenumber="5">
|
1942
|
+
|
1943
|
+
|
1944
|
+
<code class="ruby"> # For detailed explanations on these keys/values, see</code>
|
1945
|
+
</li>
|
1946
|
+
|
1947
|
+
<li class="never" data-hits="" data-linenumber="6">
|
1948
|
+
|
1949
|
+
|
1950
|
+
<code class="ruby"> # https://developer.apple.com/library/ios/releasenotes/General/ValidateAppStoreReceipt/Chapters/ReceiptFields.html#//apple_ref/doc/uid/TP40010573-CH106-SW1</code>
|
1951
|
+
</li>
|
1952
|
+
|
1953
|
+
<li class="never" data-hits="" data-linenumber="7">
|
1954
|
+
|
1955
|
+
|
1956
|
+
<code class="ruby"></code>
|
1957
|
+
</li>
|
1958
|
+
|
1959
|
+
<li class="never" data-hits="" data-linenumber="8">
|
1960
|
+
|
1961
|
+
|
1962
|
+
<code class="ruby"> # The app’s bundle identifier.</code>
|
1963
|
+
</li>
|
1964
|
+
|
1965
|
+
<li class="covered" data-hits="1" data-linenumber="9">
|
1966
|
+
<span class="hits">1</span>
|
1967
|
+
|
1968
|
+
<code class="ruby"> attr_reader :bundle_id</code>
|
1969
|
+
</li>
|
1970
|
+
|
1971
|
+
<li class="never" data-hits="" data-linenumber="10">
|
1972
|
+
|
1973
|
+
|
1974
|
+
<code class="ruby"></code>
|
1975
|
+
</li>
|
1976
|
+
|
1977
|
+
<li class="never" data-hits="" data-linenumber="11">
|
1978
|
+
|
1979
|
+
|
1980
|
+
<code class="ruby"> # The app’s version number.</code>
|
1981
|
+
</li>
|
1982
|
+
|
1983
|
+
<li class="covered" data-hits="1" data-linenumber="12">
|
1984
|
+
<span class="hits">1</span>
|
1985
|
+
|
1986
|
+
<code class="ruby"> attr_reader :application_version</code>
|
1987
|
+
</li>
|
1988
|
+
|
1989
|
+
<li class="never" data-hits="" data-linenumber="13">
|
1990
|
+
|
1991
|
+
|
1992
|
+
<code class="ruby"></code>
|
1993
|
+
</li>
|
1994
|
+
|
1995
|
+
<li class="never" data-hits="" data-linenumber="14">
|
1996
|
+
|
1997
|
+
|
1998
|
+
<code class="ruby"> # The receipt for an in-app purchase.</code>
|
1999
|
+
</li>
|
2000
|
+
|
2001
|
+
<li class="covered" data-hits="1" data-linenumber="15">
|
2002
|
+
<span class="hits">1</span>
|
2003
|
+
|
2004
|
+
<code class="ruby"> attr_reader :in_app</code>
|
2005
|
+
</li>
|
2006
|
+
|
2007
|
+
<li class="never" data-hits="" data-linenumber="16">
|
2008
|
+
|
2009
|
+
|
2010
|
+
<code class="ruby"></code>
|
2011
|
+
</li>
|
2012
|
+
|
2013
|
+
<li class="never" data-hits="" data-linenumber="17">
|
2014
|
+
|
2015
|
+
|
2016
|
+
<code class="ruby"> # The version of the app that was originally purchased.</code>
|
2017
|
+
</li>
|
2018
|
+
|
2019
|
+
<li class="covered" data-hits="1" data-linenumber="18">
|
2020
|
+
<span class="hits">1</span>
|
2021
|
+
|
2022
|
+
<code class="ruby"> attr_reader :original_application_version</code>
|
2023
|
+
</li>
|
2024
|
+
|
2025
|
+
<li class="never" data-hits="" data-linenumber="19">
|
2026
|
+
|
2027
|
+
|
2028
|
+
<code class="ruby"></code>
|
2029
|
+
</li>
|
2030
|
+
|
2031
|
+
<li class="never" data-hits="" data-linenumber="20">
|
2032
|
+
|
2033
|
+
|
2034
|
+
<code class="ruby"> # The original purchase date</code>
|
2035
|
+
</li>
|
2036
|
+
|
2037
|
+
<li class="covered" data-hits="1" data-linenumber="21">
|
2038
|
+
<span class="hits">1</span>
|
2039
|
+
|
2040
|
+
<code class="ruby"> attr_reader :original_purchase_date</code>
|
2041
|
+
</li>
|
2042
|
+
|
2043
|
+
<li class="never" data-hits="" data-linenumber="22">
|
2044
|
+
|
2045
|
+
|
2046
|
+
<code class="ruby"></code>
|
2047
|
+
</li>
|
2048
|
+
|
2049
|
+
<li class="never" data-hits="" data-linenumber="23">
|
2050
|
+
|
2051
|
+
|
2052
|
+
<code class="ruby"> # The date that the app receipt expires.</code>
|
2053
|
+
</li>
|
2054
|
+
|
2055
|
+
<li class="covered" data-hits="1" data-linenumber="24">
|
2056
|
+
<span class="hits">1</span>
|
2057
|
+
|
2058
|
+
<code class="ruby"> attr_reader :expires_at</code>
|
2059
|
+
</li>
|
2060
|
+
|
2061
|
+
<li class="never" data-hits="" data-linenumber="25">
|
2062
|
+
|
2063
|
+
|
2064
|
+
<code class="ruby"></code>
|
2065
|
+
</li>
|
2066
|
+
|
2067
|
+
<li class="never" data-hits="" data-linenumber="26">
|
2068
|
+
|
2069
|
+
|
2070
|
+
<code class="ruby"> # Non-Documented receipt keys/values</code>
|
2071
|
+
</li>
|
2072
|
+
|
2073
|
+
<li class="covered" data-hits="1" data-linenumber="27">
|
2074
|
+
<span class="hits">1</span>
|
2075
|
+
|
2076
|
+
<code class="ruby"> attr_reader :receipt_type</code>
|
2077
|
+
</li>
|
2078
|
+
|
2079
|
+
<li class="covered" data-hits="1" data-linenumber="28">
|
2080
|
+
<span class="hits">1</span>
|
2081
|
+
|
2082
|
+
<code class="ruby"> attr_reader :adam_id</code>
|
2083
|
+
</li>
|
2084
|
+
|
2085
|
+
<li class="covered" data-hits="1" data-linenumber="29">
|
2086
|
+
<span class="hits">1</span>
|
2087
|
+
|
2088
|
+
<code class="ruby"> attr_reader :download_id</code>
|
2089
|
+
</li>
|
2090
|
+
|
2091
|
+
<li class="covered" data-hits="1" data-linenumber="30">
|
2092
|
+
<span class="hits">1</span>
|
2093
|
+
|
2094
|
+
<code class="ruby"> attr_reader :requested_at</code>
|
2095
|
+
</li>
|
2096
|
+
|
2097
|
+
<li class="covered" data-hits="1" data-linenumber="31">
|
2098
|
+
<span class="hits">1</span>
|
2099
|
+
|
2100
|
+
<code class="ruby"> attr_reader :receipt_created_at</code>
|
2101
|
+
</li>
|
2102
|
+
|
2103
|
+
<li class="never" data-hits="" data-linenumber="32">
|
2104
|
+
|
2105
|
+
|
2106
|
+
<code class="ruby"></code>
|
2107
|
+
</li>
|
2108
|
+
|
2109
|
+
<li class="never" data-hits="" data-linenumber="33">
|
2110
|
+
|
2111
|
+
|
2112
|
+
<code class="ruby"> # Original json response from AppStore</code>
|
2113
|
+
</li>
|
2114
|
+
|
2115
|
+
<li class="covered" data-hits="1" data-linenumber="34">
|
2116
|
+
<span class="hits">1</span>
|
2117
|
+
|
2118
|
+
<code class="ruby"> attr_reader :original_json_response</code>
|
2119
|
+
</li>
|
2120
|
+
|
2121
|
+
<li class="never" data-hits="" data-linenumber="35">
|
2122
|
+
|
2123
|
+
|
2124
|
+
<code class="ruby"></code>
|
2125
|
+
</li>
|
2126
|
+
|
2127
|
+
<li class="covered" data-hits="1" data-linenumber="36">
|
2128
|
+
<span class="hits">1</span>
|
2129
|
+
|
2130
|
+
<code class="ruby"> attr_accessor :latest_receipt_info</code>
|
2131
|
+
</li>
|
2132
|
+
|
2133
|
+
<li class="never" data-hits="" data-linenumber="37">
|
2134
|
+
|
2135
|
+
|
2136
|
+
<code class="ruby"></code>
|
2137
|
+
</li>
|
2138
|
+
|
2139
|
+
<li class="never" data-hits="" data-linenumber="38">
|
2140
|
+
|
2141
|
+
|
2142
|
+
<code class="ruby"> # Information about the status of the customer's auto-renewable subscriptions</code>
|
2143
|
+
</li>
|
2144
|
+
|
2145
|
+
<li class="covered" data-hits="1" data-linenumber="39">
|
2146
|
+
<span class="hits">1</span>
|
2147
|
+
|
2148
|
+
<code class="ruby"> attr_reader :pending_renewal_info</code>
|
2149
|
+
</li>
|
2150
|
+
|
2151
|
+
<li class="never" data-hits="" data-linenumber="40">
|
2152
|
+
|
2153
|
+
|
2154
|
+
<code class="ruby"></code>
|
2155
|
+
</li>
|
2156
|
+
|
2157
|
+
<li class="covered" data-hits="1" data-linenumber="41">
|
2158
|
+
<span class="hits">1</span>
|
2159
|
+
|
2160
|
+
<code class="ruby"> def initialize(attributes = {})</code>
|
2161
|
+
</li>
|
2162
|
+
|
2163
|
+
<li class="covered" data-hits="10" data-linenumber="42">
|
2164
|
+
<span class="hits">10</span>
|
2165
|
+
|
2166
|
+
<code class="ruby"> @original_json_response = attributes['original_json_response']</code>
|
2167
|
+
</li>
|
2168
|
+
|
2169
|
+
<li class="never" data-hits="" data-linenumber="43">
|
2170
|
+
|
2171
|
+
|
2172
|
+
<code class="ruby"></code>
|
2173
|
+
</li>
|
2174
|
+
|
2175
|
+
<li class="covered" data-hits="10" data-linenumber="44">
|
2176
|
+
<span class="hits">10</span>
|
2177
|
+
|
2178
|
+
<code class="ruby"> @bundle_id = attributes['bundle_id']</code>
|
2179
|
+
</li>
|
2180
|
+
|
2181
|
+
<li class="covered" data-hits="10" data-linenumber="45">
|
2182
|
+
<span class="hits">10</span>
|
2183
|
+
|
2184
|
+
<code class="ruby"> @application_version = attributes['application_version']</code>
|
2185
|
+
</li>
|
2186
|
+
|
2187
|
+
<li class="covered" data-hits="10" data-linenumber="46">
|
2188
|
+
<span class="hits">10</span>
|
2189
|
+
|
2190
|
+
<code class="ruby"> @original_application_version = attributes['original_application_version']</code>
|
2191
|
+
</li>
|
2192
|
+
|
2193
|
+
<li class="covered" data-hits="10" data-linenumber="47">
|
2194
|
+
<span class="hits">10</span>
|
2195
|
+
|
2196
|
+
<code class="ruby"> if attributes['original_purchase_date']</code>
|
2197
|
+
</li>
|
2198
|
+
|
2199
|
+
<li class="covered" data-hits="7" data-linenumber="48">
|
2200
|
+
<span class="hits">7</span>
|
2201
|
+
|
2202
|
+
<code class="ruby"> @original_purchase_date = DateTime.parse(attributes['original_purchase_date'])</code>
|
2203
|
+
</li>
|
2204
|
+
|
2205
|
+
<li class="never" data-hits="" data-linenumber="49">
|
2206
|
+
|
2207
|
+
|
2208
|
+
<code class="ruby"> end</code>
|
2209
|
+
</li>
|
2210
|
+
|
2211
|
+
<li class="covered" data-hits="10" data-linenumber="50">
|
2212
|
+
<span class="hits">10</span>
|
2213
|
+
|
2214
|
+
<code class="ruby"> if attributes['expiration_date']</code>
|
2215
|
+
</li>
|
2216
|
+
|
2217
|
+
<li class="covered" data-hits="7" data-linenumber="51">
|
2218
|
+
<span class="hits">7</span>
|
2219
|
+
|
2220
|
+
<code class="ruby"> @expires_at = Time.at(attributes['expiration_date'].to_i / 1000).to_datetime</code>
|
2221
|
+
</li>
|
2222
|
+
|
2223
|
+
<li class="never" data-hits="" data-linenumber="52">
|
2224
|
+
|
2225
|
+
|
2226
|
+
<code class="ruby"> end</code>
|
2227
|
+
</li>
|
2228
|
+
|
2229
|
+
<li class="never" data-hits="" data-linenumber="53">
|
2230
|
+
|
2231
|
+
|
2232
|
+
<code class="ruby"></code>
|
2233
|
+
</li>
|
2234
|
+
|
2235
|
+
<li class="covered" data-hits="10" data-linenumber="54">
|
2236
|
+
<span class="hits">10</span>
|
2237
|
+
|
2238
|
+
<code class="ruby"> @receipt_type = attributes['receipt_type']</code>
|
2239
|
+
</li>
|
2240
|
+
|
2241
|
+
<li class="covered" data-hits="10" data-linenumber="55">
|
2242
|
+
<span class="hits">10</span>
|
2243
|
+
|
2244
|
+
<code class="ruby"> @adam_id = attributes['adam_id']</code>
|
2245
|
+
</li>
|
2246
|
+
|
2247
|
+
<li class="covered" data-hits="10" data-linenumber="56">
|
2248
|
+
<span class="hits">10</span>
|
2249
|
+
|
2250
|
+
<code class="ruby"> @download_id = attributes['download_id']</code>
|
2251
|
+
</li>
|
2252
|
+
|
2253
|
+
<li class="covered" data-hits="10" data-linenumber="57">
|
2254
|
+
<span class="hits">10</span>
|
2255
|
+
|
2256
|
+
<code class="ruby"> @requested_at = DateTime.parse(attributes['request_date']) if attributes['request_date']</code>
|
2257
|
+
</li>
|
2258
|
+
|
2259
|
+
<li class="covered" data-hits="10" data-linenumber="58">
|
2260
|
+
<span class="hits">10</span>
|
2261
|
+
|
2262
|
+
<code class="ruby"> @receipt_created_at = DateTime.parse(attributes['receipt_creation_date']) if attributes['receipt_creation_date']</code>
|
2263
|
+
</li>
|
2264
|
+
|
2265
|
+
<li class="never" data-hits="" data-linenumber="59">
|
2266
|
+
|
2267
|
+
|
2268
|
+
<code class="ruby"></code>
|
2269
|
+
</li>
|
2270
|
+
|
2271
|
+
<li class="covered" data-hits="10" data-linenumber="60">
|
2272
|
+
<span class="hits">10</span>
|
2273
|
+
|
2274
|
+
<code class="ruby"> @in_app = []</code>
|
2275
|
+
</li>
|
2276
|
+
|
2277
|
+
<li class="covered" data-hits="10" data-linenumber="61">
|
2278
|
+
<span class="hits">10</span>
|
2279
|
+
|
2280
|
+
<code class="ruby"> if attributes['in_app']</code>
|
2281
|
+
</li>
|
2282
|
+
|
2283
|
+
<li class="covered" data-hits="7" data-linenumber="62">
|
2284
|
+
<span class="hits">7</span>
|
2285
|
+
|
2286
|
+
<code class="ruby"> attributes['in_app'].each do |in_app_purchase_attributes|</code>
|
2287
|
+
</li>
|
2288
|
+
|
2289
|
+
<li class="covered" data-hits="7" data-linenumber="63">
|
2290
|
+
<span class="hits">7</span>
|
2291
|
+
|
2292
|
+
<code class="ruby"> @in_app << InAppReceipt.new(in_app_purchase_attributes)</code>
|
2293
|
+
</li>
|
2294
|
+
|
2295
|
+
<li class="never" data-hits="" data-linenumber="64">
|
2296
|
+
|
2297
|
+
|
2298
|
+
<code class="ruby"> end</code>
|
2299
|
+
</li>
|
2300
|
+
|
2301
|
+
<li class="never" data-hits="" data-linenumber="65">
|
2302
|
+
|
2303
|
+
|
2304
|
+
<code class="ruby"> end</code>
|
2305
|
+
</li>
|
2306
|
+
|
2307
|
+
<li class="never" data-hits="" data-linenumber="66">
|
2308
|
+
|
2309
|
+
|
2310
|
+
<code class="ruby"></code>
|
2311
|
+
</li>
|
2312
|
+
|
2313
|
+
<li class="covered" data-hits="10" data-linenumber="67">
|
2314
|
+
<span class="hits">10</span>
|
2315
|
+
|
2316
|
+
<code class="ruby"> @pending_renewal_info = []</code>
|
2317
|
+
</li>
|
2318
|
+
|
2319
|
+
<li class="covered" data-hits="10" data-linenumber="68">
|
2320
|
+
<span class="hits">10</span>
|
2321
|
+
|
2322
|
+
<code class="ruby"> if original_json_response && original_json_response['pending_renewal_info']</code>
|
2323
|
+
</li>
|
2324
|
+
|
2325
|
+
<li class="covered" data-hits="6" data-linenumber="69">
|
2326
|
+
<span class="hits">6</span>
|
2327
|
+
|
2328
|
+
<code class="ruby"> original_json_response['pending_renewal_info'].each do |pending_renewal_attributes|</code>
|
2329
|
+
</li>
|
2330
|
+
|
2331
|
+
<li class="covered" data-hits="6" data-linenumber="70">
|
2332
|
+
<span class="hits">6</span>
|
2333
|
+
|
2334
|
+
<code class="ruby"> @pending_renewal_info << PendingRenewalInfo.new(pending_renewal_attributes)</code>
|
2335
|
+
</li>
|
2336
|
+
|
2337
|
+
<li class="never" data-hits="" data-linenumber="71">
|
2338
|
+
|
2339
|
+
|
2340
|
+
<code class="ruby"> end</code>
|
2341
|
+
</li>
|
2342
|
+
|
2343
|
+
<li class="never" data-hits="" data-linenumber="72">
|
2344
|
+
|
2345
|
+
|
2346
|
+
<code class="ruby"> end</code>
|
2347
|
+
</li>
|
2348
|
+
|
2349
|
+
<li class="never" data-hits="" data-linenumber="73">
|
2350
|
+
|
2351
|
+
|
2352
|
+
<code class="ruby"> end</code>
|
2353
|
+
</li>
|
2354
|
+
|
2355
|
+
<li class="never" data-hits="" data-linenumber="74">
|
2356
|
+
|
2357
|
+
|
2358
|
+
<code class="ruby"></code>
|
2359
|
+
</li>
|
2360
|
+
|
2361
|
+
<li class="covered" data-hits="1" data-linenumber="75">
|
2362
|
+
<span class="hits">1</span>
|
2363
|
+
|
2364
|
+
<code class="ruby"> def to_hash</code>
|
2365
|
+
</li>
|
2366
|
+
|
2367
|
+
<li class="covered" data-hits="1" data-linenumber="76">
|
2368
|
+
<span class="hits">1</span>
|
2369
|
+
|
2370
|
+
<code class="ruby"> {</code>
|
2371
|
+
</li>
|
2372
|
+
|
2373
|
+
<li class="never" data-hits="" data-linenumber="77">
|
2374
|
+
|
2375
|
+
|
2376
|
+
<code class="ruby"> bundle_id: @bundle_id,</code>
|
2377
|
+
</li>
|
2378
|
+
|
2379
|
+
<li class="never" data-hits="" data-linenumber="78">
|
2380
|
+
|
2381
|
+
|
2382
|
+
<code class="ruby"> application_version: @application_version,</code>
|
2383
|
+
</li>
|
2384
|
+
|
2385
|
+
<li class="never" data-hits="" data-linenumber="79">
|
2386
|
+
|
2387
|
+
|
2388
|
+
<code class="ruby"> original_application_version: @original_application_version,</code>
|
2389
|
+
</li>
|
2390
|
+
|
2391
|
+
<li class="covered" data-hits="1" data-linenumber="80">
|
2392
|
+
<span class="hits">1</span>
|
2393
|
+
|
2394
|
+
<code class="ruby"> original_purchase_date: (@original_purchase_date.httpdate rescue nil),</code>
|
2395
|
+
</li>
|
2396
|
+
|
2397
|
+
<li class="covered" data-hits="1" data-linenumber="81">
|
2398
|
+
<span class="hits">1</span>
|
2399
|
+
|
2400
|
+
<code class="ruby"> expires_at: (@expires_at.httpdate rescue nil),</code>
|
2401
|
+
</li>
|
2402
|
+
|
2403
|
+
<li class="never" data-hits="" data-linenumber="82">
|
2404
|
+
|
2405
|
+
|
2406
|
+
<code class="ruby"> receipt_type: @receipt_type,</code>
|
2407
|
+
</li>
|
2408
|
+
|
2409
|
+
<li class="never" data-hits="" data-linenumber="83">
|
2410
|
+
|
2411
|
+
|
2412
|
+
<code class="ruby"> adam_id: @adam_id,</code>
|
2413
|
+
</li>
|
2414
|
+
|
2415
|
+
<li class="never" data-hits="" data-linenumber="84">
|
2416
|
+
|
2417
|
+
|
2418
|
+
<code class="ruby"> download_id: @download_id,</code>
|
2419
|
+
</li>
|
2420
|
+
|
2421
|
+
<li class="covered" data-hits="1" data-linenumber="85">
|
2422
|
+
<span class="hits">1</span>
|
2423
|
+
|
2424
|
+
<code class="ruby"> requested_at: (@requested_at.httpdate rescue nil),</code>
|
2425
|
+
</li>
|
2426
|
+
|
2427
|
+
<li class="covered" data-hits="1" data-linenumber="86">
|
2428
|
+
<span class="hits">1</span>
|
2429
|
+
|
2430
|
+
<code class="ruby"> receipt_created_at: (@receipt_created_at.httpdate rescue nil),</code>
|
2431
|
+
</li>
|
2432
|
+
|
2433
|
+
<li class="never" data-hits="" data-linenumber="87">
|
2434
|
+
|
2435
|
+
|
2436
|
+
<code class="ruby"> in_app: @in_app.map(&:to_h),</code>
|
2437
|
+
</li>
|
2438
|
+
|
2439
|
+
<li class="never" data-hits="" data-linenumber="88">
|
2440
|
+
|
2441
|
+
|
2442
|
+
<code class="ruby"> pending_renewal_info: @pending_renewal_info.map(&:to_h),</code>
|
2443
|
+
</li>
|
2444
|
+
|
2445
|
+
<li class="never" data-hits="" data-linenumber="89">
|
2446
|
+
|
2447
|
+
|
2448
|
+
<code class="ruby"> latest_receipt_info: @latest_receipt_info</code>
|
2449
|
+
</li>
|
2450
|
+
|
2451
|
+
<li class="never" data-hits="" data-linenumber="90">
|
2452
|
+
|
2453
|
+
|
2454
|
+
<code class="ruby"> }</code>
|
2455
|
+
</li>
|
2456
|
+
|
2457
|
+
<li class="never" data-hits="" data-linenumber="91">
|
2458
|
+
|
2459
|
+
|
2460
|
+
<code class="ruby"> end</code>
|
2461
|
+
</li>
|
2462
|
+
|
2463
|
+
<li class="covered" data-hits="1" data-linenumber="92">
|
2464
|
+
<span class="hits">1</span>
|
2465
|
+
|
2466
|
+
<code class="ruby"> alias_method :to_h, :to_hash</code>
|
2467
|
+
</li>
|
2468
|
+
|
2469
|
+
<li class="never" data-hits="" data-linenumber="93">
|
2470
|
+
|
2471
|
+
|
2472
|
+
<code class="ruby"></code>
|
2473
|
+
</li>
|
2474
|
+
|
2475
|
+
<li class="covered" data-hits="1" data-linenumber="94">
|
2476
|
+
<span class="hits">1</span>
|
2477
|
+
|
2478
|
+
<code class="ruby"> def to_json</code>
|
2479
|
+
</li>
|
2480
|
+
|
2481
|
+
<li class="missed" data-hits="0" data-linenumber="95">
|
2482
|
+
|
2483
|
+
|
2484
|
+
<code class="ruby"> to_hash.to_json</code>
|
2485
|
+
</li>
|
2486
|
+
|
2487
|
+
<li class="never" data-hits="" data-linenumber="96">
|
2488
|
+
|
2489
|
+
|
2490
|
+
<code class="ruby"> end</code>
|
2491
|
+
</li>
|
2492
|
+
|
2493
|
+
<li class="never" data-hits="" data-linenumber="97">
|
2494
|
+
|
2495
|
+
|
2496
|
+
<code class="ruby"></code>
|
2497
|
+
</li>
|
2498
|
+
|
2499
|
+
<li class="covered" data-hits="1" data-linenumber="98">
|
2500
|
+
<span class="hits">1</span>
|
2501
|
+
|
2502
|
+
<code class="ruby"> class << self</code>
|
2503
|
+
</li>
|
2504
|
+
|
2505
|
+
<li class="covered" data-hits="1" data-linenumber="99">
|
2506
|
+
<span class="hits">1</span>
|
2507
|
+
|
2508
|
+
<code class="ruby"> def verify(data, options = {})</code>
|
2509
|
+
</li>
|
2510
|
+
|
2511
|
+
<li class="covered" data-hits="1" data-linenumber="100">
|
2512
|
+
<span class="hits">1</span>
|
2513
|
+
|
2514
|
+
<code class="ruby"> verify!(data, options)</code>
|
2515
|
+
</li>
|
2516
|
+
|
2517
|
+
<li class="never" data-hits="" data-linenumber="101">
|
2518
|
+
|
2519
|
+
|
2520
|
+
<code class="ruby"> rescue VerificationError, Client::TimeoutError</code>
|
2521
|
+
</li>
|
2522
|
+
|
2523
|
+
<li class="missed" data-hits="0" data-linenumber="102">
|
2524
|
+
|
2525
|
+
|
2526
|
+
<code class="ruby"> false</code>
|
2527
|
+
</li>
|
2528
|
+
|
2529
|
+
<li class="never" data-hits="" data-linenumber="103">
|
2530
|
+
|
2531
|
+
|
2532
|
+
<code class="ruby"> end</code>
|
2533
|
+
</li>
|
2534
|
+
|
2535
|
+
<li class="never" data-hits="" data-linenumber="104">
|
2536
|
+
|
2537
|
+
|
2538
|
+
<code class="ruby"></code>
|
2539
|
+
</li>
|
2540
|
+
|
2541
|
+
<li class="covered" data-hits="1" data-linenumber="105">
|
2542
|
+
<span class="hits">1</span>
|
2543
|
+
|
2544
|
+
<code class="ruby"> def verify!(data, options = {})</code>
|
2545
|
+
</li>
|
2546
|
+
|
2547
|
+
<li class="covered" data-hits="1" data-linenumber="106">
|
2548
|
+
<span class="hits">1</span>
|
2549
|
+
|
2550
|
+
<code class="ruby"> client = Client.production</code>
|
2551
|
+
</li>
|
2552
|
+
|
2553
|
+
<li class="never" data-hits="" data-linenumber="107">
|
2554
|
+
|
2555
|
+
|
2556
|
+
<code class="ruby"></code>
|
2557
|
+
</li>
|
2558
|
+
|
2559
|
+
<li class="covered" data-hits="1" data-linenumber="108">
|
2560
|
+
<span class="hits">1</span>
|
2561
|
+
|
2562
|
+
<code class="ruby"> begin</code>
|
2563
|
+
</li>
|
2564
|
+
|
2565
|
+
<li class="covered" data-hits="1" data-linenumber="109">
|
2566
|
+
<span class="hits">1</span>
|
2567
|
+
|
2568
|
+
<code class="ruby"> client.verify!(data, options)</code>
|
2569
|
+
</li>
|
2570
|
+
|
2571
|
+
<li class="missed" data-hits="0" data-linenumber="110">
|
2572
|
+
|
2573
|
+
|
2574
|
+
<code class="ruby"> rescue VerificationError => error</code>
|
2575
|
+
</li>
|
2576
|
+
|
2577
|
+
<li class="missed" data-hits="0" data-linenumber="111">
|
2578
|
+
|
2579
|
+
|
2580
|
+
<code class="ruby"> case error.code</code>
|
2581
|
+
</li>
|
2582
|
+
|
2583
|
+
<li class="never" data-hits="" data-linenumber="112">
|
2584
|
+
|
2585
|
+
|
2586
|
+
<code class="ruby"> when 21007</code>
|
2587
|
+
</li>
|
2588
|
+
|
2589
|
+
<li class="missed" data-hits="0" data-linenumber="113">
|
2590
|
+
|
2591
|
+
|
2592
|
+
<code class="ruby"> client = Client.development</code>
|
2593
|
+
</li>
|
2594
|
+
|
2595
|
+
<li class="missed" data-hits="0" data-linenumber="114">
|
2596
|
+
|
2597
|
+
|
2598
|
+
<code class="ruby"> retry</code>
|
2599
|
+
</li>
|
2600
|
+
|
2601
|
+
<li class="never" data-hits="" data-linenumber="115">
|
2602
|
+
|
2603
|
+
|
2604
|
+
<code class="ruby"> when 21008</code>
|
2605
|
+
</li>
|
2606
|
+
|
2607
|
+
<li class="missed" data-hits="0" data-linenumber="116">
|
2608
|
+
|
2609
|
+
|
2610
|
+
<code class="ruby"> client = Client.production</code>
|
2611
|
+
</li>
|
2612
|
+
|
2613
|
+
<li class="missed" data-hits="0" data-linenumber="117">
|
2614
|
+
|
2615
|
+
|
2616
|
+
<code class="ruby"> retry</code>
|
2617
|
+
</li>
|
2618
|
+
|
2619
|
+
<li class="never" data-hits="" data-linenumber="118">
|
2620
|
+
|
2621
|
+
|
2622
|
+
<code class="ruby"> else</code>
|
2623
|
+
</li>
|
2624
|
+
|
2625
|
+
<li class="missed" data-hits="0" data-linenumber="119">
|
2626
|
+
|
2627
|
+
|
2628
|
+
<code class="ruby"> raise error</code>
|
2629
|
+
</li>
|
2630
|
+
|
2631
|
+
<li class="never" data-hits="" data-linenumber="120">
|
2632
|
+
|
2633
|
+
|
2634
|
+
<code class="ruby"> end</code>
|
2635
|
+
</li>
|
2636
|
+
|
2637
|
+
<li class="never" data-hits="" data-linenumber="121">
|
2638
|
+
|
2639
|
+
|
2640
|
+
<code class="ruby"> end</code>
|
2641
|
+
</li>
|
2642
|
+
|
2643
|
+
<li class="never" data-hits="" data-linenumber="122">
|
2644
|
+
|
2645
|
+
|
2646
|
+
<code class="ruby"> end</code>
|
2647
|
+
</li>
|
2648
|
+
|
2649
|
+
<li class="never" data-hits="" data-linenumber="123">
|
2650
|
+
|
2651
|
+
|
2652
|
+
<code class="ruby"></code>
|
2653
|
+
</li>
|
2654
|
+
|
2655
|
+
<li class="covered" data-hits="1" data-linenumber="124">
|
2656
|
+
<span class="hits">1</span>
|
2657
|
+
|
2658
|
+
<code class="ruby"> alias :validate :verify</code>
|
2659
|
+
</li>
|
2660
|
+
|
2661
|
+
<li class="covered" data-hits="1" data-linenumber="125">
|
2662
|
+
<span class="hits">1</span>
|
2663
|
+
|
2664
|
+
<code class="ruby"> alias :validate! :verify!</code>
|
2665
|
+
</li>
|
2666
|
+
|
2667
|
+
<li class="never" data-hits="" data-linenumber="126">
|
2668
|
+
|
2669
|
+
|
2670
|
+
<code class="ruby"> end</code>
|
2671
|
+
</li>
|
2672
|
+
|
2673
|
+
<li class="never" data-hits="" data-linenumber="127">
|
2674
|
+
|
2675
|
+
|
2676
|
+
<code class="ruby"></code>
|
2677
|
+
</li>
|
2678
|
+
|
2679
|
+
<li class="covered" data-hits="1" data-linenumber="128">
|
2680
|
+
<span class="hits">1</span>
|
2681
|
+
|
2682
|
+
<code class="ruby"> class VerificationError < StandardError</code>
|
2683
|
+
</li>
|
2684
|
+
|
2685
|
+
<li class="covered" data-hits="1" data-linenumber="129">
|
2686
|
+
<span class="hits">1</span>
|
2687
|
+
|
2688
|
+
<code class="ruby"> attr_accessor :json</code>
|
2689
|
+
</li>
|
2690
|
+
|
2691
|
+
<li class="never" data-hits="" data-linenumber="130">
|
2692
|
+
|
2693
|
+
|
2694
|
+
<code class="ruby"></code>
|
2695
|
+
</li>
|
2696
|
+
|
2697
|
+
<li class="covered" data-hits="1" data-linenumber="131">
|
2698
|
+
<span class="hits">1</span>
|
2699
|
+
|
2700
|
+
<code class="ruby"> def initialize(json)</code>
|
2701
|
+
</li>
|
2702
|
+
|
2703
|
+
<li class="covered" data-hits="2" data-linenumber="132">
|
2704
|
+
<span class="hits">2</span>
|
2705
|
+
|
2706
|
+
<code class="ruby"> @json = json</code>
|
2707
|
+
</li>
|
2708
|
+
|
2709
|
+
<li class="never" data-hits="" data-linenumber="133">
|
2710
|
+
|
2711
|
+
|
2712
|
+
<code class="ruby"> end</code>
|
2713
|
+
</li>
|
2714
|
+
|
2715
|
+
<li class="never" data-hits="" data-linenumber="134">
|
2716
|
+
|
2717
|
+
|
2718
|
+
<code class="ruby"></code>
|
2719
|
+
</li>
|
2720
|
+
|
2721
|
+
<li class="covered" data-hits="1" data-linenumber="135">
|
2722
|
+
<span class="hits">1</span>
|
2723
|
+
|
2724
|
+
<code class="ruby"> def code</code>
|
2725
|
+
</li>
|
2726
|
+
|
2727
|
+
<li class="covered" data-hits="1" data-linenumber="136">
|
2728
|
+
<span class="hits">1</span>
|
2729
|
+
|
2730
|
+
<code class="ruby"> Integer(json['status'])</code>
|
2731
|
+
</li>
|
2732
|
+
|
2733
|
+
<li class="never" data-hits="" data-linenumber="137">
|
2734
|
+
|
2735
|
+
|
2736
|
+
<code class="ruby"> end</code>
|
2737
|
+
</li>
|
2738
|
+
|
2739
|
+
<li class="never" data-hits="" data-linenumber="138">
|
2740
|
+
|
2741
|
+
|
2742
|
+
<code class="ruby"></code>
|
2743
|
+
</li>
|
2744
|
+
|
2745
|
+
<li class="covered" data-hits="1" data-linenumber="139">
|
2746
|
+
<span class="hits">1</span>
|
2747
|
+
|
2748
|
+
<code class="ruby"> def retryable?</code>
|
2749
|
+
</li>
|
2750
|
+
|
2751
|
+
<li class="covered" data-hits="2" data-linenumber="140">
|
2752
|
+
<span class="hits">2</span>
|
2753
|
+
|
2754
|
+
<code class="ruby"> json['is_retryable']</code>
|
2755
|
+
</li>
|
2756
|
+
|
2757
|
+
<li class="never" data-hits="" data-linenumber="141">
|
2758
|
+
|
2759
|
+
|
2760
|
+
<code class="ruby"> end</code>
|
2761
|
+
</li>
|
2762
|
+
|
2763
|
+
<li class="never" data-hits="" data-linenumber="142">
|
2764
|
+
|
2765
|
+
|
2766
|
+
<code class="ruby"></code>
|
2767
|
+
</li>
|
2768
|
+
|
2769
|
+
<li class="covered" data-hits="1" data-linenumber="143">
|
2770
|
+
<span class="hits">1</span>
|
2771
|
+
|
2772
|
+
<code class="ruby"> def message</code>
|
2773
|
+
</li>
|
2774
|
+
|
2775
|
+
<li class="missed" data-hits="0" data-linenumber="144">
|
2776
|
+
|
2777
|
+
|
2778
|
+
<code class="ruby"> case code</code>
|
2779
|
+
</li>
|
2780
|
+
|
2781
|
+
<li class="never" data-hits="" data-linenumber="145">
|
2782
|
+
|
2783
|
+
|
2784
|
+
<code class="ruby"> when 21000</code>
|
2785
|
+
</li>
|
2786
|
+
|
2787
|
+
<li class="missed" data-hits="0" data-linenumber="146">
|
2788
|
+
|
2789
|
+
|
2790
|
+
<code class="ruby"> 'The App Store could not read the JSON object you provided.'</code>
|
2791
|
+
</li>
|
2792
|
+
|
2793
|
+
<li class="never" data-hits="" data-linenumber="147">
|
2794
|
+
|
2795
|
+
|
2796
|
+
<code class="ruby"> when 21002</code>
|
2797
|
+
</li>
|
2798
|
+
|
2799
|
+
<li class="missed" data-hits="0" data-linenumber="148">
|
2800
|
+
|
2801
|
+
|
2802
|
+
<code class="ruby"> 'The data in the receipt-data property was malformed.'</code>
|
2803
|
+
</li>
|
2804
|
+
|
2805
|
+
<li class="never" data-hits="" data-linenumber="149">
|
2806
|
+
|
2807
|
+
|
2808
|
+
<code class="ruby"> when 21003</code>
|
2809
|
+
</li>
|
2810
|
+
|
2811
|
+
<li class="missed" data-hits="0" data-linenumber="150">
|
2812
|
+
|
2813
|
+
|
2814
|
+
<code class="ruby"> 'The receipt could not be authenticated.'</code>
|
2815
|
+
</li>
|
2816
|
+
|
2817
|
+
<li class="never" data-hits="" data-linenumber="151">
|
2818
|
+
|
2819
|
+
|
2820
|
+
<code class="ruby"> when 21004</code>
|
2821
|
+
</li>
|
2822
|
+
|
2823
|
+
<li class="missed" data-hits="0" data-linenumber="152">
|
2824
|
+
|
2825
|
+
|
2826
|
+
<code class="ruby"> 'The shared secret you provided does not match the shared secret on file for your account.'</code>
|
2827
|
+
</li>
|
2828
|
+
|
2829
|
+
<li class="never" data-hits="" data-linenumber="153">
|
2830
|
+
|
2831
|
+
|
2832
|
+
<code class="ruby"> when 21005</code>
|
2833
|
+
</li>
|
2834
|
+
|
2835
|
+
<li class="missed" data-hits="0" data-linenumber="154">
|
2836
|
+
|
2837
|
+
|
2838
|
+
<code class="ruby"> 'The receipt server is not currently available.'</code>
|
2839
|
+
</li>
|
2840
|
+
|
2841
|
+
<li class="never" data-hits="" data-linenumber="155">
|
2842
|
+
|
2843
|
+
|
2844
|
+
<code class="ruby"> when 21006</code>
|
2845
|
+
</li>
|
2846
|
+
|
2847
|
+
<li class="missed" data-hits="0" data-linenumber="156">
|
2848
|
+
|
2849
|
+
|
2850
|
+
<code class="ruby"> 'This receipt is valid but the subscription has expired. When this status code is returned to your server, the receipt data is also decoded and returned as part of the response.'</code>
|
2851
|
+
</li>
|
2852
|
+
|
2853
|
+
<li class="never" data-hits="" data-linenumber="157">
|
2854
|
+
|
2855
|
+
|
2856
|
+
<code class="ruby"> when 21007</code>
|
2857
|
+
</li>
|
2858
|
+
|
2859
|
+
<li class="missed" data-hits="0" data-linenumber="158">
|
2860
|
+
|
2861
|
+
|
2862
|
+
<code class="ruby"> 'This receipt is a sandbox receipt, but it was sent to the production service for verification.'</code>
|
2863
|
+
</li>
|
2864
|
+
|
2865
|
+
<li class="never" data-hits="" data-linenumber="159">
|
2866
|
+
|
2867
|
+
|
2868
|
+
<code class="ruby"> when 21008</code>
|
2869
|
+
</li>
|
2870
|
+
|
2871
|
+
<li class="missed" data-hits="0" data-linenumber="160">
|
2872
|
+
|
2873
|
+
|
2874
|
+
<code class="ruby"> 'This receipt is a production receipt, but it was sent to the sandbox service for verification.'</code>
|
2875
|
+
</li>
|
2876
|
+
|
2877
|
+
<li class="never" data-hits="" data-linenumber="161">
|
2878
|
+
|
2879
|
+
|
2880
|
+
<code class="ruby"> when 21010</code>
|
2881
|
+
</li>
|
2882
|
+
|
2883
|
+
<li class="missed" data-hits="0" data-linenumber="162">
|
2884
|
+
|
2885
|
+
|
2886
|
+
<code class="ruby"> 'This receipt could not be authorized. Treat this the same as if a purchase was never made.'</code>
|
2887
|
+
</li>
|
2888
|
+
|
2889
|
+
<li class="never" data-hits="" data-linenumber="163">
|
2890
|
+
|
2891
|
+
|
2892
|
+
<code class="ruby"> when 21100..21199</code>
|
2893
|
+
</li>
|
2894
|
+
|
2895
|
+
<li class="missed" data-hits="0" data-linenumber="164">
|
2896
|
+
|
2897
|
+
|
2898
|
+
<code class="ruby"> 'Internal data access error.'</code>
|
2899
|
+
</li>
|
2900
|
+
|
2901
|
+
<li class="never" data-hits="" data-linenumber="165">
|
2902
|
+
|
2903
|
+
|
2904
|
+
<code class="ruby"> else</code>
|
2905
|
+
</li>
|
2906
|
+
|
2907
|
+
<li class="missed" data-hits="0" data-linenumber="166">
|
2908
|
+
|
2909
|
+
|
2910
|
+
<code class="ruby"> "Unknown Error: #{code}"</code>
|
2911
|
+
</li>
|
2912
|
+
|
2913
|
+
<li class="never" data-hits="" data-linenumber="167">
|
2914
|
+
|
2915
|
+
|
2916
|
+
<code class="ruby"> end</code>
|
2917
|
+
</li>
|
2918
|
+
|
2919
|
+
<li class="never" data-hits="" data-linenumber="168">
|
2920
|
+
|
2921
|
+
|
2922
|
+
<code class="ruby"> end</code>
|
2923
|
+
</li>
|
2924
|
+
|
2925
|
+
<li class="never" data-hits="" data-linenumber="169">
|
2926
|
+
|
2927
|
+
|
2928
|
+
<code class="ruby"> end</code>
|
2929
|
+
</li>
|
2930
|
+
|
2931
|
+
<li class="never" data-hits="" data-linenumber="170">
|
2932
|
+
|
2933
|
+
|
2934
|
+
<code class="ruby"> end</code>
|
2935
|
+
</li>
|
2936
|
+
|
2937
|
+
<li class="never" data-hits="" data-linenumber="171">
|
2938
|
+
|
2939
|
+
|
2940
|
+
<code class="ruby">end</code>
|
2941
|
+
</li>
|
2942
|
+
|
2943
|
+
</ol>
|
2944
|
+
</pre>
|
2945
|
+
</div>
|
2946
|
+
|
2947
|
+
|
2948
|
+
<div class="source_table" id="3ebfcfc298ce125918d25fd4c50e966d39734a2b">
|
2949
|
+
<div class="header">
|
2950
|
+
<h3>lib/venice/version.rb</h3>
|
2951
|
+
<h4><span class="green">100.0 %</span> covered</h4>
|
2952
|
+
<div>
|
2953
|
+
<b>2</b> relevant lines.
|
2954
|
+
<span class="green"><b>2</b> lines covered</span> and
|
2955
|
+
<span class="red"><b>0</b> lines missed.</span>
|
2956
|
+
</div>
|
2957
|
+
</div>
|
2958
|
+
|
2959
|
+
<pre>
|
2960
|
+
<ol>
|
2961
|
+
|
2962
|
+
<li class="covered" data-hits="1" data-linenumber="1">
|
2963
|
+
<span class="hits">1</span>
|
2964
|
+
|
2965
|
+
<code class="ruby">module Venice</code>
|
2966
|
+
</li>
|
2967
|
+
|
2968
|
+
<li class="covered" data-hits="1" data-linenumber="2">
|
2969
|
+
<span class="hits">1</span>
|
2970
|
+
|
2971
|
+
<code class="ruby"> VERSION = '0.5.0'</code>
|
2972
|
+
</li>
|
2973
|
+
|
2974
|
+
<li class="never" data-hits="" data-linenumber="3">
|
2975
|
+
|
2976
|
+
|
2977
|
+
<code class="ruby">end</code>
|
2978
|
+
</li>
|
2979
|
+
|
2980
|
+
</ol>
|
2981
|
+
</pre>
|
2982
|
+
</div>
|
2983
|
+
|
2984
|
+
|
2985
|
+
</div>
|
2986
|
+
</div>
|
2987
|
+
</body>
|
2988
|
+
</html>
|