1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-12 22:22:32 +01:00

improve off session token billing with stripe

This commit is contained in:
David Bomba 2022-12-05 13:19:36 +11:00
parent b1b9b5d120
commit 252416a5b0

View File

@ -79,7 +79,7 @@ class Charge
'payment_method' => $cgt->token,
'customer' => $cgt->gateway_customer_reference,
'confirm' => true,
'off_session' => true,
// 'off_session' => true,
'description' => $description,
'metadata' => [
'payment_hash' => $payment_hash->hash,
@ -91,6 +91,11 @@ class Charge
$data['payment_method_types'] = ['sepa_debit'];
}
/* Should improve token billing with client not present */
if (!auth()->guard('contact')->check()) {
$data['off_session'] = true;
}
$response = $this->stripe->createPaymentIntent($data, $this->stripe->stripe_connect_auth);
SystemLogger::dispatch($response, SystemLog::CATEGORY_GATEWAY_RESPONSE, SystemLog::EVENT_GATEWAY_SUCCESS, SystemLog::TYPE_STRIPE, $this->stripe->client, $this->stripe->client->company);