mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-05 05:14:37 -04:00
Fixes for client gateways
This commit is contained in:
parent
a2d954b706
commit
69461104fe
@ -29,6 +29,7 @@ class CheckClientExistence
|
|||||||
public function handle(Request $request, Closure $next)
|
public function handle(Request $request, Closure $next)
|
||||||
{
|
{
|
||||||
$multiple_contacts = ClientContact::query()
|
$multiple_contacts = ClientContact::query()
|
||||||
|
->with('company','client')
|
||||||
->where('email', auth('contact')->user()->email)
|
->where('email', auth('contact')->user()->email)
|
||||||
->whereNotNull('email')
|
->whereNotNull('email')
|
||||||
->where('email', '<>', '')
|
->where('email', '<>', '')
|
||||||
|
@ -37,8 +37,9 @@ class StoreClientGatewayTokenRequest extends Request
|
|||||||
|
|
||||||
public function rules()
|
public function rules()
|
||||||
{
|
{
|
||||||
|
//ensure client is present
|
||||||
$rules = [
|
$rules = [
|
||||||
'client_id' => 'required',
|
'client_id' => 'required|exists:clients,id,company_id,'.auth()->user()->company()->id,
|
||||||
'company_gateway_id' => 'required',
|
'company_gateway_id' => 'required',
|
||||||
'gateway_type_id' => 'required|integer',
|
'gateway_type_id' => 'required|integer',
|
||||||
'meta' => 'required',
|
'meta' => 'required',
|
||||||
|
@ -35,6 +35,7 @@ class ClientGatewayToken extends BaseModel
|
|||||||
'gateway_customer_reference',
|
'gateway_customer_reference',
|
||||||
'gateway_type_id',
|
'gateway_type_id',
|
||||||
'meta',
|
'meta',
|
||||||
|
'client_id',
|
||||||
];
|
];
|
||||||
|
|
||||||
public function getEntityType()
|
public function getEntityType()
|
||||||
|
@ -158,6 +158,8 @@ class PaymentRepository extends BaseRepository {
|
|||||||
if ( ! $is_existing_payment && ! $this->import_mode ) {
|
if ( ! $is_existing_payment && ! $this->import_mode ) {
|
||||||
|
|
||||||
if (array_key_exists('email_receipt', $data) && $data['email_receipt'] == true)
|
if (array_key_exists('email_receipt', $data) && $data['email_receipt'] == true)
|
||||||
|
$payment->service()->sendEmail();
|
||||||
|
elseif(!array_key_exists('email_receipt', $data) && $payment->client->getSetting('client_manual_payment_notification'))
|
||||||
$payment->service()->sendEmail();
|
$payment->service()->sendEmail();
|
||||||
|
|
||||||
event( new PaymentWasCreated( $payment, $payment->company, Ninja::eventVars(auth()->user() ? auth()->user()->id : null) ) );
|
event( new PaymentWasCreated( $payment, $payment->company, Ninja::eventVars(auth()->user() ? auth()->user()->id : null) ) );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user