mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04: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}");
|
nlog($auto_bill_partial_invoices->count(). " partial invoices to auto bill db = {$db}");
|
||||||
|
|
||||||
$auto_bill_partial_invoices->cursor()->each(function ($invoice){
|
$auto_bill_partial_invoices->cursor()->each(function ($invoice)use($db){
|
||||||
$this->runAutoBiller($invoice);
|
$this->runAutoBiller($invoice, $db);
|
||||||
});
|
});
|
||||||
|
|
||||||
$auto_bill_invoices = Invoice::whereDate('due_date', '<=', now())
|
$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}");
|
nlog($auto_bill_invoices->count(). " full invoices to auto bill db = {$db}");
|
||||||
|
|
||||||
$auto_bill_invoices->cursor()->each(function ($invoice){
|
$auto_bill_invoices->cursor()->each(function ($invoice) use($db){
|
||||||
$this->runAutoBiller($invoice);
|
$this->runAutoBiller($invoice, $db);
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -115,6 +115,7 @@ class AutoBillCron
|
|||||||
info("Firing autobill for {$invoice->company_id} - {$invoice->number}");
|
info("Firing autobill for {$invoice->company_id} - {$invoice->number}");
|
||||||
|
|
||||||
try{
|
try{
|
||||||
|
MultiDB::setDB($db);
|
||||||
$invoice->service()->autoBill()->save();
|
$invoice->service()->autoBill()->save();
|
||||||
}
|
}
|
||||||
catch(\Exception $e) {
|
catch(\Exception $e) {
|
||||||
|
@ -51,6 +51,7 @@ class Charge
|
|||||||
*/
|
*/
|
||||||
public function tokenBilling(ClientGatewayToken $cgt, PaymentHash $payment_hash)
|
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;
|
$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();
|
$invoice = Invoice::whereIn('id', $this->transformKeys(array_column($payment_hash->invoices(), 'invoice_id')))->withTrashed()->first();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user