Skip to content

Commit b0bc95d

Browse files
onairmarcEncoreBot
andauthored
Remove Read-Only Fields from Subscription Update Request (#63)
Co-authored-by: EncoreBot <[email protected]>
1 parent 51827a0 commit b0bc95d

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

.git-blame-ignore-revs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,5 @@ cc49dd08428da674282d3ee3421ae9c47166bd2d
3030
753421ed297eb787e4eaf14a0dd759a304636217
3131
c40f4bf03470e0150b96d1e7494b8c2c07cc9f0d
3232
be4c69669e82a85394df83a714225fafe2409a35
33+
f5037b59ad70b9cec45fda109e63af97ba610cf0
34+
7a00910446edf363cdc887611d8714b1ac94d208

src/php/Services/StripeSubscriptionService.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ public function update(string $subscriptionId, StripeSubscription $subscription)
6060
{
6161
$data = $subscription->toArray();
6262

63-
// Remove id from update data
64-
unset($data["id"]);
63+
// Remove read-only fields from update data
64+
unset($data["id"], $data["currency"], $data["status"], $data["customer"]);
6565

6666
$stripeSubscription = $this->stripe->subscriptions->update($subscriptionId, $data);
6767

0 commit comments

Comments
 (0)