Add endpoint for retrieving subscription fee #799
This commit is contained in:
parent
17e583e11a
commit
fe4806f41a
3 changed files with 31 additions and 0 deletions
|
|
@ -319,3 +319,9 @@ apiv2_static_content:
|
||||||
path: /apiv2/static_content/{id}
|
path: /apiv2/static_content/{id}
|
||||||
controller: App\Controller\CustomerAppAPI\StaticContentController::getContent
|
controller: App\Controller\CustomerAppAPI\StaticContentController::getContent
|
||||||
methods: [GET]
|
methods: [GET]
|
||||||
|
|
||||||
|
# subscription
|
||||||
|
apiv2_subscription_fee:
|
||||||
|
path: /apiv2/subscription/fee
|
||||||
|
controller: App\Controller\CustomerAppAPI\SubscriptionController::getRecurringFee
|
||||||
|
methods: [GET]
|
||||||
|
|
@ -17,6 +17,7 @@ parameters:
|
||||||
ios_app_version: "%env(IOS_APP_VERSION)%"
|
ios_app_version: "%env(IOS_APP_VERSION)%"
|
||||||
insurance_premiums_banner_url: "%env(INSURANCE_PREMIUMS_BANNER_URL)%"
|
insurance_premiums_banner_url: "%env(INSURANCE_PREMIUMS_BANNER_URL)%"
|
||||||
enabled_hub_filters: "%env(ENABLED_HUB_FILTERS)%"
|
enabled_hub_filters: "%env(ENABLED_HUB_FILTERS)%"
|
||||||
|
subscription_recurring_fee: "%env(SUBSCRIPTION_RECURRING_FEE)%"
|
||||||
|
|
||||||
services:
|
services:
|
||||||
# default configuration for services in *this* file
|
# default configuration for services in *this* file
|
||||||
|
|
|
||||||
24
src/Controller/CustomerAppAPI/SubscriptionController.php
Normal file
24
src/Controller/CustomerAppAPI/SubscriptionController.php
Normal file
|
|
@ -0,0 +1,24 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Controller\CustomerAppAPI;
|
||||||
|
|
||||||
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
|
use Catalyst\ApiBundle\Component\Response as ApiResponse;
|
||||||
|
|
||||||
|
class SubscriptionController extends ApiController
|
||||||
|
{
|
||||||
|
public function getRecurringFee(Request $req)
|
||||||
|
{
|
||||||
|
// check requirements
|
||||||
|
$validity = $this->validateRequest($req);
|
||||||
|
|
||||||
|
if (!$validity['is_valid']) {
|
||||||
|
return new ApiResponse(false, $validity['error']);
|
||||||
|
}
|
||||||
|
|
||||||
|
// response
|
||||||
|
return new ApiResponse(true, '', [
|
||||||
|
'amount' => $this->getParameter('subscription_recurring_fee'),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in a new issue