mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
commit
b1ac82d192
@ -15,6 +15,8 @@ class S3Cleanup extends Command
|
|||||||
*/
|
*/
|
||||||
protected $signature = 'ninja:s3-cleanup';
|
protected $signature = 'ninja:s3-cleanup';
|
||||||
|
|
||||||
|
protected $log = '';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The console command description.
|
* The console command description.
|
||||||
*
|
*
|
||||||
|
@ -18,10 +18,10 @@ use App\Libraries\MultiDB;
|
|||||||
use App\Models\ClientContact;
|
use App\Models\ClientContact;
|
||||||
use App\Models\Company;
|
use App\Models\Company;
|
||||||
use App\Utils\Ninja;
|
use App\Utils\Ninja;
|
||||||
use Auth;
|
|
||||||
use Illuminate\Contracts\Routing\ResponseFactory;
|
use Illuminate\Contracts\Routing\ResponseFactory;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Http\Response;
|
use Illuminate\Http\Response;
|
||||||
|
use Illuminate\Support\Facades\Auth;
|
||||||
|
|
||||||
class NinjaPlanController extends Controller
|
class NinjaPlanController extends Controller
|
||||||
{
|
{
|
||||||
|
@ -126,6 +126,7 @@ class TemplateEmail extends Mailable
|
|||||||
if($this->invitation->invoice && $settings->ubl_email_attachment && $this->company->account->hasFeature(Account::FEATURE_DOCUMENTS)){
|
if($this->invitation->invoice && $settings->ubl_email_attachment && $this->company->account->hasFeature(Account::FEATURE_DOCUMENTS)){
|
||||||
|
|
||||||
$ubl_string = CreateUbl::dispatchNow($this->invitation->invoice);
|
$ubl_string = CreateUbl::dispatchNow($this->invitation->invoice);
|
||||||
|
|
||||||
$this->attachData($ubl_string, $this->invitation->invoice->getFileName('xml'));
|
$this->attachData($ubl_string, $this->invitation->invoice->getFileName('xml'));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -13,10 +13,12 @@ namespace App\Models;
|
|||||||
|
|
||||||
use App\Utils\Traits\MakesDates;
|
use App\Utils\Traits\MakesDates;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||||
|
|
||||||
class ClientGatewayToken extends BaseModel
|
class ClientGatewayToken extends BaseModel
|
||||||
{
|
{
|
||||||
use MakesDates;
|
use MakesDates;
|
||||||
|
use SoftDeletes;
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
'meta' => 'object',
|
'meta' => 'object',
|
||||||
|
@ -46,7 +46,7 @@ class InvoiceObserver
|
|||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function updated(Invoice $invoice)
|
public function updated(Invoice $invoice)
|
||||||
{nlog("updated");
|
{
|
||||||
$subscriptions = Webhook::where('company_id', $invoice->company->id)
|
$subscriptions = Webhook::where('company_id', $invoice->company->id)
|
||||||
->where('event_id', Webhook::EVENT_UPDATE_INVOICE)
|
->where('event_id', Webhook::EVENT_UPDATE_INVOICE)
|
||||||
->exists();
|
->exists();
|
||||||
|
@ -205,7 +205,6 @@ class BaseDriver extends AbstractPaymentDriver
|
|||||||
|
|
||||||
$invoices->each(function ($invoice) use ($payment) {
|
$invoices->each(function ($invoice) use ($payment) {
|
||||||
event(new InvoiceWasPaid($invoice, $payment, $payment->company, Ninja::eventVars()));
|
event(new InvoiceWasPaid($invoice, $payment, $payment->company, Ninja::eventVars()));
|
||||||
$invoice->service()->workFlow();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
return $payment->service()->applyNumber()->save();
|
return $payment->service()->applyNumber()->save();
|
||||||
|
@ -60,12 +60,18 @@ use WePayCommon;
|
|||||||
'method' => '1',
|
'method' => '1',
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$response = $this->wepay_payment_driver->wepay->request('credit_card/authorize', array(
|
try {
|
||||||
'client_id' => config('ninja.wepay.client_id'),
|
|
||||||
'client_secret' => config('ninja.wepay.client_secret'),
|
$response = $this->wepay_payment_driver->wepay->request('credit_card/authorize', array(
|
||||||
'credit_card_id' => (int)$data['credit_card_id'],
|
'client_id' => config('ninja.wepay.client_id'),
|
||||||
));
|
'client_secret' => config('ninja.wepay.client_secret'),
|
||||||
|
'credit_card_id' => (int)$data['credit_card_id'],
|
||||||
|
));
|
||||||
|
|
||||||
|
}
|
||||||
|
catch(\Exception $e){
|
||||||
|
return $this->wepay_payment_driver->processInternallyFailedPayment($this->wepay_payment_driver, $e);
|
||||||
|
}
|
||||||
// display the response
|
// display the response
|
||||||
// nlog($response);
|
// nlog($response);
|
||||||
|
|
||||||
@ -116,11 +122,16 @@ use WePayCommon;
|
|||||||
{
|
{
|
||||||
nlog("authorize the card first!");
|
nlog("authorize the card first!");
|
||||||
|
|
||||||
$response = $this->wepay_payment_driver->wepay->request('credit_card/authorize', array(
|
try {
|
||||||
'client_id' => config('ninja.wepay.client_id'),
|
$response = $this->wepay_payment_driver->wepay->request('credit_card/authorize', array(
|
||||||
'client_secret' => config('ninja.wepay.client_secret'),
|
'client_id' => config('ninja.wepay.client_id'),
|
||||||
'credit_card_id' => (int)$request->input('credit_card_id'),
|
'client_secret' => config('ninja.wepay.client_secret'),
|
||||||
));
|
'credit_card_id' => (int)$request->input('credit_card_id'),
|
||||||
|
));
|
||||||
|
}
|
||||||
|
catch(\Exception $e){
|
||||||
|
return $this->wepay_payment_driver->processInternallyFailedPayment($this->wepay_payment_driver, $e);
|
||||||
|
}
|
||||||
|
|
||||||
$credit_card_id = (int)$response->credit_card_id;
|
$credit_card_id = (int)$response->credit_card_id;
|
||||||
|
|
||||||
|
@ -83,6 +83,7 @@ class UpdateInvoicePayment
|
|||||||
->updatePaidToDate($paid_amount)
|
->updatePaidToDate($paid_amount)
|
||||||
->updateStatus()
|
->updateStatus()
|
||||||
->deletePdf()
|
->deletePdf()
|
||||||
|
->workFlow()
|
||||||
->save();
|
->save();
|
||||||
|
|
||||||
event(new InvoiceWasUpdated($invoice, $invoice->company, Ninja::eventVars(auth()->user() ? auth()->user()->id : null)));
|
event(new InvoiceWasUpdated($invoice, $invoice->company, Ninja::eventVars(auth()->user() ? auth()->user()->id : null)));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user