Skip to content

Commit 91da08e

Browse files
dependabot[bot]imdhemyRydgel
authored
chore(deps): bump imdhemy/appstore-iap from 1.6.1 to 1.7.0 (#421)
Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Dhemy <[email protected]> Co-authored-by: Jérôme Mahuet <[email protected]>
1 parent fb6c133 commit 91da08e

File tree

4 files changed

+39
-43
lines changed

4 files changed

+39
-43
lines changed

composer.lock

+30-30
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/Events/AppStore/DidChangeRenewalPrefTest.php

+1-5
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,10 @@ public function v1_get_auto_renew_product_id(): void
3535
*/
3636
public function v2_get_aut_renew_product_id(): void
3737
{
38-
$signedRenewalInfo = $this->sign([
39-
'autoRenewProductId' => 'com.example.product',
40-
])->toString();
41-
4238
$decodedPayload = V2DecodedPayload::fromArray([
4339
'notification_type' => ServerNotification::DID_CHANGE_RENEWAL_PREF,
4440
'data' => [
45-
'signedRenewalInfo' => $signedRenewalInfo,
41+
'signedRenewalInfo' => $this->sign(['autoRenewProductId' => 'com.example.product'])->toString(),
4642
],
4743
]);
4844
$serverNotification = AppStoreV2ServerNotification::fromDecodedPayload($decodedPayload);

tests/Faker.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,10 @@ public function appStoreTestNotification(array $data = []): Token
9696
$fakeSignKey = InMemory::plainText($this->generateECPrivateKey());
9797

9898
return (new JwtFacade())->issue($alg, $fakeSignKey, static function (Builder $builder) use ($data, $x5c) {
99-
$builder->withHeader('x5c', $x5c);
99+
$builder = $builder->withHeader('x5c', $x5c);
100100

101101
foreach ($data as $key => $value) {
102-
$builder->withClaim($key, $value);
102+
$builder = $builder->withClaim($key, $value);
103103
}
104104

105105
return $builder;
@@ -129,10 +129,10 @@ public function appStoreNotification(array $data = [], ?string $notificationType
129129
$fakeSignKey = InMemory::plainText($this->generateECPrivateKey());
130130

131131
return (new JwtFacade())->issue($alg, $fakeSignKey, static function (Builder $builder) use ($data, $x5c) {
132-
$builder->withHeader('x5c', $x5c);
132+
$builder = $builder->withHeader('x5c', $x5c);
133133

134134
foreach ($data as $key => $value) {
135-
$builder->withClaim($key, $value);
135+
$builder = $builder->withClaim($key, $value);
136136
}
137137

138138
return $builder;

tests/TestCase.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -94,18 +94,18 @@ protected function deleteFile(string $path): void
9494
}
9595

9696
/**
97-
* @param array<string, string> $claims
97+
* @param array<non-empty-string, string> $claims
9898
*/
9999
protected function sign(array $claims): UnencryptedToken
100100
{
101-
$key = InMemory::base64Encoded('hiG8DlOKvtih6AxlZn5XKImZ06yu8I3mkOzaJrEuW8yAv8Jnkw330uMt8AEqQ5LB');
101+
$signingKey = InMemory::base64Encoded('hiG8DlOKvtih6AxlZn5XKImZ06yu8I3mkOzaJrEuW8yAv8Jnkw330uMt8AEqQ5LB');
102102

103103
return (new JwtFacade())->issue(
104104
new Sha256(),
105-
$key,
105+
$signingKey,
106106
static function (Builder $builder) use ($claims): Builder {
107107
foreach ($claims as $key => $value) {
108-
$builder->withClaim($key, $value);
108+
$builder = $builder->withClaim($key, $value);
109109
}
110110

111111
return $builder;

0 commit comments

Comments
 (0)