From 9290cf8242725e07d7e3c884e0f7279c6304de4c Mon Sep 17 00:00:00 2001 From: Markus Date: Fri, 5 Jun 2020 09:10:55 +0200 Subject: [PATCH] Bugfix on description of scheduled order item when Subscription::swapNextCycle --- src/Subscription.php | 2 +- tests/SwapSubscriptionPlanTest.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Subscription.php b/src/Subscription.php index abe3b3d3..c54d6481 100644 --- a/src/Subscription.php +++ b/src/Subscription.php @@ -418,7 +418,7 @@ public function scheduleNewOrderItemAt(Carbon $process_at, $item_overrides = [], 'unit_price' => (int) $plan->amount()->getAmount(), 'quantity' => $this->quantity ?: 1, 'tax_percentage' => $this->tax_percentage, - 'description' => $this->plan()->description(), + 'description' => $plan->description(), ], $item_overrides )); diff --git a/tests/SwapSubscriptionPlanTest.php b/tests/SwapSubscriptionPlanTest.php index b354f0aa..4586e28e 100644 --- a/tests/SwapSubscriptionPlanTest.php +++ b/tests/SwapSubscriptionPlanTest.php @@ -138,6 +138,7 @@ public function canSwapNextCycle() $this->assertCarbon($cycle_should_end_at, $new_order_item->process_at, 1); // based on previous plan's cycle $this->assertEquals(2200, $new_order_item->total); $this->assertEquals(200, $new_order_item->tax); + $this->assertEquals('Twice as expensive monthly subscription', $new_order_item->description); $this->assertFalse($user->fresh()->hasCredit());