venice 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -0
- data/coverage/index.html +324 -186
- data/lib/venice/client.rb +22 -7
- data/lib/venice/receipt.rb +16 -8
- data/lib/venice/version.rb +1 -1
- data/spec/client_spec.rb +45 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 42ba6b3e3d9dd51125339038c3b8890719e5f030
|
4
|
+
data.tar.gz: 759e8373824b9cf4fde27520e64dd718c551dc75
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e7b77d7cfa4941303172da4585b3209c8aa187f30e1d8f13c3615ddd13e1a9a5ff8506b88de6705f476da6935023a56bc982e084394da24e984326c5b777c03c
|
7
|
+
data.tar.gz: 6bffddf73fa4b43388e25f4b85f0f6fefa88b4486780a997895efff6745b0817e4b5e6325abc13a044869cf65d56785fbe6c258f775203cecc3e5710c3c3e570
|
data/README.md
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
![Venice](https://raw.github.com/nomad/nomad.github.io/assets/venice-banner.png)
|
2
2
|
|
3
|
+
[![Travis](https://img.shields.io/travis/nomad/venice.svg)](https://travis-ci.org/nomad/venice)
|
4
|
+
|
3
5
|
Venice is a simple gem for verifying Apple In-App Purchase receipts, and retrieving the information associated with receipt data.
|
4
6
|
|
5
7
|
There are two reasons why you should verify in-app purchase receipts on the server: First, it allows you to keep your own records of past purchases, which is useful for up-to-the-minute metrics and historical analysis. Second, server-side verification over SSL is the most reliable way to determine the authenticity of purchasing records.
|
data/coverage/index.html
CHANGED
@@ -14,14 +14,14 @@
|
|
14
14
|
<img src="./assets/0.10.2/loading.gif" alt="loading"/>
|
15
15
|
</div>
|
16
16
|
<div id="wrapper" style="display:none;">
|
17
|
-
<div class="timestamp">Generated <abbr class="timeago" title="2017-
|
17
|
+
<div class="timestamp">Generated <abbr class="timeago" title="2017-12-21T16:29:38+01:00">2017-12-21T16:29:38+01:00</abbr></div>
|
18
18
|
<ul class="group_tabs"></ul>
|
19
19
|
|
20
20
|
<div id="content">
|
21
21
|
<div class="file_list_container" id="AllFiles">
|
22
22
|
<h2>
|
23
23
|
<span class="group_name">All Files</span>
|
24
|
-
(<span class="covered_percent"><span class="yellow">
|
24
|
+
(<span class="covered_percent"><span class="yellow">86.34%</span></span>
|
25
25
|
covered at
|
26
26
|
<span class="covered_strength">
|
27
27
|
<span class="green">
|
@@ -32,8 +32,8 @@
|
|
32
32
|
<a name="AllFiles"></a>
|
33
33
|
<div>
|
34
34
|
<b>6</b> files in total.
|
35
|
-
<b>
|
36
|
-
<span class="green"><b>
|
35
|
+
<b>205</b> relevant lines.
|
36
|
+
<span class="green"><b>177</b> lines covered</span> and
|
37
37
|
<span class="red"><b>28</b> lines missed </span>
|
38
38
|
</div>
|
39
39
|
<table class="file_list">
|
@@ -62,12 +62,12 @@
|
|
62
62
|
|
63
63
|
<tr>
|
64
64
|
<td class="strong"><a href="#d79fadfe1306623a10822709e775b8c021f4fc4e" class="src_link" title="lib/venice/client.rb">lib/venice/client.rb</a></td>
|
65
|
-
<td class="green strong">91.
|
66
|
-
<td>
|
67
|
-
<td>
|
68
|
-
<td>
|
69
|
-
<td>
|
70
|
-
<td>2.
|
65
|
+
<td class="green strong">91.38 %</td>
|
66
|
+
<td>101</td>
|
67
|
+
<td>58</td>
|
68
|
+
<td>53</td>
|
69
|
+
<td>5</td>
|
70
|
+
<td>2.7</td>
|
71
71
|
</tr>
|
72
72
|
|
73
73
|
<tr>
|
@@ -92,11 +92,11 @@
|
|
92
92
|
|
93
93
|
<tr>
|
94
94
|
<td class="strong"><a href="#10dfdb14e321a7bb364075307e5a80a2a62317af" class="src_link" title="lib/venice/receipt.rb">lib/venice/receipt.rb</a></td>
|
95
|
-
<td class="red strong">
|
96
|
-
<td>
|
97
|
-
<td>
|
98
|
-
<td>
|
99
|
-
<td>
|
95
|
+
<td class="red strong">74.7 %</td>
|
96
|
+
<td>168</td>
|
97
|
+
<td>83</td>
|
98
|
+
<td>62</td>
|
99
|
+
<td>21</td>
|
100
100
|
<td>2.3</td>
|
101
101
|
</tr>
|
102
102
|
|
@@ -178,11 +178,11 @@
|
|
178
178
|
<div class="source_table" id="d79fadfe1306623a10822709e775b8c021f4fc4e">
|
179
179
|
<div class="header">
|
180
180
|
<h3>lib/venice/client.rb</h3>
|
181
|
-
<h4><span class="green">91.
|
181
|
+
<h4><span class="green">91.38 %</span> covered</h4>
|
182
182
|
<div>
|
183
|
-
<b>
|
184
|
-
<span class="green"><b>
|
185
|
-
<span class="red"><b>
|
183
|
+
<b>58</b> relevant lines.
|
184
|
+
<span class="green"><b>53</b> lines covered</span> and
|
185
|
+
<span class="red"><b>5</b> lines missed.</span>
|
186
186
|
</div>
|
187
187
|
</div>
|
188
188
|
|
@@ -255,451 +255,541 @@
|
|
255
255
|
<code class="ruby"> attr_writer :shared_secret</code>
|
256
256
|
</li>
|
257
257
|
|
258
|
-
<li class="
|
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">
|
259
265
|
|
260
266
|
|
261
267
|
<code class="ruby"></code>
|
262
268
|
</li>
|
263
269
|
|
264
|
-
<li class="covered" data-hits="1" data-linenumber="
|
270
|
+
<li class="covered" data-hits="1" data-linenumber="14">
|
265
271
|
<span class="hits">1</span>
|
266
272
|
|
267
273
|
<code class="ruby"> class << self</code>
|
268
274
|
</li>
|
269
275
|
|
270
|
-
<li class="covered" data-hits="1" data-linenumber="
|
276
|
+
<li class="covered" data-hits="1" data-linenumber="15">
|
271
277
|
<span class="hits">1</span>
|
272
278
|
|
273
279
|
<code class="ruby"> def development</code>
|
274
280
|
</li>
|
275
281
|
|
276
|
-
<li class="missed" data-hits="0" data-linenumber="
|
282
|
+
<li class="missed" data-hits="0" data-linenumber="16">
|
277
283
|
|
278
284
|
|
279
285
|
<code class="ruby"> client = new</code>
|
280
286
|
</li>
|
281
287
|
|
282
|
-
<li class="missed" data-hits="0" data-linenumber="
|
288
|
+
<li class="missed" data-hits="0" data-linenumber="17">
|
283
289
|
|
284
290
|
|
285
291
|
<code class="ruby"> client.verification_url = ITUNES_DEVELOPMENT_RECEIPT_VERIFICATION_ENDPOINT</code>
|
286
292
|
</li>
|
287
293
|
|
288
|
-
<li class="missed" data-hits="0" data-linenumber="
|
294
|
+
<li class="missed" data-hits="0" data-linenumber="18">
|
289
295
|
|
290
296
|
|
291
297
|
<code class="ruby"> client</code>
|
292
298
|
</li>
|
293
299
|
|
294
|
-
<li class="never" data-hits="" data-linenumber="
|
300
|
+
<li class="never" data-hits="" data-linenumber="19">
|
295
301
|
|
296
302
|
|
297
303
|
<code class="ruby"> end</code>
|
298
304
|
</li>
|
299
305
|
|
300
|
-
<li class="never" data-hits="" data-linenumber="
|
306
|
+
<li class="never" data-hits="" data-linenumber="20">
|
301
307
|
|
302
308
|
|
303
309
|
<code class="ruby"></code>
|
304
310
|
</li>
|
305
311
|
|
306
|
-
<li class="covered" data-hits="1" data-linenumber="
|
312
|
+
<li class="covered" data-hits="1" data-linenumber="21">
|
307
313
|
<span class="hits">1</span>
|
308
314
|
|
309
315
|
<code class="ruby"> def production</code>
|
310
316
|
</li>
|
311
317
|
|
312
|
-
<li class="covered" data-hits="1" data-linenumber="
|
318
|
+
<li class="covered" data-hits="1" data-linenumber="22">
|
313
319
|
<span class="hits">1</span>
|
314
320
|
|
315
321
|
<code class="ruby"> client = new</code>
|
316
322
|
</li>
|
317
323
|
|
318
|
-
<li class="covered" data-hits="1" data-linenumber="
|
324
|
+
<li class="covered" data-hits="1" data-linenumber="23">
|
319
325
|
<span class="hits">1</span>
|
320
326
|
|
321
327
|
<code class="ruby"> client.verification_url = ITUNES_PRODUCTION_RECEIPT_VERIFICATION_ENDPOINT</code>
|
322
328
|
</li>
|
323
329
|
|
324
|
-
<li class="covered" data-hits="1" data-linenumber="
|
330
|
+
<li class="covered" data-hits="1" data-linenumber="24">
|
325
331
|
<span class="hits">1</span>
|
326
332
|
|
327
333
|
<code class="ruby"> client</code>
|
328
334
|
</li>
|
329
335
|
|
330
|
-
<li class="never" data-hits="" data-linenumber="
|
336
|
+
<li class="never" data-hits="" data-linenumber="25">
|
331
337
|
|
332
338
|
|
333
339
|
<code class="ruby"> end</code>
|
334
340
|
</li>
|
335
341
|
|
336
|
-
<li class="never" data-hits="" data-linenumber="
|
342
|
+
<li class="never" data-hits="" data-linenumber="26">
|
337
343
|
|
338
344
|
|
339
345
|
<code class="ruby"> end</code>
|
340
346
|
</li>
|
341
347
|
|
342
|
-
<li class="never" data-hits="" data-linenumber="
|
348
|
+
<li class="never" data-hits="" data-linenumber="27">
|
343
349
|
|
344
350
|
|
345
351
|
<code class="ruby"></code>
|
346
352
|
</li>
|
347
353
|
|
348
|
-
<li class="covered" data-hits="1" data-linenumber="
|
354
|
+
<li class="covered" data-hits="1" data-linenumber="28">
|
349
355
|
<span class="hits">1</span>
|
350
356
|
|
351
357
|
<code class="ruby"> def initialize</code>
|
352
358
|
</li>
|
353
359
|
|
354
|
-
<li class="covered" data-hits="
|
355
|
-
<span class="hits">
|
360
|
+
<li class="covered" data-hits="8" data-linenumber="29">
|
361
|
+
<span class="hits">8</span>
|
356
362
|
|
357
363
|
<code class="ruby"> @verification_url = ENV['IAP_VERIFICATION_ENDPOINT']</code>
|
358
364
|
</li>
|
359
365
|
|
360
|
-
<li class="never" data-hits="" data-linenumber="
|
366
|
+
<li class="never" data-hits="" data-linenumber="30">
|
361
367
|
|
362
368
|
|
363
369
|
<code class="ruby"> end</code>
|
364
370
|
</li>
|
365
371
|
|
366
|
-
<li class="never" data-hits="" data-linenumber="
|
372
|
+
<li class="never" data-hits="" data-linenumber="31">
|
367
373
|
|
368
374
|
|
369
375
|
<code class="ruby"></code>
|
370
376
|
</li>
|
371
377
|
|
372
|
-
<li class="covered" data-hits="1" data-linenumber="
|
378
|
+
<li class="covered" data-hits="1" data-linenumber="32">
|
373
379
|
<span class="hits">1</span>
|
374
380
|
|
375
381
|
<code class="ruby"> def verify!(data, options = {})</code>
|
376
382
|
</li>
|
377
383
|
|
378
|
-
<li class="covered" data-hits="
|
379
|
-
<span class="hits">
|
384
|
+
<li class="covered" data-hits="8" data-linenumber="33">
|
385
|
+
<span class="hits">8</span>
|
380
386
|
|
381
387
|
<code class="ruby"> @verification_url ||= ITUNES_DEVELOPMENT_RECEIPT_VERIFICATION_ENDPOINT</code>
|
382
388
|
</li>
|
383
389
|
|
384
|
-
<li class="covered" data-hits="
|
385
|
-
<span class="hits">
|
390
|
+
<li class="covered" data-hits="8" data-linenumber="34">
|
391
|
+
<span class="hits">8</span>
|
386
392
|
|
387
393
|
<code class="ruby"> @shared_secret = options[:shared_secret] if options[:shared_secret]</code>
|
388
394
|
</li>
|
389
395
|
|
390
|
-
<li class="
|
391
|
-
|
396
|
+
<li class="covered" data-hits="8" data-linenumber="35">
|
397
|
+
<span class="hits">8</span>
|
392
398
|
|
393
|
-
<code class="ruby"
|
399
|
+
<code class="ruby"> @exclude_old_transactions = options[:exclude_old_transactions] if options[:exclude_old_transactions]</code>
|
394
400
|
</li>
|
395
401
|
|
396
|
-
<li class="
|
397
|
-
<span class="hits">6</span>
|
402
|
+
<li class="never" data-hits="" data-linenumber="36">
|
398
403
|
|
399
|
-
|
404
|
+
|
405
|
+
<code class="ruby"></code>
|
400
406
|
</li>
|
401
407
|
|
402
|
-
<li class="covered" data-hits="
|
403
|
-
<span class="hits">
|
408
|
+
<li class="covered" data-hits="8" data-linenumber="37">
|
409
|
+
<span class="hits">8</span>
|
404
410
|
|
405
|
-
<code class="ruby">
|
411
|
+
<code class="ruby"> json = json_response_from_verifying_data(data, options)</code>
|
406
412
|
</li>
|
407
413
|
|
408
|
-
<li class="covered" data-hits="
|
409
|
-
<span class="hits">
|
414
|
+
<li class="covered" data-hits="8" data-linenumber="38">
|
415
|
+
<span class="hits">8</span>
|
410
416
|
|
411
|
-
<code class="ruby"> receipt_attributes = json['receipt'].dup</code>
|
417
|
+
<code class="ruby"> receipt_attributes = json['receipt'].dup if json['receipt']</code>
|
412
418
|
</li>
|
413
419
|
|
414
|
-
<li class="covered" data-hits="
|
415
|
-
<span class="hits">
|
420
|
+
<li class="covered" data-hits="8" data-linenumber="39">
|
421
|
+
<span class="hits">8</span>
|
416
422
|
|
417
423
|
<code class="ruby"> receipt_attributes['original_json_response'] = json if receipt_attributes</code>
|
418
424
|
</li>
|
419
425
|
|
420
|
-
<li class="never" data-hits="" data-linenumber="
|
426
|
+
<li class="never" data-hits="" data-linenumber="40">
|
421
427
|
|
422
428
|
|
423
429
|
<code class="ruby"></code>
|
424
430
|
</li>
|
425
431
|
|
426
|
-
<li class="covered" data-hits="
|
427
|
-
<span class="hits">
|
432
|
+
<li class="covered" data-hits="8" data-linenumber="41">
|
433
|
+
<span class="hits">8</span>
|
428
434
|
|
429
|
-
<code class="ruby"> case status</code>
|
435
|
+
<code class="ruby"> case json['status'].to_i</code>
|
430
436
|
</li>
|
431
437
|
|
432
|
-
<li class="never" data-hits="" data-linenumber="
|
438
|
+
<li class="never" data-hits="" data-linenumber="42">
|
433
439
|
|
434
440
|
|
435
441
|
<code class="ruby"> when 0, 21006</code>
|
436
442
|
</li>
|
437
443
|
|
438
|
-
<li class="covered" data-hits="6" data-linenumber="
|
444
|
+
<li class="covered" data-hits="6" data-linenumber="43">
|
439
445
|
<span class="hits">6</span>
|
440
446
|
|
441
447
|
<code class="ruby"> receipt = Receipt.new(receipt_attributes)</code>
|
442
448
|
</li>
|
443
449
|
|
444
|
-
<li class="never" data-hits="" data-linenumber="
|
450
|
+
<li class="never" data-hits="" data-linenumber="44">
|
445
451
|
|
446
452
|
|
447
453
|
<code class="ruby"></code>
|
448
454
|
</li>
|
449
455
|
|
450
|
-
<li class="never" data-hits="" data-linenumber="
|
456
|
+
<li class="never" data-hits="" data-linenumber="45">
|
451
457
|
|
452
458
|
|
453
459
|
<code class="ruby"> # From Apple docs:</code>
|
454
460
|
</li>
|
455
461
|
|
456
|
-
<li class="never" data-hits="" data-linenumber="
|
462
|
+
<li class="never" data-hits="" data-linenumber="46">
|
457
463
|
|
458
464
|
|
459
465
|
<code class="ruby"> # > Only returned for iOS 6 style transaction receipts for auto-renewable subscriptions.</code>
|
460
466
|
</li>
|
461
467
|
|
462
|
-
<li class="never" data-hits="" data-linenumber="
|
468
|
+
<li class="never" data-hits="" data-linenumber="47">
|
463
469
|
|
464
470
|
|
465
471
|
<code class="ruby"> # > The JSON representation of the receipt for the most recent renewal</code>
|
466
472
|
</li>
|
467
473
|
|
468
|
-
<li class="covered" data-hits="6" data-linenumber="
|
474
|
+
<li class="covered" data-hits="6" data-linenumber="48">
|
469
475
|
<span class="hits">6</span>
|
470
476
|
|
471
477
|
<code class="ruby"> if latest_receipt_info_attributes = json['latest_receipt_info']</code>
|
472
478
|
</li>
|
473
479
|
|
474
|
-
<li class="never" data-hits="" data-linenumber="
|
480
|
+
<li class="never" data-hits="" data-linenumber="49">
|
475
481
|
|
476
482
|
|
477
483
|
<code class="ruby"> # AppStore returns 'latest_receipt_info' even if we use over iOS 6. Besides, its format is an Array.</code>
|
478
484
|
</li>
|
479
485
|
|
480
|
-
<li class="covered" data-hits="1" data-linenumber="
|
486
|
+
<li class="covered" data-hits="1" data-linenumber="50">
|
481
487
|
<span class="hits">1</span>
|
482
488
|
|
483
489
|
<code class="ruby"> receipt.latest_receipt_info = []</code>
|
484
490
|
</li>
|
485
491
|
|
486
|
-
<li class="covered" data-hits="1" data-linenumber="
|
492
|
+
<li class="covered" data-hits="1" data-linenumber="51">
|
487
493
|
<span class="hits">1</span>
|
488
494
|
|
489
495
|
<code class="ruby"> latest_receipt_info_attributes.each do |latest_receipt_info_attribute|</code>
|
490
496
|
</li>
|
491
497
|
|
492
|
-
<li class="never" data-hits="" data-linenumber="
|
498
|
+
<li class="never" data-hits="" data-linenumber="52">
|
493
499
|
|
494
500
|
|
495
501
|
<code class="ruby"> # latest_receipt_info format is identical with in_app</code>
|
496
502
|
</li>
|
497
503
|
|
498
|
-
<li class="covered" data-hits="1" data-linenumber="
|
504
|
+
<li class="covered" data-hits="1" data-linenumber="53">
|
499
505
|
<span class="hits">1</span>
|
500
506
|
|
501
507
|
<code class="ruby"> receipt.latest_receipt_info << InAppReceipt.new(latest_receipt_info_attribute)</code>
|
502
508
|
</li>
|
503
509
|
|
504
|
-
<li class="never" data-hits="" data-linenumber="
|
510
|
+
<li class="never" data-hits="" data-linenumber="54">
|
505
511
|
|
506
512
|
|
507
513
|
<code class="ruby"> end</code>
|
508
514
|
</li>
|
509
515
|
|
510
|
-
<li class="never" data-hits="" data-linenumber="
|
516
|
+
<li class="never" data-hits="" data-linenumber="55">
|
511
517
|
|
512
518
|
|
513
519
|
<code class="ruby"> end</code>
|
514
520
|
</li>
|
515
521
|
|
516
|
-
<li class="never" data-hits="" data-linenumber="
|
522
|
+
<li class="never" data-hits="" data-linenumber="56">
|
517
523
|
|
518
524
|
|
519
525
|
<code class="ruby"></code>
|
520
526
|
</li>
|
521
527
|
|
522
|
-
<li class="covered" data-hits="6" data-linenumber="
|
528
|
+
<li class="covered" data-hits="6" data-linenumber="57">
|
523
529
|
<span class="hits">6</span>
|
524
530
|
|
525
531
|
<code class="ruby"> return receipt</code>
|
526
532
|
</li>
|
527
533
|
|
528
|
-
<li class="never" data-hits="" data-linenumber="
|
534
|
+
<li class="never" data-hits="" data-linenumber="58">
|
529
535
|
|
530
536
|
|
531
537
|
<code class="ruby"> else</code>
|
532
538
|
</li>
|
533
539
|
|
534
|
-
<li class="
|
535
|
-
|
540
|
+
<li class="covered" data-hits="2" data-linenumber="59">
|
541
|
+
<span class="hits">2</span>
|
536
542
|
|
537
|
-
<code class="ruby"> raise Receipt::VerificationError
|
543
|
+
<code class="ruby"> raise Receipt::VerificationError, json</code>
|
538
544
|
</li>
|
539
545
|
|
540
|
-
<li class="never" data-hits="" data-linenumber="
|
546
|
+
<li class="never" data-hits="" data-linenumber="60">
|
541
547
|
|
542
548
|
|
543
549
|
<code class="ruby"> end</code>
|
544
550
|
</li>
|
545
551
|
|
546
|
-
<li class="never" data-hits="" data-linenumber="
|
552
|
+
<li class="never" data-hits="" data-linenumber="61">
|
547
553
|
|
548
554
|
|
549
555
|
<code class="ruby"> end</code>
|
550
556
|
</li>
|
551
557
|
|
552
|
-
<li class="never" data-hits="" data-linenumber="
|
558
|
+
<li class="never" data-hits="" data-linenumber="62">
|
553
559
|
|
554
560
|
|
555
561
|
<code class="ruby"></code>
|
556
562
|
</li>
|
557
563
|
|
558
|
-
<li class="covered" data-hits="1" data-linenumber="
|
564
|
+
<li class="covered" data-hits="1" data-linenumber="63">
|
559
565
|
<span class="hits">1</span>
|
560
566
|
|
561
567
|
<code class="ruby"> private</code>
|
562
568
|
</li>
|
563
569
|
|
564
|
-
<li class="never" data-hits="" data-linenumber="
|
570
|
+
<li class="never" data-hits="" data-linenumber="64">
|
565
571
|
|
566
572
|
|
567
573
|
<code class="ruby"></code>
|
568
574
|
</li>
|
569
575
|
|
570
|
-
<li class="covered" data-hits="1" data-linenumber="
|
576
|
+
<li class="covered" data-hits="1" data-linenumber="65">
|
571
577
|
<span class="hits">1</span>
|
572
578
|
|
573
|
-
<code class="ruby"> def json_response_from_verifying_data(data)</code>
|
579
|
+
<code class="ruby"> def json_response_from_verifying_data(data, options = {})</code>
|
574
580
|
</li>
|
575
581
|
|
576
|
-
<li class="covered" data-hits="3" data-linenumber="
|
582
|
+
<li class="covered" data-hits="3" data-linenumber="66">
|
577
583
|
<span class="hits">3</span>
|
578
584
|
|
579
585
|
<code class="ruby"> parameters = {</code>
|
580
586
|
</li>
|
581
587
|
|
582
|
-
<li class="never" data-hits="" data-linenumber="
|
588
|
+
<li class="never" data-hits="" data-linenumber="67">
|
583
589
|
|
584
590
|
|
585
591
|
<code class="ruby"> 'receipt-data' => data</code>
|
586
592
|
</li>
|
587
593
|
|
588
|
-
<li class="never" data-hits="" data-linenumber="
|
594
|
+
<li class="never" data-hits="" data-linenumber="68">
|
589
595
|
|
590
596
|
|
591
597
|
<code class="ruby"> }</code>
|
592
598
|
</li>
|
593
599
|
|
594
|
-
<li class="never" data-hits="" data-linenumber="
|
600
|
+
<li class="never" data-hits="" data-linenumber="69">
|
595
601
|
|
596
602
|
|
597
603
|
<code class="ruby"></code>
|
598
604
|
</li>
|
599
605
|
|
600
|
-
<li class="covered" data-hits="3" data-linenumber="
|
606
|
+
<li class="covered" data-hits="3" data-linenumber="70">
|
601
607
|
<span class="hits">3</span>
|
602
608
|
|
603
609
|
<code class="ruby"> parameters['password'] = @shared_secret if @shared_secret</code>
|
604
610
|
</li>
|
605
611
|
|
606
|
-
<li class="
|
612
|
+
<li class="covered" data-hits="3" data-linenumber="71">
|
613
|
+
<span class="hits">3</span>
|
614
|
+
|
615
|
+
<code class="ruby"> parameters['exclude-old-transactions'] = @exclude_old_transactions if @exclude_old_transactions</code>
|
616
|
+
</li>
|
617
|
+
|
618
|
+
<li class="never" data-hits="" data-linenumber="72">
|
607
619
|
|
608
620
|
|
609
621
|
<code class="ruby"></code>
|
610
622
|
</li>
|
611
623
|
|
612
|
-
<li class="covered" data-hits="3" data-linenumber="
|
624
|
+
<li class="covered" data-hits="3" data-linenumber="73">
|
613
625
|
<span class="hits">3</span>
|
614
626
|
|
615
627
|
<code class="ruby"> uri = URI(@verification_url)</code>
|
616
628
|
</li>
|
617
629
|
|
618
|
-
<li class="covered" data-hits="3" data-linenumber="
|
630
|
+
<li class="covered" data-hits="3" data-linenumber="74">
|
619
631
|
<span class="hits">3</span>
|
620
632
|
|
621
633
|
<code class="ruby"> http = Net::HTTP.new(uri.host, uri.port)</code>
|
622
634
|
</li>
|
623
635
|
|
624
|
-
<li class="covered" data-hits="3" data-linenumber="
|
636
|
+
<li class="covered" data-hits="3" data-linenumber="75">
|
625
637
|
<span class="hits">3</span>
|
626
638
|
|
627
639
|
<code class="ruby"> http.use_ssl = true</code>
|
628
640
|
</li>
|
629
641
|
|
630
|
-
<li class="covered" data-hits="3" data-linenumber="
|
642
|
+
<li class="covered" data-hits="3" data-linenumber="76">
|
631
643
|
<span class="hits">3</span>
|
632
644
|
|
633
645
|
<code class="ruby"> http.verify_mode = OpenSSL::SSL::VERIFY_PEER</code>
|
634
646
|
</li>
|
635
647
|
|
636
|
-
<li class="never" data-hits="" data-linenumber="
|
648
|
+
<li class="never" data-hits="" data-linenumber="77">
|
637
649
|
|
638
650
|
|
639
651
|
<code class="ruby"></code>
|
640
652
|
</li>
|
641
653
|
|
642
|
-
<li class="covered" data-hits="3" data-linenumber="
|
654
|
+
<li class="covered" data-hits="3" data-linenumber="78">
|
655
|
+
<span class="hits">3</span>
|
656
|
+
|
657
|
+
<code class="ruby"> http.open_timeout = options[:open_timeout] if options[:open_timeout]</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"> http.read_timeout = options[:read_timeout] if options[:read_timeout]</code>
|
664
|
+
</li>
|
665
|
+
|
666
|
+
<li class="never" data-hits="" data-linenumber="80">
|
667
|
+
|
668
|
+
|
669
|
+
<code class="ruby"></code>
|
670
|
+
</li>
|
671
|
+
|
672
|
+
<li class="covered" data-hits="3" data-linenumber="81">
|
643
673
|
<span class="hits">3</span>
|
644
674
|
|
645
675
|
<code class="ruby"> request = Net::HTTP::Post.new(uri.request_uri)</code>
|
646
676
|
</li>
|
647
677
|
|
648
|
-
<li class="covered" data-hits="3" data-linenumber="
|
678
|
+
<li class="covered" data-hits="3" data-linenumber="82">
|
649
679
|
<span class="hits">3</span>
|
650
680
|
|
651
681
|
<code class="ruby"> request['Accept'] = 'application/json'</code>
|
652
682
|
</li>
|
653
683
|
|
654
|
-
<li class="covered" data-hits="3" data-linenumber="
|
684
|
+
<li class="covered" data-hits="3" data-linenumber="83">
|
655
685
|
<span class="hits">3</span>
|
656
686
|
|
657
687
|
<code class="ruby"> request['Content-Type'] = 'application/json'</code>
|
658
688
|
</li>
|
659
689
|
|
660
|
-
<li class="covered" data-hits="3" data-linenumber="
|
690
|
+
<li class="covered" data-hits="3" data-linenumber="84">
|
661
691
|
<span class="hits">3</span>
|
662
692
|
|
663
693
|
<code class="ruby"> request.body = parameters.to_json</code>
|
664
694
|
</li>
|
665
695
|
|
666
|
-
<li class="never" data-hits="" data-linenumber="
|
696
|
+
<li class="never" data-hits="" data-linenumber="85">
|
667
697
|
|
668
698
|
|
669
699
|
<code class="ruby"></code>
|
670
700
|
</li>
|
671
701
|
|
672
|
-
<li class="covered" data-hits="3" data-linenumber="
|
702
|
+
<li class="covered" data-hits="3" data-linenumber="86">
|
673
703
|
<span class="hits">3</span>
|
674
704
|
|
675
|
-
<code class="ruby">
|
705
|
+
<code class="ruby"> begin</code>
|
676
706
|
</li>
|
677
707
|
|
678
|
-
<li class="
|
708
|
+
<li class="covered" data-hits="3" data-linenumber="87">
|
709
|
+
<span class="hits">3</span>
|
710
|
+
|
711
|
+
<code class="ruby"> response = http.request(request)</code>
|
712
|
+
</li>
|
713
|
+
|
714
|
+
<li class="never" data-hits="" data-linenumber="88">
|
715
|
+
|
716
|
+
|
717
|
+
<code class="ruby"> rescue Timeout::Error</code>
|
718
|
+
</li>
|
719
|
+
|
720
|
+
<li class="missed" data-hits="0" data-linenumber="89">
|
721
|
+
|
722
|
+
|
723
|
+
<code class="ruby"> raise TimeoutError</code>
|
724
|
+
</li>
|
725
|
+
|
726
|
+
<li class="never" data-hits="" data-linenumber="90">
|
727
|
+
|
728
|
+
|
729
|
+
<code class="ruby"> end</code>
|
730
|
+
</li>
|
731
|
+
|
732
|
+
<li class="never" data-hits="" data-linenumber="91">
|
679
733
|
|
680
734
|
|
681
735
|
<code class="ruby"></code>
|
682
736
|
</li>
|
683
737
|
|
684
|
-
<li class="covered" data-hits="3" data-linenumber="
|
738
|
+
<li class="covered" data-hits="3" data-linenumber="92">
|
685
739
|
<span class="hits">3</span>
|
686
740
|
|
687
741
|
<code class="ruby"> JSON.parse(response.body)</code>
|
688
742
|
</li>
|
689
743
|
|
690
|
-
<li class="never" data-hits="" data-linenumber="
|
744
|
+
<li class="never" data-hits="" data-linenumber="93">
|
691
745
|
|
692
746
|
|
693
747
|
<code class="ruby"> end</code>
|
694
748
|
</li>
|
695
749
|
|
696
|
-
<li class="never" data-hits="" data-linenumber="
|
750
|
+
<li class="never" data-hits="" data-linenumber="94">
|
697
751
|
|
698
752
|
|
699
753
|
<code class="ruby"> end</code>
|
700
754
|
</li>
|
701
755
|
|
702
|
-
<li class="never" data-hits="" data-linenumber="
|
756
|
+
<li class="never" data-hits="" data-linenumber="95">
|
757
|
+
|
758
|
+
|
759
|
+
<code class="ruby"></code>
|
760
|
+
</li>
|
761
|
+
|
762
|
+
<li class="covered" data-hits="1" data-linenumber="96">
|
763
|
+
<span class="hits">1</span>
|
764
|
+
|
765
|
+
<code class="ruby"> class Client::TimeoutError < Timeout::Error</code>
|
766
|
+
</li>
|
767
|
+
|
768
|
+
<li class="covered" data-hits="1" data-linenumber="97">
|
769
|
+
<span class="hits">1</span>
|
770
|
+
|
771
|
+
<code class="ruby"> def message</code>
|
772
|
+
</li>
|
773
|
+
|
774
|
+
<li class="missed" data-hits="0" data-linenumber="98">
|
775
|
+
|
776
|
+
|
777
|
+
<code class="ruby"> 'The App Store timed out.'</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">
|
703
793
|
|
704
794
|
|
705
795
|
<code class="ruby">end</code>
|
@@ -1669,11 +1759,11 @@
|
|
1669
1759
|
<div class="source_table" id="10dfdb14e321a7bb364075307e5a80a2a62317af">
|
1670
1760
|
<div class="header">
|
1671
1761
|
<h3>lib/venice/receipt.rb</h3>
|
1672
|
-
<h4><span class="red">
|
1762
|
+
<h4><span class="red">74.7 %</span> covered</h4>
|
1673
1763
|
<div>
|
1674
|
-
<b>
|
1675
|
-
<span class="green"><b>
|
1676
|
-
<span class="red"><b>
|
1764
|
+
<b>83</b> relevant lines.
|
1765
|
+
<span class="green"><b>62</b> lines covered</span> and
|
1766
|
+
<span class="red"><b>21</b> lines missed.</span>
|
1677
1767
|
</div>
|
1678
1768
|
</div>
|
1679
1769
|
|
@@ -2259,382 +2349,430 @@
|
|
2259
2349
|
<li class="covered" data-hits="1" data-linenumber="97">
|
2260
2350
|
<span class="hits">1</span>
|
2261
2351
|
|
2262
|
-
<code class="ruby"> verify!(data, options)
|
2352
|
+
<code class="ruby"> verify!(data, options)</code>
|
2263
2353
|
</li>
|
2264
2354
|
|
2265
2355
|
<li class="never" data-hits="" data-linenumber="98">
|
2266
2356
|
|
2267
2357
|
|
2358
|
+
<code class="ruby"> rescue VerificationError, Client::TimeoutError</code>
|
2359
|
+
</li>
|
2360
|
+
|
2361
|
+
<li class="missed" data-hits="0" data-linenumber="99">
|
2362
|
+
|
2363
|
+
|
2364
|
+
<code class="ruby"> false</code>
|
2365
|
+
</li>
|
2366
|
+
|
2367
|
+
<li class="never" data-hits="" data-linenumber="100">
|
2368
|
+
|
2369
|
+
|
2268
2370
|
<code class="ruby"> end</code>
|
2269
2371
|
</li>
|
2270
2372
|
|
2271
|
-
<li class="never" data-hits="" data-linenumber="
|
2373
|
+
<li class="never" data-hits="" data-linenumber="101">
|
2272
2374
|
|
2273
2375
|
|
2274
2376
|
<code class="ruby"></code>
|
2275
2377
|
</li>
|
2276
2378
|
|
2277
|
-
<li class="covered" data-hits="1" data-linenumber="
|
2379
|
+
<li class="covered" data-hits="1" data-linenumber="102">
|
2278
2380
|
<span class="hits">1</span>
|
2279
2381
|
|
2280
2382
|
<code class="ruby"> def verify!(data, options = {})</code>
|
2281
2383
|
</li>
|
2282
2384
|
|
2283
|
-
<li class="covered" data-hits="1" data-linenumber="
|
2385
|
+
<li class="covered" data-hits="1" data-linenumber="103">
|
2284
2386
|
<span class="hits">1</span>
|
2285
2387
|
|
2286
2388
|
<code class="ruby"> client = Client.production</code>
|
2287
2389
|
</li>
|
2288
2390
|
|
2289
|
-
<li class="never" data-hits="" data-linenumber="
|
2391
|
+
<li class="never" data-hits="" data-linenumber="104">
|
2290
2392
|
|
2291
2393
|
|
2292
2394
|
<code class="ruby"></code>
|
2293
2395
|
</li>
|
2294
2396
|
|
2295
|
-
<li class="covered" data-hits="1" data-linenumber="
|
2397
|
+
<li class="covered" data-hits="1" data-linenumber="105">
|
2296
2398
|
<span class="hits">1</span>
|
2297
2399
|
|
2298
2400
|
<code class="ruby"> begin</code>
|
2299
2401
|
</li>
|
2300
2402
|
|
2301
|
-
<li class="covered" data-hits="1" data-linenumber="
|
2403
|
+
<li class="covered" data-hits="1" data-linenumber="106">
|
2302
2404
|
<span class="hits">1</span>
|
2303
2405
|
|
2304
2406
|
<code class="ruby"> client.verify!(data, options)</code>
|
2305
2407
|
</li>
|
2306
2408
|
|
2307
|
-
<li class="missed" data-hits="0" data-linenumber="
|
2409
|
+
<li class="missed" data-hits="0" data-linenumber="107">
|
2308
2410
|
|
2309
2411
|
|
2310
2412
|
<code class="ruby"> rescue VerificationError => error</code>
|
2311
2413
|
</li>
|
2312
2414
|
|
2313
|
-
<li class="missed" data-hits="0" data-linenumber="
|
2415
|
+
<li class="missed" data-hits="0" data-linenumber="108">
|
2314
2416
|
|
2315
2417
|
|
2316
2418
|
<code class="ruby"> case error.code</code>
|
2317
2419
|
</li>
|
2318
2420
|
|
2319
|
-
<li class="never" data-hits="" data-linenumber="
|
2421
|
+
<li class="never" data-hits="" data-linenumber="109">
|
2320
2422
|
|
2321
2423
|
|
2322
2424
|
<code class="ruby"> when 21007</code>
|
2323
2425
|
</li>
|
2324
2426
|
|
2325
|
-
<li class="missed" data-hits="0" data-linenumber="
|
2427
|
+
<li class="missed" data-hits="0" data-linenumber="110">
|
2326
2428
|
|
2327
2429
|
|
2328
2430
|
<code class="ruby"> client = Client.development</code>
|
2329
2431
|
</li>
|
2330
2432
|
|
2331
|
-
<li class="missed" data-hits="0" data-linenumber="
|
2433
|
+
<li class="missed" data-hits="0" data-linenumber="111">
|
2332
2434
|
|
2333
2435
|
|
2334
2436
|
<code class="ruby"> retry</code>
|
2335
2437
|
</li>
|
2336
2438
|
|
2337
|
-
<li class="never" data-hits="" data-linenumber="
|
2439
|
+
<li class="never" data-hits="" data-linenumber="112">
|
2338
2440
|
|
2339
2441
|
|
2340
2442
|
<code class="ruby"> when 21008</code>
|
2341
2443
|
</li>
|
2342
2444
|
|
2343
|
-
<li class="missed" data-hits="0" data-linenumber="
|
2445
|
+
<li class="missed" data-hits="0" data-linenumber="113">
|
2344
2446
|
|
2345
2447
|
|
2346
2448
|
<code class="ruby"> client = Client.production</code>
|
2347
2449
|
</li>
|
2348
2450
|
|
2349
|
-
<li class="missed" data-hits="0" data-linenumber="
|
2451
|
+
<li class="missed" data-hits="0" data-linenumber="114">
|
2350
2452
|
|
2351
2453
|
|
2352
2454
|
<code class="ruby"> retry</code>
|
2353
2455
|
</li>
|
2354
2456
|
|
2355
|
-
<li class="never" data-hits="" data-linenumber="
|
2457
|
+
<li class="never" data-hits="" data-linenumber="115">
|
2356
2458
|
|
2357
2459
|
|
2358
2460
|
<code class="ruby"> else</code>
|
2359
2461
|
</li>
|
2360
2462
|
|
2361
|
-
<li class="missed" data-hits="0" data-linenumber="
|
2463
|
+
<li class="missed" data-hits="0" data-linenumber="116">
|
2362
2464
|
|
2363
2465
|
|
2364
2466
|
<code class="ruby"> raise error</code>
|
2365
2467
|
</li>
|
2366
2468
|
|
2367
|
-
<li class="never" data-hits="" data-linenumber="
|
2469
|
+
<li class="never" data-hits="" data-linenumber="117">
|
2368
2470
|
|
2369
2471
|
|
2370
2472
|
<code class="ruby"> end</code>
|
2371
2473
|
</li>
|
2372
2474
|
|
2373
|
-
<li class="never" data-hits="" data-linenumber="
|
2475
|
+
<li class="never" data-hits="" data-linenumber="118">
|
2374
2476
|
|
2375
2477
|
|
2376
2478
|
<code class="ruby"> end</code>
|
2377
2479
|
</li>
|
2378
2480
|
|
2379
|
-
<li class="never" data-hits="" data-linenumber="
|
2481
|
+
<li class="never" data-hits="" data-linenumber="119">
|
2380
2482
|
|
2381
2483
|
|
2382
2484
|
<code class="ruby"> end</code>
|
2383
2485
|
</li>
|
2384
2486
|
|
2385
|
-
<li class="never" data-hits="" data-linenumber="
|
2487
|
+
<li class="never" data-hits="" data-linenumber="120">
|
2386
2488
|
|
2387
2489
|
|
2388
2490
|
<code class="ruby"></code>
|
2389
2491
|
</li>
|
2390
2492
|
|
2391
|
-
<li class="covered" data-hits="1" data-linenumber="
|
2493
|
+
<li class="covered" data-hits="1" data-linenumber="121">
|
2392
2494
|
<span class="hits">1</span>
|
2393
2495
|
|
2394
2496
|
<code class="ruby"> alias :validate :verify</code>
|
2395
2497
|
</li>
|
2396
2498
|
|
2397
|
-
<li class="covered" data-hits="1" data-linenumber="
|
2499
|
+
<li class="covered" data-hits="1" data-linenumber="122">
|
2398
2500
|
<span class="hits">1</span>
|
2399
2501
|
|
2400
2502
|
<code class="ruby"> alias :validate! :verify!</code>
|
2401
2503
|
</li>
|
2402
2504
|
|
2403
|
-
<li class="never" data-hits="" data-linenumber="
|
2505
|
+
<li class="never" data-hits="" data-linenumber="123">
|
2404
2506
|
|
2405
2507
|
|
2406
2508
|
<code class="ruby"> end</code>
|
2407
2509
|
</li>
|
2408
2510
|
|
2409
|
-
<li class="never" data-hits="" data-linenumber="
|
2511
|
+
<li class="never" data-hits="" data-linenumber="124">
|
2410
2512
|
|
2411
2513
|
|
2412
2514
|
<code class="ruby"></code>
|
2413
2515
|
</li>
|
2414
2516
|
|
2415
|
-
<li class="covered" data-hits="1" data-linenumber="
|
2517
|
+
<li class="covered" data-hits="1" data-linenumber="125">
|
2416
2518
|
<span class="hits">1</span>
|
2417
2519
|
|
2418
2520
|
<code class="ruby"> class VerificationError < StandardError</code>
|
2419
2521
|
</li>
|
2420
2522
|
|
2421
|
-
<li class="covered" data-hits="1" data-linenumber="
|
2523
|
+
<li class="covered" data-hits="1" data-linenumber="126">
|
2422
2524
|
<span class="hits">1</span>
|
2423
2525
|
|
2424
|
-
<code class="ruby"> attr_accessor :
|
2526
|
+
<code class="ruby"> attr_accessor :json</code>
|
2425
2527
|
</li>
|
2426
2528
|
|
2427
|
-
<li class="
|
2529
|
+
<li class="never" data-hits="" data-linenumber="127">
|
2530
|
+
|
2531
|
+
|
2532
|
+
<code class="ruby"></code>
|
2533
|
+
</li>
|
2534
|
+
|
2535
|
+
<li class="covered" data-hits="1" data-linenumber="128">
|
2428
2536
|
<span class="hits">1</span>
|
2429
2537
|
|
2430
|
-
<code class="ruby">
|
2538
|
+
<code class="ruby"> def initialize(json)</code>
|
2431
2539
|
</li>
|
2432
2540
|
|
2433
|
-
<li class="
|
2541
|
+
<li class="covered" data-hits="2" data-linenumber="129">
|
2542
|
+
<span class="hits">2</span>
|
2543
|
+
|
2544
|
+
<code class="ruby"> @json = json</code>
|
2545
|
+
</li>
|
2546
|
+
|
2547
|
+
<li class="never" data-hits="" data-linenumber="130">
|
2548
|
+
|
2549
|
+
|
2550
|
+
<code class="ruby"> end</code>
|
2551
|
+
</li>
|
2552
|
+
|
2553
|
+
<li class="never" data-hits="" data-linenumber="131">
|
2434
2554
|
|
2435
2555
|
|
2436
2556
|
<code class="ruby"></code>
|
2437
2557
|
</li>
|
2438
2558
|
|
2439
|
-
<li class="covered" data-hits="1" data-linenumber="
|
2559
|
+
<li class="covered" data-hits="1" data-linenumber="132">
|
2560
|
+
<span class="hits">1</span>
|
2561
|
+
|
2562
|
+
<code class="ruby"> def code</code>
|
2563
|
+
</li>
|
2564
|
+
|
2565
|
+
<li class="covered" data-hits="1" data-linenumber="133">
|
2440
2566
|
<span class="hits">1</span>
|
2441
2567
|
|
2442
|
-
<code class="ruby">
|
2568
|
+
<code class="ruby"> Integer(json['status'])</code>
|
2443
2569
|
</li>
|
2444
2570
|
|
2445
|
-
<li class="
|
2571
|
+
<li class="never" data-hits="" data-linenumber="134">
|
2446
2572
|
|
2447
2573
|
|
2448
|
-
<code class="ruby">
|
2574
|
+
<code class="ruby"> end</code>
|
2449
2575
|
</li>
|
2450
2576
|
|
2451
|
-
<li class="
|
2577
|
+
<li class="never" data-hits="" data-linenumber="135">
|
2452
2578
|
|
2453
2579
|
|
2454
|
-
<code class="ruby"
|
2580
|
+
<code class="ruby"></code>
|
2455
2581
|
</li>
|
2456
2582
|
|
2457
|
-
<li class="
|
2583
|
+
<li class="covered" data-hits="1" data-linenumber="136">
|
2584
|
+
<span class="hits">1</span>
|
2585
|
+
|
2586
|
+
<code class="ruby"> def retryable?</code>
|
2587
|
+
</li>
|
2588
|
+
|
2589
|
+
<li class="covered" data-hits="2" data-linenumber="137">
|
2590
|
+
<span class="hits">2</span>
|
2591
|
+
|
2592
|
+
<code class="ruby"> json['is-retryable']</code>
|
2593
|
+
</li>
|
2594
|
+
|
2595
|
+
<li class="never" data-hits="" data-linenumber="138">
|
2458
2596
|
|
2459
2597
|
|
2460
2598
|
<code class="ruby"> end</code>
|
2461
2599
|
</li>
|
2462
2600
|
|
2463
|
-
<li class="never" data-hits="" data-linenumber="
|
2601
|
+
<li class="never" data-hits="" data-linenumber="139">
|
2464
2602
|
|
2465
2603
|
|
2466
2604
|
<code class="ruby"></code>
|
2467
2605
|
</li>
|
2468
2606
|
|
2469
|
-
<li class="covered" data-hits="1" data-linenumber="
|
2607
|
+
<li class="covered" data-hits="1" data-linenumber="140">
|
2470
2608
|
<span class="hits">1</span>
|
2471
2609
|
|
2472
2610
|
<code class="ruby"> def message</code>
|
2473
2611
|
</li>
|
2474
2612
|
|
2475
|
-
<li class="missed" data-hits="0" data-linenumber="
|
2613
|
+
<li class="missed" data-hits="0" data-linenumber="141">
|
2476
2614
|
|
2477
2615
|
|
2478
|
-
<code class="ruby"> case
|
2616
|
+
<code class="ruby"> case code</code>
|
2479
2617
|
</li>
|
2480
2618
|
|
2481
|
-
<li class="never" data-hits="" data-linenumber="
|
2619
|
+
<li class="never" data-hits="" data-linenumber="142">
|
2482
2620
|
|
2483
2621
|
|
2484
2622
|
<code class="ruby"> when 21000</code>
|
2485
2623
|
</li>
|
2486
2624
|
|
2487
|
-
<li class="missed" data-hits="0" data-linenumber="
|
2625
|
+
<li class="missed" data-hits="0" data-linenumber="143">
|
2488
2626
|
|
2489
2627
|
|
2490
2628
|
<code class="ruby"> 'The App Store could not read the JSON object you provided.'</code>
|
2491
2629
|
</li>
|
2492
2630
|
|
2493
|
-
<li class="never" data-hits="" data-linenumber="
|
2631
|
+
<li class="never" data-hits="" data-linenumber="144">
|
2494
2632
|
|
2495
2633
|
|
2496
2634
|
<code class="ruby"> when 21002</code>
|
2497
2635
|
</li>
|
2498
2636
|
|
2499
|
-
<li class="missed" data-hits="0" data-linenumber="
|
2637
|
+
<li class="missed" data-hits="0" data-linenumber="145">
|
2500
2638
|
|
2501
2639
|
|
2502
2640
|
<code class="ruby"> 'The data in the receipt-data property was malformed.'</code>
|
2503
2641
|
</li>
|
2504
2642
|
|
2505
|
-
<li class="never" data-hits="" data-linenumber="
|
2643
|
+
<li class="never" data-hits="" data-linenumber="146">
|
2506
2644
|
|
2507
2645
|
|
2508
2646
|
<code class="ruby"> when 21003</code>
|
2509
2647
|
</li>
|
2510
2648
|
|
2511
|
-
<li class="missed" data-hits="0" data-linenumber="
|
2649
|
+
<li class="missed" data-hits="0" data-linenumber="147">
|
2512
2650
|
|
2513
2651
|
|
2514
2652
|
<code class="ruby"> 'The receipt could not be authenticated.'</code>
|
2515
2653
|
</li>
|
2516
2654
|
|
2517
|
-
<li class="never" data-hits="" data-linenumber="
|
2655
|
+
<li class="never" data-hits="" data-linenumber="148">
|
2518
2656
|
|
2519
2657
|
|
2520
2658
|
<code class="ruby"> when 21004</code>
|
2521
2659
|
</li>
|
2522
2660
|
|
2523
|
-
<li class="missed" data-hits="0" data-linenumber="
|
2661
|
+
<li class="missed" data-hits="0" data-linenumber="149">
|
2524
2662
|
|
2525
2663
|
|
2526
2664
|
<code class="ruby"> 'The shared secret you provided does not match the shared secret on file for your account.'</code>
|
2527
2665
|
</li>
|
2528
2666
|
|
2529
|
-
<li class="never" data-hits="" data-linenumber="
|
2667
|
+
<li class="never" data-hits="" data-linenumber="150">
|
2530
2668
|
|
2531
2669
|
|
2532
2670
|
<code class="ruby"> when 21005</code>
|
2533
2671
|
</li>
|
2534
2672
|
|
2535
|
-
<li class="missed" data-hits="0" data-linenumber="
|
2673
|
+
<li class="missed" data-hits="0" data-linenumber="151">
|
2536
2674
|
|
2537
2675
|
|
2538
2676
|
<code class="ruby"> 'The receipt server is not currently available.'</code>
|
2539
2677
|
</li>
|
2540
2678
|
|
2541
|
-
<li class="never" data-hits="" data-linenumber="
|
2679
|
+
<li class="never" data-hits="" data-linenumber="152">
|
2542
2680
|
|
2543
2681
|
|
2544
2682
|
<code class="ruby"> when 21006</code>
|
2545
2683
|
</li>
|
2546
2684
|
|
2547
|
-
<li class="missed" data-hits="0" data-linenumber="
|
2685
|
+
<li class="missed" data-hits="0" data-linenumber="153">
|
2548
2686
|
|
2549
2687
|
|
2550
2688
|
<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>
|
2551
2689
|
</li>
|
2552
2690
|
|
2553
|
-
<li class="never" data-hits="" data-linenumber="
|
2691
|
+
<li class="never" data-hits="" data-linenumber="154">
|
2554
2692
|
|
2555
2693
|
|
2556
2694
|
<code class="ruby"> when 21007</code>
|
2557
2695
|
</li>
|
2558
2696
|
|
2559
|
-
<li class="missed" data-hits="0" data-linenumber="
|
2697
|
+
<li class="missed" data-hits="0" data-linenumber="155">
|
2560
2698
|
|
2561
2699
|
|
2562
2700
|
<code class="ruby"> 'This receipt is a sandbox receipt, but it was sent to the production service for verification.'</code>
|
2563
2701
|
</li>
|
2564
2702
|
|
2565
|
-
<li class="never" data-hits="" data-linenumber="
|
2703
|
+
<li class="never" data-hits="" data-linenumber="156">
|
2566
2704
|
|
2567
2705
|
|
2568
2706
|
<code class="ruby"> when 21008</code>
|
2569
2707
|
</li>
|
2570
2708
|
|
2571
|
-
<li class="missed" data-hits="0" data-linenumber="
|
2709
|
+
<li class="missed" data-hits="0" data-linenumber="157">
|
2572
2710
|
|
2573
2711
|
|
2574
2712
|
<code class="ruby"> 'This receipt is a production receipt, but it was sent to the sandbox service for verification.'</code>
|
2575
2713
|
</li>
|
2576
2714
|
|
2577
|
-
<li class="never" data-hits="" data-linenumber="
|
2715
|
+
<li class="never" data-hits="" data-linenumber="158">
|
2578
2716
|
|
2579
2717
|
|
2580
2718
|
<code class="ruby"> when 21010</code>
|
2581
2719
|
</li>
|
2582
2720
|
|
2583
|
-
<li class="missed" data-hits="0" data-linenumber="
|
2721
|
+
<li class="missed" data-hits="0" data-linenumber="159">
|
2584
2722
|
|
2585
2723
|
|
2586
2724
|
<code class="ruby"> 'This receipt could not be authorized. Treat this the same as if a purchase was never made.'</code>
|
2587
2725
|
</li>
|
2588
2726
|
|
2589
|
-
<li class="never" data-hits="" data-linenumber="
|
2727
|
+
<li class="never" data-hits="" data-linenumber="160">
|
2590
2728
|
|
2591
2729
|
|
2592
2730
|
<code class="ruby"> when 21100..21199</code>
|
2593
2731
|
</li>
|
2594
2732
|
|
2595
|
-
<li class="missed" data-hits="0" data-linenumber="
|
2733
|
+
<li class="missed" data-hits="0" data-linenumber="161">
|
2596
2734
|
|
2597
2735
|
|
2598
2736
|
<code class="ruby"> 'Internal data access error.'</code>
|
2599
2737
|
</li>
|
2600
2738
|
|
2601
|
-
<li class="never" data-hits="" data-linenumber="
|
2739
|
+
<li class="never" data-hits="" data-linenumber="162">
|
2602
2740
|
|
2603
2741
|
|
2604
2742
|
<code class="ruby"> else</code>
|
2605
2743
|
</li>
|
2606
2744
|
|
2607
|
-
<li class="missed" data-hits="0" data-linenumber="
|
2745
|
+
<li class="missed" data-hits="0" data-linenumber="163">
|
2608
2746
|
|
2609
2747
|
|
2610
|
-
<code class="ruby"> "Unknown Error: #{
|
2748
|
+
<code class="ruby"> "Unknown Error: #{code}"</code>
|
2611
2749
|
</li>
|
2612
2750
|
|
2613
|
-
<li class="never" data-hits="" data-linenumber="
|
2751
|
+
<li class="never" data-hits="" data-linenumber="164">
|
2614
2752
|
|
2615
2753
|
|
2616
2754
|
<code class="ruby"> end</code>
|
2617
2755
|
</li>
|
2618
2756
|
|
2619
|
-
<li class="never" data-hits="" data-linenumber="
|
2757
|
+
<li class="never" data-hits="" data-linenumber="165">
|
2620
2758
|
|
2621
2759
|
|
2622
2760
|
<code class="ruby"> end</code>
|
2623
2761
|
</li>
|
2624
2762
|
|
2625
|
-
<li class="never" data-hits="" data-linenumber="
|
2763
|
+
<li class="never" data-hits="" data-linenumber="166">
|
2626
2764
|
|
2627
2765
|
|
2628
2766
|
<code class="ruby"> end</code>
|
2629
2767
|
</li>
|
2630
2768
|
|
2631
|
-
<li class="never" data-hits="" data-linenumber="
|
2769
|
+
<li class="never" data-hits="" data-linenumber="167">
|
2632
2770
|
|
2633
2771
|
|
2634
2772
|
<code class="ruby"> end</code>
|
2635
2773
|
</li>
|
2636
2774
|
|
2637
|
-
<li class="never" data-hits="" data-linenumber="
|
2775
|
+
<li class="never" data-hits="" data-linenumber="168">
|
2638
2776
|
|
2639
2777
|
|
2640
2778
|
<code class="ruby">end</code>
|