/** * @param Payment $payment * * @return void * * @throws SavePaymentFailedException */ public function markAsPaid(Payment $payment) { $connection = $this->getConnection(); $table = $this->getTableName(); try { $connection->update($table, ['paid' => true, 'gateway_id' => $payment->getGatewayId()], ['id' => $payment->id()]); } catch (\Exception $exception) { throw SavePaymentFailedException::createWithPayment($payment, sprintf('Unable to mark payment #%s as paid', $payment->id()), 0, $exception); } }