Compare commits
35 commits
master
...
809-loyalt
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
857c573ae5 | ||
|
|
a724b00ce7 | ||
|
|
0a4ea563d9 | ||
|
|
d1059797a5 | ||
|
|
bd655a459a | ||
|
|
b79f2f2dfb | ||
|
|
d2a0638ffa | ||
|
|
5056637b66 | ||
|
|
1fd883b07b | ||
|
|
40c629eee3 | ||
|
|
aa85198b7a | ||
|
|
62f11c9ef5 | ||
|
|
9dbaf92698 | ||
|
|
d7cc0fc3de | ||
|
|
8c61a27376 | ||
|
|
0d9da221a7 | ||
|
|
919b56688d | ||
|
|
7af20f3d69 | ||
|
|
b3548fcc50 | ||
|
|
5a2f57492d | ||
|
|
debb399e96 | ||
|
|
e3649c3d2d | ||
|
|
4f5560f6f7 | ||
|
|
b67f960055 | ||
|
|
219d5c09d3 | ||
|
|
96a7cc929e | ||
|
|
fe4806f41a | ||
|
|
17e583e11a | ||
|
|
a911b8c6c1 | ||
|
|
ab64161afb | ||
|
|
627b3da748 | ||
|
|
48d87ae119 | ||
|
|
2ccd1e0e2d | ||
|
|
c9cb6e8b53 | ||
|
|
d9d4ffbecf |
30 changed files with 1245 additions and 192 deletions
|
|
@ -312,4 +312,46 @@ apiv2_insurance_premiums_banner:
|
|||
apiv2_insurance_body_types:
|
||||
path: /apiv2/insurance/body_types
|
||||
controller: App\Controller\CustomerAppAPI\InsuranceController::getBodyTypes
|
||||
methods: [GET]
|
||||
methods: [GET]
|
||||
|
||||
apiv2_loyalty_register:
|
||||
path: /apiv2/loyalty/register
|
||||
controller: App\Controller\CustomerAppAPI\LoyaltyController::register
|
||||
methods: [POST]
|
||||
|
||||
# static content
|
||||
apiv2_static_content:
|
||||
path: /apiv2/static_content/{id}
|
||||
controller: App\Controller\CustomerAppAPI\StaticContentController::getContent
|
||||
methods: [GET]
|
||||
|
||||
# subscription
|
||||
apiv2_subscription_plan_details:
|
||||
path: /apiv2/subscription/vehicle/{vid}/plan
|
||||
controller: App\Controller\CustomerAppAPI\SubscriptionController::getPlanDetails
|
||||
methods: [GET]
|
||||
|
||||
#apiv2_subscription_paymongo_public_key:
|
||||
# path: /apiv2/subscription/ppk
|
||||
# controller: App\Controller\CustomerAppAPI\SubscriptionController::getPaymongoPublicKey
|
||||
# methods: [GET]
|
||||
|
||||
apiv2_subscription_create:
|
||||
path: /apiv2/subscription
|
||||
controller: App\Controller\CustomerAppAPI\SubscriptionController::createSubscription
|
||||
methods: [POST]
|
||||
|
||||
apiv2_subscription_finalize:
|
||||
path: /apiv2/subscription/{id}/finalize
|
||||
controller: App\Controller\CustomerAppAPI\SubscriptionController::finalizeSubscription
|
||||
methods: [GET]
|
||||
|
||||
#apiv2_subscription_payment_intent:
|
||||
# path: /apiv2/subscription/payment_intent/{pi_id}
|
||||
# controller: App\Controller\CustomerAppAPI\SubscriptionController::getPaymentIntent
|
||||
# methods: [GET]
|
||||
|
||||
#apiv2_subscription_activate:
|
||||
# path: /apiv2/subscription/{id}/activate
|
||||
# controller: App\Controller\CustomerAppAPI\SubscriptionController::activateSubscription
|
||||
# methods: [POST]
|
||||
|
|
|
|||
|
|
@ -17,6 +17,13 @@ parameters:
|
|||
ios_app_version: "%env(IOS_APP_VERSION)%"
|
||||
insurance_premiums_banner_url: "%env(INSURANCE_PREMIUMS_BANNER_URL)%"
|
||||
enabled_hub_filters: "%env(ENABLED_HUB_FILTERS)%"
|
||||
insurance_paymongo_public_key: "%env(INSURANCE_PAYMONGO_PUBLIC_KEY)%"
|
||||
insurance_paymongo_secret_key: "%env(INSURANCE_PAYMONGO_SECRET_KEY)%"
|
||||
insurance_paymongo_webhook_id: "%env(INSURANCE_PAYMONGO_WEBHOOK_ID)%"
|
||||
subscription_paymongo_public_key: "%env(SUBSCRIPTION_PAYMONGO_PUBLIC_KEY)%"
|
||||
subscription_paymongo_secret_key: "%env(SUBSCRIPTION_PAYMONGO_SECRET_KEY)%"
|
||||
subscription_paymongo_webhook_id: "%env(SUBSCRIPTION_PAYMONGO_WEBHOOK_ID)%"
|
||||
subscription_months: "%env(SUBSCRIPTION_MONTHS)%"
|
||||
|
||||
services:
|
||||
# default configuration for services in *this* file
|
||||
|
|
@ -114,7 +121,6 @@ services:
|
|||
arguments:
|
||||
$em: "@doctrine.orm.entity_manager"
|
||||
$paymongo: "@App\\Service\\PayMongoConnector"
|
||||
$webhook_id: "%env(PAYMONGO_WEBHOOK_ID)%"
|
||||
|
||||
# rider tracker service
|
||||
App\Service\RiderTracker:
|
||||
|
|
@ -238,8 +244,13 @@ services:
|
|||
App\Service\PayMongoConnector:
|
||||
arguments:
|
||||
$base_url: "%env(PAYMONGO_BASE_URL)%"
|
||||
$public_key: "%env(PAYMONGO_PUBLIC_KEY)%"
|
||||
$secret_key: "%env(PAYMONGO_SECRET_KEY)%"
|
||||
|
||||
# loyalty system connector
|
||||
App\Service\LoyaltyConnector:
|
||||
arguments:
|
||||
$base_url: "%env(LOYALTY_BASE_URL)%"
|
||||
$api_key: "%env(LOYALTY_API_KEY)%"
|
||||
$secret_key: "%env(LOYALTY_SECRET_KEY)%"
|
||||
|
||||
# entity listener for customer vehicle warranty code history
|
||||
App\EntityListener\CustomerVehicleSerialListener:
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ use Symfony\Component\Console\Command\Command;
|
|||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
use Symfony\Component\Console\Input\InputOption;
|
||||
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
|
||||
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
|
||||
|
|
@ -19,14 +20,18 @@ class ProcessLatePaymongoTransactionsCommand extends Command
|
|||
{
|
||||
protected $em;
|
||||
protected $paymongo;
|
||||
|
||||
protected $webhook_id;
|
||||
|
||||
public function __construct(EntityManagerInterface $em, PayMongoConnector $paymongo, $webhook_id)
|
||||
public function __construct(EntityManagerInterface $em, PayMongoConnector $paymongo, ParameterBagInterface $params)
|
||||
{
|
||||
$this->em = $em;
|
||||
$this->webhook_id = $params->get('insurance_paymongo_webhook_id');
|
||||
|
||||
$this->paymongo = $paymongo;
|
||||
$this->webhook_id = $webhook_id;
|
||||
$this->paymongo->initialize(
|
||||
$params->get('insurance_paymongo_public_key'),
|
||||
$params->get('insurance_paymongo_secret_key')
|
||||
);
|
||||
|
||||
parent::__construct();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,11 +9,24 @@ use Symfony\Component\HttpFoundation\Request;
|
|||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Validator\Validator\ValidatorInterface;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
|
||||
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
|
||||
use App\Service\PayMongoConnector;
|
||||
|
||||
use Catalyst\MenuBundle\Annotation\Menu;
|
||||
|
||||
class BatterySizeController extends Controller
|
||||
{
|
||||
protected $pm;
|
||||
|
||||
public function __construct(PayMongoConnector $pm, ParameterBagInterface $params)
|
||||
{
|
||||
$this->pm = $pm;
|
||||
$this->pm->initialize(
|
||||
$params->get('subscription_paymongo_public_key'),
|
||||
$params->get('subscription_paymongo_secret_key'),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Menu(selected="bsize_list")
|
||||
*/
|
||||
|
|
@ -130,7 +143,8 @@ class BatterySizeController extends Controller
|
|||
->setTIPriceMotolite($req->request->get('tip_motolite'))
|
||||
->setTIPricePremium($req->request->get('tip_premium'))
|
||||
->setTIPriceOther($req->request->get('tip_other'))
|
||||
->setTIPriceLazada($req->request->get('tip_lazada'));
|
||||
->setTIPriceLazada($req->request->get('tip_lazada'))
|
||||
->setSubRecurringFee($req->request->get('sub_recurring_fee'));
|
||||
}
|
||||
|
||||
public function addSubmit(Request $req, ValidatorInterface $validator)
|
||||
|
|
@ -167,6 +181,9 @@ class BatterySizeController extends Controller
|
|||
$em->persist($row);
|
||||
$em->flush();
|
||||
|
||||
// create new paymongo subscription plan
|
||||
$this->pm->createOrUpdateSubPlan($row);
|
||||
|
||||
// return successful response
|
||||
return $this->json([
|
||||
'success' => 'Changes have been saved!'
|
||||
|
|
@ -234,6 +251,9 @@ class BatterySizeController extends Controller
|
|||
// validated! save the entity
|
||||
$em->flush();
|
||||
|
||||
// find if paymongo subscription plan exists, then update accordingly
|
||||
$this->pm->createOrUpdateSubPlan($row);
|
||||
|
||||
// return successful response
|
||||
return $this->json([
|
||||