@@ -7,6 +7,7 @@ import Foundation
7
7
case accessRevoked(resource: INPItemRevokedModel)
8
8
case externalPaymentSuccess(resource: INPPaymentSuccessModel)
9
9
case externalPaymentFailed(resource: INPExternalPaymentFailedModel)
10
+ case externalSubscribeCancelSuccess(resource: INPPaymentSuccessModel)
10
11
case accountLogout
11
12
case accountErased
12
13
case accountDeactivated
@@ -18,6 +19,7 @@ public enum NotificationType {
18
19
case accessRevoked( resource: InPlayerItemRevoked )
19
20
case externalPaymentSuccess( resource: InPlayerPaymentSuccess )
20
21
case externalPaymentFailed( resource: InPlayerExternalPaymentFailed )
22
+ case externalSubscribeCancelSuccess( resource: InPlayerPaymentSuccess )
21
23
case accountLogout
22
24
case accountErased
23
25
case accountDeactivated
@@ -40,6 +42,7 @@ public struct InPlayerNotification: Codable {
40
42
static let accessRevoked = " access.revoked "
41
43
static let externalPaymentSuccess = " external.payment.success "
42
44
static let externalPaymentFailed = " external.payment.failed "
45
+ static let externalSubscribeCancelSuccess = " external.subscribe.cancel.success "
43
46
static let accountLogout = " account.logout "
44
47
static let accountErased = " account.erased "
45
48
static let accountDeactivated = " account.deactivated "
@@ -65,6 +68,9 @@ public struct InPlayerNotification: Codable {
65
68
case NotificationTypeStrings . externalPaymentFailed:
66
69
let resource = try values. decode ( InPlayerExternalPaymentFailed . self, forKey: . resource)
67
70
type = . externalPaymentFailed( resource: resource)
71
+ case NotificationTypeStrings . externalSubscribeCancelSuccess:
72
+ let resource = try values. decode ( InPlayerPaymentSuccess . self, forKey: . resource)
73
+ type = . externalSubscribeCancelSuccess( resource: resource)
68
74
case NotificationTypeStrings . accountLogout:
69
75
type = . accountLogout
70
76
case NotificationTypeStrings . accountErased:
@@ -93,6 +99,9 @@ public struct InPlayerNotification: Codable {
93
99
case . externalPaymentFailed( let resource) :
94
100
try values. encode ( resource, forKey: . resource)
95
101
try values. encode ( NotificationTypeStrings . externalPaymentFailed, forKey: . typeString)
102
+ case . externalSubscribeCancelSuccess( let resource) :
103
+ try values. encode ( resource, forKey: . resource)
104
+ try values. encode ( NotificationTypeStrings . externalSubscribeCancelSuccess, forKey: . typeString)
96
105
case . accountLogout:
97
106
try values. encode ( NotificationTypeStrings . accountLogout, forKey: . typeString)
98
107
case . accountErased:
0 commit comments