mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-08-05 11:10:16 -04:00
Merge pull request #7584 from turbo124/v5-develop
Stripe webhook fixes.
This commit is contained in:
commit
8083689ecf
@ -778,8 +778,13 @@ class BaseController extends Controller
|
||||
}
|
||||
|
||||
/* Clean up URLs and remove query parameters from the URL*/
|
||||
if(request()->has('login') && request()->input('login') == 'true')
|
||||
return redirect('/')->with(['login' => "true"]);
|
||||
if (request()->has('login') && request()->input('login') == 'true') {
|
||||
return redirect('/')->with(['login' => 'true']);
|
||||
}
|
||||
|
||||
if (request()->has('signup') && request()->input('signup') == 'true') {
|
||||
return redirect('/')->with(['signup' => 'true']);
|
||||
}
|
||||
|
||||
$data = [];
|
||||
|
||||
@ -789,10 +794,16 @@ class BaseController extends Controller
|
||||
//pass referral code to front end
|
||||
$data['rc'] = request()->has('rc') ? request()->input('rc') : '';
|
||||
$data['build'] = request()->has('build') ? request()->input('build') : '';
|
||||
$data['login'] = request()->has('login') ? request()->input('login') : "false";
|
||||
|
||||
if(request()->session()->has('login'))
|
||||
$data['login'] = "true";
|
||||
$data['login'] = request()->has('login') ? request()->input('login') : 'false';
|
||||
$data['signup'] = request()->has('signup') ? request()->input('signup') : 'false';
|
||||
|
||||
if (request()->session()->has('login')) {
|
||||
$data['login'] = 'true';
|
||||
}
|
||||
|
||||
if(request()->session()->has('signup')){
|
||||
$data['signup'] = 'true';
|
||||
}
|
||||
|
||||
$data['user_agent'] = request()->server('HTTP_USER_AGENT');
|
||||
|
||||
|
@ -378,4 +378,12 @@ class NinjaMailerJob implements ShouldQueue
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Is this the cleanest way to requeue a job?
|
||||
*
|
||||
* $this->delete();
|
||||
*
|
||||
* $job = NinjaMailerJob::dispatch($this->nmo, $this->override)->delay(3600);
|
||||
*/
|
||||
|
||||
}
|
@ -34,7 +34,6 @@ class PurchaseOrder extends BaseModel
|
||||
'discount',
|
||||
'company_id',
|
||||
'status_id',
|
||||
'user_id',
|
||||
'last_sent_date',
|
||||
'is_deleted',
|
||||
'po_number',
|
||||
|
@ -121,7 +121,19 @@ class PaymentIntentWebhook implements ShouldQueue
|
||||
nlog("payment intent");
|
||||
nlog($this->stripe_request);
|
||||
|
||||
if(optional($this->stripe_request['object']['charges']['data'][0]['metadata']['payment_hash']) && in_array('card', $this->stripe_request['object']['allowed_source_types']))
|
||||
if(array_key_exists('allowed_source_types', $this->stripe_request['object']) && optional($this->stripe_request['object']['charges']['data'][0]['metadata']['payment_hash']) && in_array('card', $this->stripe_request['object']['allowed_source_types']))
|
||||
{
|
||||
nlog("hash found");
|
||||
|
||||
$hash = $this->stripe_request['object']['charges']['data'][0]['metadata']['payment_hash'];
|
||||
|
||||
$payment_hash = PaymentHash::where('hash', $hash)->first();
|
||||
$invoice = Invoice::with('client')->find($payment_hash->fee_invoice_id);
|
||||
$client = $invoice->client;
|
||||
|
||||
$this->updateCreditCardPayment($payment_hash, $client);
|
||||
}
|
||||
elseif(array_key_exists('payment_method_types', $this->stripe_request['object']) && optional($this->stripe_request['object']['charges']['data'][0]['metadata']['payment_hash']) && in_array('card', $this->stripe_request['object']['payment_method_types']))
|
||||
{
|
||||
nlog("hash found");
|
||||
|
||||
|
@ -89,7 +89,7 @@ class PurchaseOrderTransformer extends EntityTransformer
|
||||
'custom_surcharge_tax3' => (bool)$purchase_order->custom_surcharge_tax3,
|
||||
'custom_surcharge_tax4' => (bool)$purchase_order->custom_surcharge_tax4,
|
||||
'line_items' => $purchase_order->line_items ?: (array)[],
|
||||
'entity_type' => 'purchase_order',
|
||||
'entity_type' => 'purchaseOrder',
|
||||
'exchange_rate' => (float)$purchase_order->exchange_rate,
|
||||
'paid_to_date' => (float)$purchase_order->paid_to_date,
|
||||
'subscription_id' => $this->encodePrimaryKey($purchase_order->subscription_id),
|
||||
|
@ -1,5 +1,5 @@
|
||||
<!DOCTYPE html>
|
||||
<html data-report-errors="{{ $report_errors }}" data-rc="{{ $rc }}" data-user-agent="{{ $user_agent }}" data-login="{{ $login }}">
|
||||
<html data-report-errors="{{ $report_errors }}" data-rc="{{ $rc }}" data-user-agent="{{ $user_agent }}" data-login="{{ $login }}" data-login="{{ $signup }}">
|
||||
<head>
|
||||
<!-- Source: https://github.com/invoiceninja/invoiceninja -->
|
||||
<!-- Version: {{ config('ninja.app_version') }} -->
|
||||
|
Loading…
x
Reference in New Issue
Block a user