Fixes for paypal events

This commit is contained in:
David Bomba 2023-12-13 20:04:52 +11:00
parent 95a8c2510f
commit eb88943e86
2 changed files with 5 additions and 5 deletions

View File

@ -50,7 +50,7 @@ class PayPalWebhook implements ShouldQueue
public function handle() public function handle()
{ {
//testing //testing
$this->endpoint = $this->test_endpoint; // $this->endpoint = $this->test_endpoint;
//this can cause problems verifying the webhook, so unset it if it exists //this can cause problems verifying the webhook, so unset it if it exists
if(isset($this->webhook_request['q'])) if(isset($this->webhook_request['q']))
@ -230,6 +230,7 @@ class PayPalWebhook implements ShouldQueue
'merchant_id' => $merchant_id, 'merchant_id' => $merchant_id,
]); ]);
} }
} }
} }

View File

@ -1,5 +1,4 @@
<?php <?php
/** /**
* Invoice Ninja (https://invoiceninja.com). * Invoice Ninja (https://invoiceninja.com).
* *
@ -143,8 +142,8 @@ class PayPalPPCPPaymentDriver extends BaseDriver
public function init(): self public function init(): self
{ {
// $this->api_endpoint_url = 'https://api-m.paypal.com'; $this->api_endpoint_url = 'https://api-m.paypal.com';
$this->api_endpoint_url = 'https://api-m.sandbox.paypal.com'; // $this->api_endpoint_url = 'https://api-m.sandbox.paypal.com';
$secret = config('ninja.paypal.secret'); $secret = config('ninja.paypal.secret');
$client_id = config('ninja.paypal.client_id'); $client_id = config('ninja.paypal.client_id');
@ -539,7 +538,7 @@ class PayPalPPCPPaymentDriver extends BaseDriver
public function processWebhookRequest(Request $request) public function processWebhookRequest(Request $request)
{ {
nlog(json_encode($request->all())); // nlog(json_encode($request->all()));
$this->init(); $this->init();
PayPalWebhook::dispatch($request->all(), $request->headers->all(), $this->access_token); PayPalWebhook::dispatch($request->all(), $request->headers->all(), $this->access_token);