From 051f30b46c6fd47e97959e5758a07a61bd382a89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Re=CC=81mi=20Barbe=CC=81?= Date: Thu, 4 May 2017 10:35:50 +0200 Subject: [PATCH 1/2] Add method getPriceByPlanCode --- lib/Api/Plan.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/Api/Plan.php b/lib/Api/Plan.php index 3ed45be..4ea364e 100644 --- a/lib/Api/Plan.php +++ b/lib/Api/Plan.php @@ -133,4 +133,14 @@ public function filterPlans(array $plans, array $filters): array return $plans; } + + /** + * get price by planCode + * + */ + public function getPriceByPlanCode(string $planCode): string + { + $plan = $this->getPlan($planCode); + return (array_key_exists('recurring_price',$plan)) ? $plan['recurring_price'] : ''; + } } From 0b3e45a9bf469e92a0769e6a72f3d4346949e983 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Re=CC=81mi=20Barbe=CC=81?= Date: Thu, 4 May 2017 10:49:40 +0200 Subject: [PATCH 2/2] Fixed some style --- lib/Api/Plan.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Api/Plan.php b/lib/Api/Plan.php index 4ea364e..9ee98f9 100644 --- a/lib/Api/Plan.php +++ b/lib/Api/Plan.php @@ -141,6 +141,7 @@ public function filterPlans(array $plans, array $filters): array public function getPriceByPlanCode(string $planCode): string { $plan = $this->getPlan($planCode); - return (array_key_exists('recurring_price',$plan)) ? $plan['recurring_price'] : ''; + + return (array_key_exists('recurring_price', $plan)) ? $plan['recurring_price'] : ''; } }