Browse Source
Merge pull request #1 from app-vise/analysis-z4nakn
Apply fixes from StyleCI
proxy_request
Daan Geurts
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with
6 additions and
13 deletions
-
src/model/AppleNotification.php
-
src/model/Receipt.php
-
src/model/RenewalInfo.php
-
tests/IntegrationTest.php
-
tests/TestCase.php
-
tests/__fixtures__/request.php
|
@ -8,12 +8,11 @@ class AppleNotification extends Model |
|
|
{ |
|
|
{ |
|
|
public $guarded = []; |
|
|
public $guarded = []; |
|
|
|
|
|
|
|
|
public static function storeNotification(String $notificationType, NotificationPayload $notificationPayload) |
|
|
public static function storeNotification(string $notificationType, NotificationPayload $notificationPayload) |
|
|
{ |
|
|
{ |
|
|
return self::create([ |
|
|
return self::create([ |
|
|
'type' => $notificationType, |
|
|
'type' => $notificationType, |
|
|
'payload' => serialize($notificationPayload), |
|
|
'payload' => serialize($notificationPayload), |
|
|
]); |
|
|
]); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
@ -2,8 +2,6 @@ |
|
|
|
|
|
|
|
|
namespace Appvise\AppStoreNotifications\Model; |
|
|
namespace Appvise\AppStoreNotifications\Model; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Receipt |
|
|
class Receipt |
|
|
{ |
|
|
{ |
|
|
private $originalTransactionId; |
|
|
private $originalTransactionId; |
|
@ -37,7 +35,6 @@ class Receipt |
|
|
|
|
|
|
|
|
public function __construct() |
|
|
public function __construct() |
|
|
{ |
|
|
{ |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public static function createFromArray(array $receiptInfo) |
|
|
public static function createFromArray(array $receiptInfo) |
|
@ -75,7 +72,6 @@ class Receipt |
|
|
return $instance; |
|
|
return $instance; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* Get the value of bid. |
|
|
* Get the value of bid. |
|
|
*/ |
|
|
*/ |
|
|
|
@ -2,7 +2,6 @@ |
|
|
|
|
|
|
|
|
namespace Appvise\AppStoreNotifications\Model; |
|
|
namespace Appvise\AppStoreNotifications\Model; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class RenewalInfo |
|
|
class RenewalInfo |
|
|
{ |
|
|
{ |
|
|
private $autoRenewProductId; |
|
|
private $autoRenewProductId; |
|
@ -16,7 +15,6 @@ class RenewalInfo |
|
|
private $gracePeriodExpiresDateMs; |
|
|
private $gracePeriodExpiresDateMs; |
|
|
private $gracePeriodExpiresDatePst; |
|
|
private $gracePeriodExpiresDatePst; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function __construct() |
|
|
public function __construct() |
|
|
{ |
|
|
{ |
|
|
} |
|
|
} |
|
@ -33,8 +31,10 @@ class RenewalInfo |
|
|
$instance->priceConsentStatus = $pendingRenewalInfo['price_consent_status'] ?? null; |
|
|
$instance->priceConsentStatus = $pendingRenewalInfo['price_consent_status'] ?? null; |
|
|
$instance->gracePeriodExpiresDate = $pendingRenewalInfo['grace_period_expires_date'] ?? null; |
|
|
$instance->gracePeriodExpiresDate = $pendingRenewalInfo['grace_period_expires_date'] ?? null; |
|
|
$instance->gracePeriodExpiresDatePst = $pendingRenewalInfo['grace_period_expires_date_pst'] ?? null; |
|
|
$instance->gracePeriodExpiresDatePst = $pendingRenewalInfo['grace_period_expires_date_pst'] ?? null; |
|
|
|
|
|
|
|
|
return $instance; |
|
|
return $instance; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* Get the value of autoRenewProductId. |
|
|
* Get the value of autoRenewProductId. |
|
|
*/ |
|
|
*/ |
|
|
|
@ -73,5 +73,4 @@ class IntegrationTest extends TestCase |
|
|
|
|
|
|
|
|
Queue::assertNotPushed(DummyJob::class); |
|
|
Queue::assertNotPushed(DummyJob::class); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
@ -2,12 +2,12 @@ |
|
|
|
|
|
|
|
|
namespace Appvise\AppStoreNotifications\Tests; |
|
|
namespace Appvise\AppStoreNotifications\Tests; |
|
|
|
|
|
|
|
|
use Appvise\AppStoreNotifications\NotificationsServiceProvider; |
|
|
|
|
|
use Exception; |
|
|
use Exception; |
|
|
|
|
|
use CreateAppleNotificationsTable; |
|
|
use Illuminate\Foundation\Exceptions\Handler; |
|
|
use Illuminate\Foundation\Exceptions\Handler; |
|
|
use Illuminate\Contracts\Debug\ExceptionHandler; |
|
|
use Illuminate\Contracts\Debug\ExceptionHandler; |
|
|
use Orchestra\Testbench\TestCase as OrchestraTestCase; |
|
|
use Orchestra\Testbench\TestCase as OrchestraTestCase; |
|
|
use CreateAppleNotificationsTable; |
|
|
use Appvise\AppStoreNotifications\NotificationsServiceProvider; |
|
|
|
|
|
|
|
|
abstract class TestCase extends OrchestraTestCase |
|
|
abstract class TestCase extends OrchestraTestCase |
|
|
{ |
|
|
{ |
|
@ -71,5 +71,4 @@ abstract class TestCase extends OrchestraTestCase |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
@ -1,4 +1,5 @@ |
|
|
<?php |
|
|
<?php |
|
|
|
|
|
|
|
|
return json_decode('{ |
|
|
return json_decode('{ |
|
|
"environment": "Sandbox", |
|
|
"environment": "Sandbox", |
|
|
"notification_type": "INITIAL_BUY", |
|
|
"notification_type": "INITIAL_BUY", |
|
@ -62,7 +63,6 @@ return json_decode('{ |
|
|
}', true |
|
|
}', true |
|
|
); |
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//{ |
|
|
//{ |
|
|
// "environment": "Sandbox", |
|
|
// "environment": "Sandbox", |
|
|
// "notification_type": "INITIAL_BUY", |
|
|
// "notification_type": "INITIAL_BUY", |
|
|