diff --git a/src/Http/Controllers/WebhookController.php b/src/Http/Controllers/WebhookController.php index 42a0119..7f1f01a 100644 --- a/src/Http/Controllers/WebhookController.php +++ b/src/Http/Controllers/WebhookController.php @@ -83,8 +83,8 @@ public function handleOrderCreated(array $payload): void $order = $billable->orders()->create([ 'lemon_squeezy_id' => $payload['data']['id'], 'customer_id' => $attributes['customer_id'], - 'product_id' => $attributes['first_order_item']['product_id'], - 'variant_id' => $attributes['first_order_item']['variant_id'], + 'product_id' => (string) $attributes['first_order_item']['product_id'], + 'variant_id' => (string) $attributes['first_order_item']['variant_id'], 'identifier' => $attributes['identifier'], 'order_number' => $attributes['order_number'], 'currency' => $attributes['currency'], @@ -135,8 +135,8 @@ public function handleSubscriptionCreated(array $payload): void 'type' => $custom['subscription_type'] ?? Subscription::DEFAULT_TYPE, 'lemon_squeezy_id' => $payload['data']['id'], 'status' => $attributes['status'], - 'product_id' => $attributes['product_id'], - 'variant_id' => $attributes['variant_id'], + 'product_id' => (string) $attributes['product_id'], + 'variant_id' => (string) $attributes['variant_id'], 'card_brand' => $attributes['card_brand'] ?? null, 'card_last_four' => $attributes['card_last_four'] ?? null, 'trial_ends_at' => $attributes['trial_ends_at'] ? Carbon::make($attributes['trial_ends_at']) : null, diff --git a/src/Order.php b/src/Order.php index a5fb3f5..c849be4 100644 --- a/src/Order.php +++ b/src/Order.php @@ -180,8 +180,8 @@ public function sync(array $attributes): self { $this->update([ 'customer_id' => $attributes['customer_id'], - 'product_id' => $attributes['first_order_item']['product_id'], - 'variant_id' => $attributes['first_order_item']['variant_id'], + 'product_id' => (string) $attributes['first_order_item']['product_id'], + 'variant_id' => (string) $attributes['first_order_item']['variant_id'], 'identifier' => $attributes['identifier'], 'order_number' => $attributes['order_number'], 'currency' => $attributes['currency'], diff --git a/src/Subscription.php b/src/Subscription.php index df1bae8..3447303 100644 --- a/src/Subscription.php +++ b/src/Subscription.php @@ -413,8 +413,8 @@ public function sync(array $attributes): self { $this->update([ 'status' => $attributes['status'], - 'product_id' => $attributes['product_id'], - 'variant_id' => $attributes['variant_id'], + 'product_id' => (string) $attributes['product_id'], + 'variant_id' => (string) $attributes['variant_id'], 'card_brand' => $attributes['card_brand'] ?? null, 'card_last_four' => $attributes['card_last_four'] ?? null, 'pause_mode' => $attributes['pause']['mode'] ?? null,