feat: add bylaw management features including documents, legal authorities, subject categories, and nodes
This commit is contained in:
@@ -18,8 +18,7 @@ class AppMarketPurchaseVerifier
|
||||
'CAFEBAZAAR-PISHKHAN-API-SECRET' => config('services.app_markets.bazaar_secret'),
|
||||
])->get($url);
|
||||
|
||||
|
||||
if (!$response->successful()) {
|
||||
if (! $response->successful()) {
|
||||
Log::error('Failed to verify Bazaar subscription', [
|
||||
'status' => $response->status(),
|
||||
'body' => $response->body(),
|
||||
@@ -30,7 +29,7 @@ class AppMarketPurchaseVerifier
|
||||
|
||||
$validUntil = $response->json('validUntilTimestampMsec');
|
||||
|
||||
if (!$validUntil || $validUntil < now()->timestamp * 1000) {
|
||||
if (! $validUntil || $validUntil < now()->timestamp * 1000) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -39,13 +38,13 @@ class AppMarketPurchaseVerifier
|
||||
|
||||
public function refreshBazaarSubscriber(UserSubscriber $subscriber): bool
|
||||
{
|
||||
if (!$subscriber->subscription_id || !$subscriber->purchase_token) {
|
||||
if (! $subscriber->subscription_id || ! $subscriber->purchase_token) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$expiredAt = $this->verifyBazaarSubscription($subscriber->subscription_id, $subscriber->purchase_token);
|
||||
|
||||
if (!$expiredAt) {
|
||||
if (! $expiredAt) {
|
||||
$subscriber->update(['expired_at' => now()]);
|
||||
|
||||
return false;
|
||||
@@ -70,7 +69,7 @@ class AppMarketPurchaseVerifier
|
||||
'tokenId' => $token,
|
||||
]);
|
||||
|
||||
if (!$response->successful()) {
|
||||
if (! $response->successful()) {
|
||||
Log::error('Failed to verify Myket purchase', [
|
||||
'status' => $response->status(),
|
||||
'body' => $response->body(),
|
||||
@@ -93,13 +92,13 @@ class AppMarketPurchaseVerifier
|
||||
|
||||
public function refreshMyketSubscriber(UserSubscriber $subscriber): bool
|
||||
{
|
||||
if (!$subscriber->product_id || !$subscriber->purchase_token || !$subscriber->subscribe) {
|
||||
if (! $subscriber->product_id || ! $subscriber->purchase_token || ! $subscriber->subscribe) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$purchase = $this->verifyMyketProduct($subscriber->product_id, $subscriber->purchase_token);
|
||||
|
||||
if (!$purchase) {
|
||||
if (! $purchase) {
|
||||
$subscriber->update(['expired_at' => now()]);
|
||||
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user