Skip to content

Commit

Permalink
[Obol] Fix isLive
Browse files Browse the repository at this point in the history
Automatic commit for getparthenon/monorepo@c94ce2c
  • Loading branch information
that-guy-iain committed Dec 2, 2024
1 parent e413a7c commit 323a658
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Provider/Stripe/Provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
use Obol\VoucherServiceInterface;
use Obol\WebhookServiceInterface;
use Psr\Log\LoggerAwareTrait;
use Stripe\Balance;
use Stripe\StripeClient;

class Provider implements ProviderInterface
Expand Down Expand Up @@ -218,9 +219,9 @@ public function vouchers(): VoucherServiceInterface
public function isLive(): bool
{
\Stripe\Stripe::setApiKey($this->config->getApiKey());
$account = \Stripe\Account::retrieve();
$balance = Balance::retrieve();

// Check if the API key is live mode or test mode
return $account->livemode;
return $balance->livemode ?? false;
}
}

0 comments on commit 323a658

Please sign in to comment.