mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Set SEPA stripe token payments to pending
This commit is contained in:
parent
5de7d09541
commit
2845f2c79e
@ -17,11 +17,12 @@ use App\Jobs\Util\SystemLogger;
|
|||||||
use App\Models\ClientGatewayToken;
|
use App\Models\ClientGatewayToken;
|
||||||
use App\Models\GatewayType;
|
use App\Models\GatewayType;
|
||||||
use App\Models\Invoice;
|
use App\Models\Invoice;
|
||||||
|
use App\Models\Payment;
|
||||||
use App\Models\PaymentHash;
|
use App\Models\PaymentHash;
|
||||||
use App\Models\PaymentType;
|
use App\Models\PaymentType;
|
||||||
use App\Models\SystemLog;
|
use App\Models\SystemLog;
|
||||||
use App\PaymentDrivers\Stripe\ACH;
|
|
||||||
use App\PaymentDrivers\StripePaymentDriver;
|
use App\PaymentDrivers\StripePaymentDriver;
|
||||||
|
use App\PaymentDrivers\Stripe\ACH;
|
||||||
use App\Utils\Ninja;
|
use App\Utils\Ninja;
|
||||||
use App\Utils\Traits\MakesHash;
|
use App\Utils\Traits\MakesHash;
|
||||||
use Stripe\Exception\ApiConnectionException;
|
use Stripe\Exception\ApiConnectionException;
|
||||||
@ -137,8 +138,10 @@ class Charge
|
|||||||
|
|
||||||
if ($cgt->gateway_type_id == GatewayType::SEPA) {
|
if ($cgt->gateway_type_id == GatewayType::SEPA) {
|
||||||
$payment_method_type = PaymentType::SEPA;
|
$payment_method_type = PaymentType::SEPA;
|
||||||
|
$status = Payment::STATUS_PENDING;
|
||||||
} else {
|
} else {
|
||||||
$payment_method_type = $response->charges->data[0]->payment_method_details->card->brand;
|
$payment_method_type = $response->charges->data[0]->payment_method_details->card->brand;
|
||||||
|
$status = Payment::STATUS_COMPLETED;
|
||||||
}
|
}
|
||||||
|
|
||||||
$data = [
|
$data = [
|
||||||
@ -148,7 +151,7 @@ class Charge
|
|||||||
'amount' => $amount,
|
'amount' => $amount,
|
||||||
];
|
];
|
||||||
|
|
||||||
$payment = $this->stripe->createPayment($data);
|
$payment = $this->stripe->createPayment($data, $status);
|
||||||
$payment->meta = $cgt->meta;
|
$payment->meta = $cgt->meta;
|
||||||
$payment->save();
|
$payment->save();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user