Additional logging for auto biller

This commit is contained in:
David Bomba 2021-09-03 15:38:20 +10:00
parent 95641177cc
commit e084e85eeb
2 changed files with 11 additions and 3 deletions

View File

@ -75,6 +75,10 @@ class Charge
'description' => $description, 'description' => $description,
]; ];
nlog("Stripe tokenBilling payload");
nlog($data);
$response = $this->stripe->createPaymentIntent($data, $this->stripe->stripe_connect_auth); $response = $this->stripe->createPaymentIntent($data, $this->stripe->stripe_connect_auth);
// $response = $local_stripe->paymentIntents->create($data); // $response = $local_stripe->paymentIntents->create($data);

View File

@ -51,12 +51,14 @@ class AutoBillInvoice extends AbstractService
/* Mark the invoice as paid if there is no balance */ /* Mark the invoice as paid if there is no balance */
if ((int)$this->invoice->balance == 0) if ((int)$this->invoice->balance == 0)
return $this->invoice->service()->markPaid()->save(); return $this->invoice->service()->markPaid()->workFlow()->save();
//if the credits cover the payments, we stop here, build the payment with credits and exit early //if the credits cover the payments, we stop here, build the payment with credits and exit early
if ($this->client->getSetting('use_credits_payment') != 'off') if ($this->client->getSetting('use_credits_payment') != 'off')
$this->applyCreditPayment(); $this->applyCreditPayment();
$amount = 0;
/* Determine $amount */ /* Determine $amount */
if ($this->invoice->partial > 0) { if ($this->invoice->partial > 0) {
$is_partial = true; $is_partial = true;
@ -68,14 +70,16 @@ class AutoBillInvoice extends AbstractService
return $this->invoice; return $this->invoice;
} }
info("balance remains to be paid!!"); info("Auto Bill - balance remains to be paid!! - {$amount}");
/* Retrieve the Client Gateway Token */ /* Retrieve the Client Gateway Token */
$gateway_token = $this->getGateway($amount); $gateway_token = $this->getGateway($amount);
/* Bail out if no payment methods available */ /* Bail out if no payment methods available */
if (! $gateway_token || ! $gateway_token->gateway->driver($this->client)->token_billing) if (! $gateway_token || ! $gateway_token->gateway->driver($this->client)->token_billing){
nlog("Bailing out - no suitable gateway token found.");
return $this->invoice; return $this->invoice;
}
/* $gateway fee */ /* $gateway fee */
//$fee = $gateway_token->gateway->calcGatewayFee($amount, $gateway_token->gateway_type_id, $this->invoice->uses_inclusive_taxes); //$fee = $gateway_token->gateway->calcGatewayFee($amount, $gateway_token->gateway_type_id, $this->invoice->uses_inclusive_taxes);