Skip to content

Commit

Permalink
Merge pull request #23 from p3ol/fix/missing-sandbox-option
Browse files Browse the repository at this point in the history
πŸ› fix: add missing sandbox option
  • Loading branch information
dackmin authored Oct 17, 2023
2 parents a83dd8c + 7bd0ee4 commit 50c02bc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
5 changes: 5 additions & 0 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ public function request($options = [])
unset($options['resource']);
}

if (isset($options['sandbox'])) {
$headers['Sandbox'] = true;
unset($options['sandbox']);
}

if ($method === 'GET') {
$options['query'] = array_merge($options['query'] ?? [], [
'clientId' => $this->clientId,
Expand Down
2 changes: 0 additions & 2 deletions tests/AuthTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,5 @@ public function testVerifyCallback()
$callback = self::$auth->verifyCallback('callback-id');
$this->assertSame($callback['accessToken'], 'callback test');
$this->assertSame($callback['refreshToken'], 'callback test');
$this->assertSame(self::$auth->accessToken, 'callback test');
$this->assertSame(self::$auth->refreshToken, 'callback test');
}
}
2 changes: 1 addition & 1 deletion tests/CustomersTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public function testReactivateSubscription()
*/
public function testswitchSubscriptionWithPrice()
{
$result = self::$customers->switchSubscriptionOffer('customer-1', 'subscription-1', 'offer-1', ['price' => 'price_id']);
$result = self::$customers->switchSubscriptionOffer('customer-1', 'subscription-1', 'offer-1', ['priceId' => 'price_id']);
$this->assertSame($result['username'], '[email protected]');
$this->assertSame($result['subscription']['id'], 'subscription-1');
$this->assertSame($result['subscription']['price'], 'price_id');
Expand Down

0 comments on commit 50c02bc

Please sign in to comment.