File tree 3 files changed +29
-0
lines changed
3 files changed +29
-0
lines changed Original file line number Diff line number Diff line change 10
10
use Imdhemy \Purchases \Events \AppStore \InteractiveRenewal ;
11
11
use Imdhemy \Purchases \Events \AppStore \PriceIncreaseConsent ;
12
12
use Imdhemy \Purchases \Events \AppStore \Refund ;
13
+ use Imdhemy \Purchases \Events \AppStore \Revoke ;
13
14
use Imdhemy \Purchases \Events \GooglePlay \SubscriptionCanceled ;
14
15
use Imdhemy \Purchases \Events \GooglePlay \SubscriptionDeferred ;
15
16
use Imdhemy \Purchases \Events \GooglePlay \SubscriptionExpired ;
66
67
InteractiveRenewal::class => [],
67
68
PriceIncreaseConsent::class => [],
68
69
Refund::class => [],
70
+ Revoke::class => [],
69
71
],
70
72
];
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+
4
+ namespace Imdhemy \Purchases \Events \AppStore ;
5
+
6
+ use Imdhemy \Purchases \Events \PurchaseEvent ;
7
+
8
+ class Revoke extends PurchaseEvent
9
+ {
10
+ }
Original file line number Diff line number Diff line change 5
5
use Imdhemy \AppStore \ServerNotifications \ServerNotification ;
6
6
use Imdhemy \Purchases \Contracts \PurchaseEventContract ;
7
7
use Imdhemy \Purchases \Events \AppStore \EventFactory ;
8
+ use Imdhemy \Purchases \Events \AppStore \Revoke ;
8
9
use Imdhemy \Purchases \ServerNotifications \AppStoreServerNotification ;
9
10
use PHPUnit \Framework \TestCase ;
10
11
@@ -22,4 +23,20 @@ public function test_create()
22
23
$ appStoreServerNotification = new AppStoreServerNotification ($ serverNotification );
23
24
$ this ->assertInstanceOf (PurchaseEventContract::class, EventFactory::create ($ appStoreServerNotification ));
24
25
}
26
+
27
+ /**
28
+ * @test
29
+ */
30
+ public function test_it_creates_revoke_event ()
31
+ {
32
+ $ path = realpath (__DIR__ . '/../../appstore-server-notification.json ' );
33
+ $ serverNotificationBody = json_decode (file_get_contents ($ path ), true );
34
+ $ serverNotificationBody ['notification_type ' ] = ServerNotification::REVOKE ;
35
+
36
+ $ serverNotification = ServerNotification::fromArray ($ serverNotificationBody );
37
+ $ appStoreServerNotification = new AppStoreServerNotification ($ serverNotification );
38
+
39
+ $ this ->assertInstanceOf (PurchaseEventContract::class, EventFactory::create ($ appStoreServerNotification ));
40
+ $ this ->assertInstanceOf (Revoke::class, EventFactory::create ($ appStoreServerNotification ));
41
+ }
25
42
}
You can’t perform that action at this time.
0 commit comments