mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 13:12:50 +01: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)
|
||||
{
|
||||
$multiple_contacts = ClientContact::query()
|
||||
->with('company','client')
|
||||
->where('email', auth('contact')->user()->email)
|
||||
->whereNotNull('email')
|
||||
->where('email', '<>', '')
|
||||
|
@ -37,8 +37,9 @@ class StoreClientGatewayTokenRequest extends Request
|
||||
|
||||
public function rules()
|
||||
{
|
||||
//ensure client is present
|
||||
$rules = [
|
||||
'client_id' => 'required',
|
||||
'client_id' => 'required|exists:clients,id,company_id,'.auth()->user()->company()->id,
|
||||
'company_gateway_id' => 'required',
|
||||
'gateway_type_id' => 'required|integer',
|
||||
'meta' => 'required',
|
||||
|
@ -35,6 +35,7 @@ class ClientGatewayToken extends BaseModel
|
||||
'gateway_customer_reference',
|
||||
'gateway_type_id',
|
||||
'meta',
|
||||
'client_id',
|
||||
];
|
||||
|
||||
public function getEntityType()
|
||||
|
@ -159,7 +159,9 @@ class PaymentRepository extends BaseRepository {
|
||||
|
||||
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();
|
||||
|
||||
event( new PaymentWasCreated( $payment, $payment->company, Ninja::eventVars(auth()->user() ? auth()->user()->id : null) ) );
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user