Skip to content

Commit

Permalink
DS-5017-v3 add a setter for production just in case
Browse files Browse the repository at this point in the history
  • Loading branch information
jmuto2 committed Apr 3, 2023
1 parent 66fe41a commit 6c9983c
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/Traits/HasEnvironmentsTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,21 @@
trait HasEnvironmentsTrait
{
private string $baseUrl = 'https://redeem.yourdigitalreward.com';
private bool $isProduction = false;

public function isProduction(): bool
{
return $this->isProduction;
}

public function setIsProduction(bool $isProduction): void
{
$this->isProduction = $isProduction;
}

public function getBaseUrl(): string
{
return getenv('ENVIRONMENT') === 'PRODUCTION'
return getenv('ENVIRONMENT') === 'PRODUCTION' || $this->isProduction()
? $this->baseUrl . '/api'
: $this->baseUrl . '/api/sandbox';
}
Expand Down

0 comments on commit 6c9983c

Please sign in to comment.