Skip to content

Commit 52604f1

Browse files
authored
Merge pull request #18 from StoreFactory/feature/YP-3594
Add method getPriceByPlanCode
2 parents 73f830c + 0b3e45a commit 52604f1

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

lib/Api/Plan.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,4 +133,15 @@ public function filterPlans(array $plans, array $filters): array
133133

134134
return $plans;
135135
}
136+
137+
/**
138+
* get price by planCode
139+
*
140+
*/
141+
public function getPriceByPlanCode(string $planCode): string
142+
{
143+
$plan = $this->getPlan($planCode);
144+
145+
return (array_key_exists('recurring_price', $plan)) ? $plan['recurring_price'] : '';
146+
}
136147
}

0 commit comments

Comments
 (0)