File tree 2 files changed +5
-9
lines changed
2 files changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -35,14 +35,10 @@ public function v1_get_auto_renew_product_id(): void
35
35
*/
36
36
public function v2_get_aut_renew_product_id (): void
37
37
{
38
- $ signedRenewalInfo = $ this ->sign ([
39
- 'autoRenewProductId ' => 'com.example.product ' ,
40
- ])->toString ();
41
-
42
38
$ decodedPayload = V2DecodedPayload::fromArray ([
43
39
'notification_type ' => ServerNotification::DID_CHANGE_RENEWAL_PREF ,
44
40
'data ' => [
45
- 'signedRenewalInfo ' => $ signedRenewalInfo ,
41
+ 'signedRenewalInfo ' => $ this -> sign ([ ' autoRenewProductId ' => ' com.example.product ' ])-> toString () ,
46
42
],
47
43
]);
48
44
$ serverNotification = AppStoreV2ServerNotification::fromDecodedPayload ($ decodedPayload );
Original file line number Diff line number Diff line change @@ -94,18 +94,18 @@ protected function deleteFile(string $path): void
94
94
}
95
95
96
96
/**
97
- * @param array<string, string> $claims
97
+ * @param array<non-empty- string, string> $claims
98
98
*/
99
99
protected function sign (array $ claims ): UnencryptedToken
100
100
{
101
- $ key = InMemory::base64Encoded ('hiG8DlOKvtih6AxlZn5XKImZ06yu8I3mkOzaJrEuW8yAv8Jnkw330uMt8AEqQ5LB ' );
101
+ $ signingKey = InMemory::base64Encoded ('hiG8DlOKvtih6AxlZn5XKImZ06yu8I3mkOzaJrEuW8yAv8Jnkw330uMt8AEqQ5LB ' );
102
102
103
103
return (new JwtFacade ())->issue (
104
104
new Sha256 (),
105
- $ key ,
105
+ $ signingKey ,
106
106
static function (Builder $ builder ) use ($ claims ): Builder {
107
107
foreach ($ claims as $ key => $ value ) {
108
- $ builder ->withClaim ($ key , $ value );
108
+ $ builder = $ builder ->withClaim ($ key , $ value );
109
109
}
110
110
111
111
return $ builder ;
You can’t perform that action at this time.
0 commit comments