Skip to content

Commit 78cea46

Browse files
authored
Merge pull request #51 from inplayer-org/develop
Merge develop into master
2 parents c202dcf + 75c9434 commit 78cea46

File tree

143 files changed

+377
-141
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

143 files changed

+377
-141
lines changed

InPlayerSDK.podspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Pod::Spec.new do |s|
1616
#
1717

1818
s.name = "InPlayerSDK"
19-
s.version = "1.5.5"
19+
s.version = "1.5.7"
2020
s.summary = "InPlayer's iOS API client wrapper."
2121

2222
# This description is used to generate tags and improve search results.

Source/Payment/API/INPPaymentService.swift

+19-2
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,19 @@ class INPPaymentService {
3636
route: PaymentAPIRouter.validatePayment(parameters: params),
3737
completion: completion)
3838
}
39+
40+
static func validateByProductName(productName: String,
41+
receipt: String,
42+
completion: @escaping RequestCompletion<Empty>) {
43+
let params: [String: Any] = [
44+
PaymentParameters.receipt: receipt,
45+
PaymentParameters.productName: productName
46+
]
47+
NetworkDataSource.performRequest(session: InPlayerSessionAPIManager.default.session,
48+
route: PaymentAPIRouter.validatePaymentByProductName(parameters: params),
49+
completion: completion)
50+
51+
}
3952

4053
static func getPurchaseHistory(status: PurchaseHistory,
4154
page: Int,
@@ -64,11 +77,12 @@ class INPPaymentService {
6477
private enum PaymentAPIRouter: INPAPIConfiguration {
6578

6679
case validatePayment(parameters: [String: Any])
80+
case validatePaymentByProductName(parameters: [String: Any])
6781
case getPurchaseHistory(parameters: [String: Any])
6882

6983
var method: HTTPMethod {
7084
switch self {
71-
case .validatePayment:
85+
case .validatePayment, .validatePaymentByProductName:
7286
return .post
7387
case .getPurchaseHistory:
7488
return .get
@@ -77,7 +91,7 @@ private enum PaymentAPIRouter: INPAPIConfiguration {
7791

7892
var path: String {
7993
switch self {
80-
case .validatePayment:
94+
case .validatePayment, .validatePaymentByProductName:
8195
return NetworkConstants.Endpoints.Payment.validate
8296
case .getPurchaseHistory:
8397
return NetworkConstants.Endpoints.Payment.purchaseHistory
@@ -88,6 +102,8 @@ private enum PaymentAPIRouter: INPAPIConfiguration {
88102
switch self {
89103
case .validatePayment(let parameters):
90104
return parameters
105+
case .validatePaymentByProductName(let parameters):
106+
return parameters
91107
case .getPurchaseHistory(let parameters):
92108
return parameters
93109
}
@@ -118,4 +134,5 @@ private struct PaymentParameters {
118134
static let limit = "size"
119135
static let type = "type"
120136
static let customerId = "customerID"
137+
static let productName = "product_name"
121138
}

Source/Payment/Payment.swift

+25
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,31 @@ public extension InPlayer {
3131
}
3232
})
3333
}
34+
35+
/**
36+
Contact InPlayer server and validate if purchase was successfull.
37+
- Parameters:
38+
- productName: Purchased product name
39+
- receipt: Base64EncodedString of the recept data stored on device after successfull in-app purchase.
40+
- success: A closure to be executed once the request has finished successfully.
41+
- failure: A closure to be executed once the request has finished with error.
42+
- error: Containing information about the error that occurred.
43+
*/
44+
45+
public static func validateByProductName(productName: String,
46+
receipt: String,
47+
success: @escaping () -> Void,
48+
failure: @escaping (_ error: InPlayerError) -> Void) {
49+
INPPaymentService.validateByProductName(productName: productName,
50+
receipt: receipt,
51+
completion: { (_, error) in
52+
if let error = error {
53+
failure(error)
54+
} else {
55+
success()
56+
}
57+
})
58+
}
3459

3560
/**
3661
Gets the purchase history

docs/Classes.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ <h4>Declaration</h4>
378378
</section>
379379
</section>
380380
<section id="footer">
381-
<p>&copy; 2019 <a class="link" href="https://inplayer.com/" target="_blank" rel="external">InPlayer</a>. All rights reserved. (Last updated: 2019-12-20)</p>
381+
<p>&copy; 2020 <a class="link" href="https://inplayer.com/" target="_blank" rel="external">InPlayer</a>. All rights reserved. (Last updated: 2020-01-04)</p>
382382
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.12.0</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
383383
</section>
384384
</article>

docs/Classes/InPlayer.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ <h4>Declaration</h4>
503503
</section>
504504
</section>
505505
<section id="footer">
506-
<p>&copy; 2019 <a class="link" href="https://inplayer.com/" target="_blank" rel="external">InPlayer</a>. All rights reserved. (Last updated: 2019-12-20)</p>
506+
<p>&copy; 2020 <a class="link" href="https://inplayer.com/" target="_blank" rel="external">InPlayer</a>. All rights reserved. (Last updated: 2020-01-04)</p>
507507
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.12.0</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
508508
</section>
509509
</article>

docs/Classes/InPlayer/Account.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1944,7 +1944,7 @@ <h4>Parameters</h4>
19441944
</section>
19451945
</section>
19461946
<section id="footer">
1947-
<p>&copy; 2019 <a class="link" href="https://inplayer.com/" target="_blank" rel="external">InPlayer</a>. All rights reserved. (Last updated: 2019-12-20)</p>
1947+
<p>&copy; 2020 <a class="link" href="https://inplayer.com/" target="_blank" rel="external">InPlayer</a>. All rights reserved. (Last updated: 2020-01-04)</p>
19481948
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.12.0</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
19491949
</section>
19501950
</article>

docs/Classes/InPlayer/Asset.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -688,7 +688,7 @@ <h4>Parameters</h4>
688688
</section>
689689
</section>
690690
<section id="footer">
691-
<p>&copy; 2019 <a class="link" href="https://inplayer.com/" target="_blank" rel="external">InPlayer</a>. All rights reserved. (Last updated: 2019-12-20)</p>
691+
<p>&copy; 2020 <a class="link" href="https://inplayer.com/" target="_blank" rel="external">InPlayer</a>. All rights reserved. (Last updated: 2020-01-04)</p>
692692
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.12.0</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
693693
</section>
694694
</article>

docs/Classes/InPlayer/Configuration.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ <h4>Declaration</h4>
373373
</section>
374374
</section>
375375
<section id="footer">
376-
<p>&copy; 2019 <a class="link" href="https://inplayer.com/" target="_blank" rel="external">InPlayer</a>. All rights reserved. (Last updated: 2019-12-20)</p>
376+
<p>&copy; 2020 <a class="link" href="https://inplayer.com/" target="_blank" rel="external">InPlayer</a>. All rights reserved. (Last updated: 2020-01-04)</p>
377377
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.12.0</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
378378
</section>
379379
</article>

docs/Classes/InPlayer/Notification.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ <h4>Declaration</h4>
427427
</section>
428428
</section>
429429
<section id="footer">
430-
<p>&copy; 2019 <a class="link" href="https://inplayer.com/" target="_blank" rel="external">InPlayer</a>. All rights reserved. (Last updated: 2019-12-20)</p>
430+
<p>&copy; 2020 <a class="link" href="https://inplayer.com/" target="_blank" rel="external">InPlayer</a>. All rights reserved. (Last updated: 2020-01-04)</p>
431431
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.12.0</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
432432
</section>
433433
</article>

docs/Classes/InPlayer/Payment.html

+98-1
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,103 @@ <h4>Parameters</h4>
357357
</section>
358358
</div>
359359
</li>
360+
<li class="item">
361+
<div>
362+
<code>
363+
<a name="/s:11InPlayerSDK0aB0C7PaymentC21validateByProductName07productH07receipt7success7failureySS_SSyycyAA0aB5Error_pctFZ"></a>
364+
<a name="//apple_ref/swift/Method/validateByProductName(productName:receipt:success:failure:)" class="dashAnchor"></a>
365+
<a class="token" href="#/s:11InPlayerSDK0aB0C7PaymentC21validateByProductName07productH07receipt7success7failureySS_SSyycyAA0aB5Error_pctFZ">validateByProductName(productName:receipt:success:failure:)</a>
366+
</code>
367+
</div>
368+
<div class="height-container">
369+
<div class="pointer-container"></div>
370+
<section class="section">
371+
<div class="pointer"></div>
372+
<div class="abstract">
373+
<p>Contact InPlayer server and validate if purchase was successfull.</p>
374+
375+
</div>
376+
<div class="declaration">
377+
<h4>Declaration</h4>
378+
<div class="language">
379+
<p class="aside-title">Swift</p>
380+
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">static</span> <span class="kd">func</span> <span class="nf">validateByProductName</span><span class="p">(</span><span class="nv">productName</span><span class="p">:</span> <span class="kt">String</span><span class="p">,</span>
381+
<span class="nv">receipt</span><span class="p">:</span> <span class="kt">String</span><span class="p">,</span>
382+
<span class="nv">success</span><span class="p">:</span> <span class="kd">@escaping</span> <span class="p">()</span> <span class="o">-&gt;</span> <span class="kt">Void</span><span class="p">,</span>
383+
<span class="nv">failure</span><span class="p">:</span> <span class="kd">@escaping</span> <span class="p">(</span><span class="n">_</span> <span class="nv">error</span><span class="p">:</span> <span class="kt"><a href="../../Protocols/InPlayerError.html">InPlayerError</a></span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Void</span><span class="p">)</span></code></pre>
384+
385+
</div>
386+
</div>
387+
<div>
388+
<h4>Parameters</h4>
389+
<table class="graybox">
390+
<tbody>
391+
<tr>
392+
<td>
393+
<code>
394+
<em>productName</em>
395+
</code>
396+
</td>
397+
<td>
398+
<div>
399+
<p>Purchased product name</p>
400+
</div>
401+
</td>
402+
</tr>
403+
<tr>
404+
<td>
405+
<code>
406+
<em>receipt</em>
407+
</code>
408+
</td>
409+
<td>
410+
<div>
411+
<p>Base64EncodedString of the recept data stored on device after successfull in-app purchase.</p>
412+
</div>
413+
</td>
414+
</tr>
415+
<tr>
416+
<td>
417+
<code>
418+
<em>success</em>
419+
</code>
420+
</td>
421+
<td>
422+
<div>
423+
<p>A closure to be executed once the request has finished successfully.</p>
424+
</div>
425+
</td>
426+
</tr>
427+
<tr>
428+
<td>
429+
<code>
430+
<em>failure</em>
431+
</code>
432+
</td>
433+
<td>
434+
<div>
435+
<p>A closure to be executed once the request has finished with error.</p>
436+
</div>
437+
</td>
438+
</tr>
439+
<tr>
440+
<td>
441+
<code>
442+
<em>error</em>
443+
</code>
444+
</td>
445+
<td>
446+
<div>
447+
<p>Containing information about the error that occurred.</p>
448+
</div>
449+
</td>
450+
</tr>
451+
</tbody>
452+
</table>
453+
</div>
454+
</section>
455+
</div>
456+
</li>
360457
<li class="item">
361458
<div>
362459
<code>
@@ -510,7 +607,7 @@ <h4>Parameters</h4>
510607
</section>
511608
</section>
512609
<section id="footer">
513-
<p>&copy; 2019 <a class="link" href="https://inplayer.com/" target="_blank" rel="external">InPlayer</a>. All rights reserved. (Last updated: 2019-12-20)</p>
610+
<p>&copy; 2020 <a class="link" href="https://inplayer.com/" target="_blank" rel="external">InPlayer</a>. All rights reserved. (Last updated: 2020-01-04)</p>
514611
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.12.0</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
515612
</section>
516613
</article>

docs/Classes/InPlayer/Subscription.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ <h4>Parameters</h4>
374374
</section>
375375
</section>
376376
<section id="footer">
377-
<p>&copy; 2019 <a class="link" href="https://inplayer.com/" target="_blank" rel="external">InPlayer</a>. All rights reserved. (Last updated: 2019-12-20)</p>
377+
<p>&copy; 2020 <a class="link" href="https://inplayer.com/" target="_blank" rel="external">InPlayer</a>. All rights reserved. (Last updated: 2020-01-04)</p>
378378
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.12.0</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
379379
</section>
380380
</article>

docs/Classes/InPlayerNotificationAPIManager.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ <h4>Declaration</h4>
346346
</section>
347347
</section>
348348
<section id="footer">
349-
<p>&copy; 2019 <a class="link" href="https://inplayer.com/" target="_blank" rel="external">InPlayer</a>. All rights reserved. (Last updated: 2019-12-20)</p>
349+
<p>&copy; 2020 <a class="link" href="https://inplayer.com/" target="_blank" rel="external">InPlayer</a>. All rights reserved. (Last updated: 2020-01-04)</p>
350350
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.12.0</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
351351
</section>
352352
</article>

docs/Classes/InPlayerSessionAPIManager.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ <h4>Declaration</h4>
346346
</section>
347347
</section>
348348
<section id="footer">
349-
<p>&copy; 2019 <a class="link" href="https://inplayer.com/" target="_blank" rel="external">InPlayer</a>. All rights reserved. (Last updated: 2019-12-20)</p>
349+
<p>&copy; 2020 <a class="link" href="https://inplayer.com/" target="_blank" rel="external">InPlayer</a>. All rights reserved. (Last updated: 2020-01-04)</p>
350350
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.12.0</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
351351
</section>
352352
</article>

docs/Enums.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ <h4>Declaration</h4>
462462
</section>
463463
</section>
464464
<section id="footer">
465-
<p>&copy; 2019 <a class="link" href="https://inplayer.com/" target="_blank" rel="external">InPlayer</a>. All rights reserved. (Last updated: 2019-12-20)</p>
465+
<p>&copy; 2020 <a class="link" href="https://inplayer.com/" target="_blank" rel="external">InPlayer</a>. All rights reserved. (Last updated: 2020-01-04)</p>
466466
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.12.0</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
467467
</section>
468468
</article>

docs/Enums/AccountType.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ <h4>Declaration</h4>
319319
</section>
320320
</section>
321321
<section id="footer">
322-
<p>&copy; 2019 <a class="link" href="https://inplayer.com/" target="_blank" rel="external">InPlayer</a>. All rights reserved. (Last updated: 2019-12-20)</p>
322+
<p>&copy; 2020 <a class="link" href="https://inplayer.com/" target="_blank" rel="external">InPlayer</a>. All rights reserved. (Last updated: 2020-01-04)</p>
323323
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.12.0</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
324324
</section>
325325
</article>

docs/Enums/InPlayerEnvironmentType.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ <h4>Declaration</h4>
346346
</section>
347347
</section>
348348
<section id="footer">
349-
<p>&copy; 2019 <a class="link" href="https://inplayer.com/" target="_blank" rel="external">InPlayer</a>. All rights reserved. (Last updated: 2019-12-20)</p>
349+
<p>&copy; 2020 <a class="link" href="https://inplayer.com/" target="_blank" rel="external">InPlayer</a>. All rights reserved. (Last updated: 2020-01-04)</p>
350350
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.12.0</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
351351
</section>
352352
</article>

docs/Enums/InPlayerNotificationStatus.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ <h4>Declaration</h4>
454454
</section>
455455
</section>
456456
<section id="footer">
457-
<p>&copy; 2019 <a class="link" href="https://inplayer.com/" target="_blank" rel="external">InPlayer</a>. All rights reserved. (Last updated: 2019-12-20)</p>
457+
<p>&copy; 2020 <a class="link" href="https://inplayer.com/" target="_blank" rel="external">InPlayer</a>. All rights reserved. (Last updated: 2020-01-04)</p>
458458
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.12.0</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
459459
</section>
460460
</article>

0 commit comments

Comments
 (0)