mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 13:12:50 +01:00
Fixes for stripe
This commit is contained in:
parent
e084e85eeb
commit
592387874e
@ -89,8 +89,8 @@ class AutoBillCron
|
||||
|
||||
nlog($auto_bill_partial_invoices->count(). " partial invoices to auto bill db = {$db}");
|
||||
|
||||
$auto_bill_partial_invoices->cursor()->each(function ($invoice){
|
||||
$this->runAutoBiller($invoice);
|
||||
$auto_bill_partial_invoices->cursor()->each(function ($invoice)use($db){
|
||||
$this->runAutoBiller($invoice, $db);
|
||||
});
|
||||
|
||||
$auto_bill_invoices = Invoice::whereDate('due_date', '<=', now())
|
||||
@ -102,8 +102,8 @@ class AutoBillCron
|
||||
|
||||
nlog($auto_bill_invoices->count(). " full invoices to auto bill db = {$db}");
|
||||
|
||||
$auto_bill_invoices->cursor()->each(function ($invoice){
|
||||
$this->runAutoBiller($invoice);
|
||||
$auto_bill_invoices->cursor()->each(function ($invoice) use($db){
|
||||
$this->runAutoBiller($invoice, $db);
|
||||
});
|
||||
|
||||
}
|
||||
@ -115,6 +115,7 @@ class AutoBillCron
|
||||
info("Firing autobill for {$invoice->company_id} - {$invoice->number}");
|
||||
|
||||
try{
|
||||
MultiDB::setDB($db);
|
||||
$invoice->service()->autoBill()->save();
|
||||
}
|
||||
catch(\Exception $e) {
|
||||
|
@ -51,6 +51,7 @@ class Charge
|
||||
*/
|
||||
public function tokenBilling(ClientGatewayToken $cgt, PaymentHash $payment_hash)
|
||||
{
|
||||
nlog(" DB = ".$this->stripe->client->company->db);
|
||||
$amount = array_sum(array_column($payment_hash->invoices(), 'amount')) + $payment_hash->fee_total;
|
||||
$invoice = Invoice::whereIn('id', $this->transformKeys(array_column($payment_hash->invoices(), 'invoice_id')))->withTrashed()->first();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user