diff --git a/app/Import/Transformer/Csv/InvoiceTransformer.php b/app/Import/Transformer/Csv/InvoiceTransformer.php index 50a85a0922ca..bd7d2543077e 100644 --- a/app/Import/Transformer/Csv/InvoiceTransformer.php +++ b/app/Import/Transformer/Csv/InvoiceTransformer.php @@ -36,6 +36,7 @@ class InvoiceTransformer extends BaseTransformer $invoiceStatusMap = [ 'sent' => Invoice::STATUS_SENT, 'draft' => Invoice::STATUS_DRAFT, + 'paid' => Invoice::STATUS_PAID, ]; $transformed = [ diff --git a/app/PaymentDrivers/Mollie/IDEAL.php b/app/PaymentDrivers/Mollie/IDEAL.php index 134853a6fe04..5645a23e786f 100644 --- a/app/PaymentDrivers/Mollie/IDEAL.php +++ b/app/PaymentDrivers/Mollie/IDEAL.php @@ -176,6 +176,19 @@ class IDEAL implements MethodInterface, LivewireMethodInterface */ public function processSuccessfulPayment(\Mollie\Api\Resources\Payment $payment, string $status = 'paid'): RedirectResponse { + $p = \App\Models\Payment::query() + ->withTrashed() + ->where('company_id', $this->mollie->client->company_id) + ->where('transaction_reference', $payment->id) + ->first(); + + if($p) { + $p->status_id = Payment::STATUS_COMPLETED; + $p->save(); + + return redirect()->route('client.payments.show', ['payment' => $p->hashed_id]); + } + $data = [ 'gateway_type_id' => GatewayType::IDEAL, 'amount' => array_sum(array_column($this->mollie->payment_hash->invoices(), 'amount')) + $this->mollie->payment_hash->fee_total, diff --git a/app/PaymentDrivers/MolliePaymentDriver.php b/app/PaymentDrivers/MolliePaymentDriver.php index 8f98a2faebd1..33e7fbb83c33 100644 --- a/app/PaymentDrivers/MolliePaymentDriver.php +++ b/app/PaymentDrivers/MolliePaymentDriver.php @@ -287,7 +287,7 @@ class MolliePaymentDriver extends BaseDriver { // Allow app to catch up with webhook request. // sleep(4); - usleep(rand(2800000, 4000000)); + usleep(rand(1500000, 4000000)); $validator = Validator::make($request->all(), [ 'id' => ['required', 'starts_with:tr'],