Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.60.0"
".": "0.61.0"
}
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 234
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-dd0c83cac837fbe98857fa997663b0d0469344a7564bd4fe506e6c71d1d6af73.yml
openapi_spec_hash: 2352f37602105b164533038199b21804
config_hash: 890ca5fa6b8209d4eaac90550c7dc62c
config_hash: b7ec7f54fa76c1f8bde7a548710a1d38
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 0.61.0 (2026-03-08)

Full Changelog: [v0.60.0...v0.61.0](https://github.com/Increase/increase-php/compare/v0.60.0...v0.61.0)

### Features

* **api:** api update ([0fca601](https://github.com/Increase/increase-php/commit/0fca60181f7b0bc6cdb05923fc0fb818c43932c4))

## 0.60.0 (2026-03-06)

Full Changelog: [v0.59.0...v0.60.0](https://github.com/Increase/increase-php/compare/v0.59.0...v0.60.0)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ The REST API documentation can be found on [increase.com](https://increase.com/d
<!-- x-release-please-start-version -->

```
composer require "increase/increase 0.60.0"
composer require "increase/increase 0.61.0"
```

<!-- x-release-please-end -->
Expand Down
2 changes: 1 addition & 1 deletion src/Services/EventsService.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public function unwrap(

try {
$flatHeaders = array_map(fn (string|array $v): string => is_array($v) ? $v[0] : $v, $headers);
$webhook = new Webhook($secret);
$webhook = new Webhook('whsec_'.base64_encode($secret));
$webhook->verify($body, $flatHeaders);
} catch (WebhookVerificationException $e) {
throw new WebhookException('Could not verify webhook event signature', previous: $e);
Expand Down
2 changes: 1 addition & 1 deletion src/Version.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
namespace Increase;

// x-release-please-start-version
const VERSION = '0.60.0';
const VERSION = '0.61.0';
// x-release-please-end
13 changes: 9 additions & 4 deletions tests/Services/EventsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ public function testUnwrapWithVerification(): void
{
$payload = '{"id":"event_001dzz0r20rzr4zrhrr1364hy80","associated_object_id":"account_in71c4amph0vgo2qllky","associated_object_type":"account","category":"account.created","created_at":"2020-01-31T23:59:59Z","type":"event"}';
$secret = 'whsec_c2VjcmV0Cg==';
$rawSecret = "secret\n";
$webhook = new Webhook($secret);
$messageId = '1';
$timestamp = time();
Expand All @@ -89,7 +90,7 @@ public function testUnwrapWithVerification(): void
'webhook-id' => [$messageId],
'webhook-timestamp' => [(string) $timestamp],
];
$this->client->events->unwrap($payload, $headers, $secret);
$this->client->events->unwrap($payload, $headers, $rawSecret);
// unwrap successful if not error thrown, increment assertion count to avoid risky test warning
$this->addToAssertionCount(1);
}
Expand All @@ -101,6 +102,7 @@ public function testUnwrapWrongKey(): void

$payload = '{"id":"event_001dzz0r20rzr4zrhrr1364hy80","associated_object_id":"account_in71c4amph0vgo2qllky","associated_object_type":"account","category":"account.created","created_at":"2020-01-31T23:59:59Z","type":"event"}';
$secret = 'whsec_c2VjcmV0Cg==';
$rawSecret = "secret\n";
$webhook = new Webhook($secret);
$messageId = '1';
$timestamp = time();
Expand All @@ -123,6 +125,7 @@ public function testUnwrapBadSignature(): void

$payload = '{"id":"event_001dzz0r20rzr4zrhrr1364hy80","associated_object_id":"account_in71c4amph0vgo2qllky","associated_object_type":"account","category":"account.created","created_at":"2020-01-31T23:59:59Z","type":"event"}';
$secret = 'whsec_c2VjcmV0Cg==';
$rawSecret = "secret\n";
$webhook = new Webhook($secret);
$messageId = '1';
$timestamp = time();
Expand All @@ -134,7 +137,7 @@ public function testUnwrapBadSignature(): void
'webhook-id' => [$messageId],
'webhook-timestamp' => [(string) $timestamp],
];
$this->client->events->unwrap($payload, $headers, $secret);
$this->client->events->unwrap($payload, $headers, $rawSecret);
}

#[Test]
Expand All @@ -144,6 +147,7 @@ public function testUnwrapOldTimestamp(): void

$payload = '{"id":"event_001dzz0r20rzr4zrhrr1364hy80","associated_object_id":"account_in71c4amph0vgo2qllky","associated_object_type":"account","category":"account.created","created_at":"2020-01-31T23:59:59Z","type":"event"}';
$secret = 'whsec_c2VjcmV0Cg==';
$rawSecret = "secret\n";
$webhook = new Webhook($secret);
$messageId = '1';
$timestamp = time();
Expand All @@ -155,7 +159,7 @@ public function testUnwrapOldTimestamp(): void
'webhook-id' => [$messageId],
'webhook-timestamp' => ['5'],
];
$this->client->events->unwrap($payload, $headers, $secret);
$this->client->events->unwrap($payload, $headers, $rawSecret);
}

#[Test]
Expand All @@ -165,6 +169,7 @@ public function testUnwrapWrongMessageID(): void

$payload = '{"id":"event_001dzz0r20rzr4zrhrr1364hy80","associated_object_id":"account_in71c4amph0vgo2qllky","associated_object_type":"account","category":"account.created","created_at":"2020-01-31T23:59:59Z","type":"event"}';
$secret = 'whsec_c2VjcmV0Cg==';
$rawSecret = "secret\n";
$webhook = new Webhook($secret);
$messageId = '1';
$timestamp = time();
Expand All @@ -176,6 +181,6 @@ public function testUnwrapWrongMessageID(): void
'webhook-id' => ['wrong'],
'webhook-timestamp' => [(string) $timestamp],
];
$this->client->events->unwrap($payload, $headers, $secret);
$this->client->events->unwrap($payload, $headers, $rawSecret);
}
}