Skip to content

Commit

Permalink
Fix for gnikyt#426 - Look up plan thats not default
Browse files Browse the repository at this point in the history
  • Loading branch information
gnikyt committed Mar 25, 2020
1 parent 362e9a2 commit 115949e
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/ShopifyApp/Actions/GetPlanUrl.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,8 @@ public function __invoke(ShopId $shopId, NullablePlanId $planId): string
// Get the shop
$shop = $this->shopQuery->getById($shopId);

// If the plan is null, get a plan
if ($planId->isNull()) {
$plan = $this->planQuery->getDefault();
}
// Get the plan
$plan = $planId->isNull() ? $this->planQuery->getDefault() : $this->planQuery->getById($planId);

$api = $shop->apiHelper()->createCharge(
ChargeType::fromNative($plan->getType()->toNative()),
Expand Down

0 comments on commit 115949e

Please sign in to comment.