1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 05:02:36 +01:00

add pending as valid refund state for Stripe

This commit is contained in:
David Bomba 2023-05-23 23:27:28 +10:00
parent a7ad937e84
commit 55f72ba450
2 changed files with 7 additions and 2 deletions

View File

@ -617,7 +617,7 @@ class StripePaymentDriver extends BaseDriver
'amount' => $this->convertToStripeAmount($amount, $this->client->currency()->precision, $this->client->currency()),
], $meta);
if ($response->status == $response::STATUS_SUCCEEDED) {
if (in_array($response->status, [$response::STATUS_SUCCEEDED, 'pending'])) {
SystemLogger::dispatch(['server_response' => $response, 'data' => request()->all()], SystemLog::CATEGORY_GATEWAY_RESPONSE, SystemLog::EVENT_GATEWAY_SUCCESS, SystemLog::TYPE_STRIPE, $this->client, $this->client->company);
return [
@ -712,6 +712,11 @@ class StripePaymentDriver extends BaseDriver
}
if ($payment) {
if(isset($transaction['payment_method_details']['au_becs_debit'])) {
$payment->transaction_reference = $transaction['id'];
}
$payment->status_id = Payment::STATUS_COMPLETED;
$payment->save();
}

View File

@ -76,7 +76,7 @@ trait CleanLineItems
}
if (array_key_exists('id', $item)) {
if (array_key_exists('id', $item) || array_key_exists('_id', $item)) {
unset($item['id']);
}