mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Complete paypal response
This commit is contained in:
parent
e89d7cebaa
commit
0b7054b315
@ -208,5 +208,13 @@ class BasePaymentDriver
|
||||
$this->purchaseResponse = (array)$response->getData();*/
|
||||
}
|
||||
|
||||
public function completePurchase($data)
|
||||
{
|
||||
$this->gateway();
|
||||
|
||||
return $this->gateway
|
||||
->completePurchase($data)
|
||||
->send();
|
||||
}
|
||||
|
||||
}
|
@ -60,6 +60,17 @@ class PayPalExpressPaymentDriver extends BasePaymentDriver
|
||||
public function processPaymentResponse($request)
|
||||
{
|
||||
|
||||
$response = $this->completePurchase($request->all());
|
||||
|
||||
$paymentRef = $response->getTransactionReference() ?: $transRef;
|
||||
|
||||
if ($response->isCancelled()) {
|
||||
return false;
|
||||
} elseif (! $response->isSuccessful()) {
|
||||
throw new Exception($response->getMessage());
|
||||
}
|
||||
|
||||
dd($response);
|
||||
}
|
||||
|
||||
protected function paymentDetails($input)
|
||||
@ -81,8 +92,9 @@ class PayPalExpressPaymentDriver extends BasePaymentDriver
|
||||
|
||||
private function buildReturnUrl($input)
|
||||
{
|
||||
$url = $this->client->company->domain . "/payment_hook/{$this->company_gateway->id}/{GatewayType::PAYPAL}/";
|
||||
$url .= "?hashed_ids=" . implode(",", $input['hashed_ids']);
|
||||
$url = $this->client->company->domain . "client/payments/process/response";
|
||||
$url .= "?company_gateway_id={$this->company_gateway->id}&gateway_type_id=".GatewayType::PAYPAL;
|
||||
$url .= "&hashed_ids=" . implode(",", $input['hashed_ids']);
|
||||
$url .= "&amount=".$input['amount'];
|
||||
$url .= "&fee=".$input['fee'];
|
||||
|
||||
|
@ -27,6 +27,7 @@ Route::group(['middleware' => ['auth:contact'], 'prefix' => 'client', 'as' => 'c
|
||||
Route::get('payments/{payment}', 'ClientPortal\PaymentController@show')->name('payments.show');
|
||||
Route::post('payments/process', 'ClientPortal\PaymentController@process')->name('payments.process');
|
||||
Route::post('payments/process/response', 'ClientPortal\PaymentController@response')->name('payments.response');
|
||||
Route::get('payments/process/response', 'ClientPortal\PaymentController@response')->name('payments.response.get');
|
||||
|
||||
Route::get('profile/{client_contact}/edit', 'ClientPortal\ProfileController@edit')->name('profile.edit');
|
||||
Route::put('profile/{client_contact}/edit', 'ClientPortal\ProfileController@update')->name('profile.update');
|
||||
@ -46,7 +47,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');
|
||||
Route::get('payment_hook/{company_gateway_id}/{gateway_type_id}','ClientPortal\PaymentHookController@process');
|
||||
|
||||
});
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user