From b8aaa8c08255a61c2c96b98c53c9b6dfa7878305 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Mon, 30 Sep 2019 07:49:43 +1000 Subject: [PATCH] Payment hooks --- .../ClientPortal/PaymentHookController.php | 30 +++++++++++++++++++ .../PayPalExpressPaymentDriver.php | 7 ++++- routes/client.php | 1 + 3 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 app/Http/Controllers/ClientPortal/PaymentHookController.php diff --git a/app/Http/Controllers/ClientPortal/PaymentHookController.php b/app/Http/Controllers/ClientPortal/PaymentHookController.php new file mode 100644 index 0000000000..abfac3b30d --- /dev/null +++ b/app/Http/Controllers/ClientPortal/PaymentHookController.php @@ -0,0 +1,30 @@ +input()); + + } + +} \ No newline at end of file diff --git a/app/PaymentDrivers/PayPalExpressPaymentDriver.php b/app/PaymentDrivers/PayPalExpressPaymentDriver.php index 97be177e7c..2b04e3da27 100644 --- a/app/PaymentDrivers/PayPalExpressPaymentDriver.php +++ b/app/PaymentDrivers/PayPalExpressPaymentDriver.php @@ -53,7 +53,7 @@ class PayPalExpressPaymentDriver extends BasePaymentDriver */ public function processPaymentView(array $data) { - + $this->purchase(); } public function processPaymentResponse($request) @@ -77,4 +77,9 @@ class PayPalExpressPaymentDriver extends BasePaymentDriver return $data; } + + private function buildReturnUrl() + { + $url = $this->client->company->domain . "/payment_hook/{$this->company_gateway->id}/{GatewayType::PAYPAL}"; + } } \ No newline at end of file diff --git a/routes/client.php b/routes/client.php index b9ac33d9ff..fa9d449541 100644 --- a/routes/client.php +++ b/routes/client.php @@ -46,6 +46,7 @@ Route::group(['middleware' => ['domain_db'], 'prefix' => 'client', 'as' => 'clie /*Invitation catches*/ Route::get('invoice/{invitation_id}','ClientPortal\InvitationController@invoiceRouter'); + Route::get('payment_hook/{invitation_id}','ClientPortal\PaymentHookController@process'); });