mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-01 00:24:36 -04:00
Fixes for WePay
This commit is contained in:
parent
df0e9e0a73
commit
f072b921c7
@ -40,7 +40,10 @@ class WePayController extends BaseController
|
|||||||
$company = Company::where('company_key', $hash['company_key'])->firstOrFail();
|
$company = Company::where('company_key', $hash['company_key'])->firstOrFail();
|
||||||
|
|
||||||
$data['user_id'] = $user->id;
|
$data['user_id'] = $user->id;
|
||||||
$data['company'] = $company;
|
$data['user_company'] = $company;
|
||||||
|
|
||||||
|
// $data['company_key'] = $company->company_key;
|
||||||
|
// $data['db'] = $company->db;
|
||||||
|
|
||||||
$wepay_driver = new WePayPaymentDriver(new CompanyGateway, null, null);
|
$wepay_driver = new WePayPaymentDriver(new CompanyGateway, null, null);
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ class AdjustProductInventory implements ShouldQueue
|
|||||||
|
|
||||||
public array $old_invoice;
|
public array $old_invoice;
|
||||||
|
|
||||||
public function __construct(Company $company, Invoice $invoice, ?array $old_invoice = [])
|
public function __construct(Company $company, Invoice $invoice, $old_invoice = [])
|
||||||
{
|
{
|
||||||
$this->company = $company;
|
$this->company = $company;
|
||||||
$this->invoice = $invoice;
|
$this->invoice = $invoice;
|
||||||
|
@ -27,7 +27,7 @@ class Setup
|
|||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
'user_id',
|
'user_id',
|
||||||
'company',
|
'user_company',
|
||||||
*/
|
*/
|
||||||
|
|
||||||
return render('gateways.wepay.signup.index', $data);
|
return render('gateways.wepay.signup.index', $data);
|
||||||
|
@ -33,17 +33,29 @@ class DeletePayment
|
|||||||
|
|
||||||
public function run()
|
public function run()
|
||||||
{
|
{
|
||||||
if ($this->payment->is_deleted) {
|
|
||||||
return $this->payment;
|
|
||||||
}
|
|
||||||
|
|
||||||
return $this->setStatus(Payment::STATUS_CANCELLED) //sets status of payment
|
\DB::connection(config('database.default'))->transaction(function () {
|
||||||
->updateCreditables() //return the credits first
|
|
||||||
->adjustInvoices()
|
|
||||||
->updateClient()
|
if ($this->payment->is_deleted) {
|
||||||
->deletePaymentables()
|
return $this->payment;
|
||||||
->cleanupPayment()
|
}
|
||||||
->save();
|
|
||||||
|
$this->payment = Payment::withTrashed()->where('id', $this->payment->id)->lockForUpdate()->first();
|
||||||
|
|
||||||
|
$this->setStatus(Payment::STATUS_CANCELLED) //sets status of payment
|
||||||
|
->updateCreditables() //return the credits first
|
||||||
|
->adjustInvoices()
|
||||||
|
->updateClient()
|
||||||
|
->deletePaymentables()
|
||||||
|
->cleanupPayment()
|
||||||
|
->save();
|
||||||
|
|
||||||
|
|
||||||
|
}, 2);
|
||||||
|
|
||||||
|
return $this->payment;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private function cleanupPayment()
|
private function cleanupPayment()
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
<img src="{{ asset('images/wepay.svg') }}" alt="We Pay">
|
<img src="{{ asset('images/wepay.svg') }}" alt="We Pay">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@livewire('wepay-signup', ['user_id' => $user_id, 'company' => $company])
|
@livewire('wepay-signup', ['user_id' => $user_id, 'company' => $user_company])
|
||||||
</div>
|
</div>
|
||||||
@endsection
|
@endsection
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user