Skip to content

Commit

Permalink
Persist the data after PaymentServiceProviderServiceInterface::start()
Browse files Browse the repository at this point in the history
It currrently only persists the data before calling out to the connector,
this means the connector payment changes won't get saved to the DB
(it currently doesn't do any changes, but we want to update the status
in there in the future)
  • Loading branch information
lazka committed Oct 5, 2023
1 parent a716903 commit 675314e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Service/PaymentService.php
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,9 @@ public function startPayAction(StartPayAction $startPayAction): StartResponseInt

$paymentPersistence->setStartedAt($now);

$paymentServiceProvider = $this->paymentServiceProviderService->getByPaymentContract($paymentContract);
$startResponse = $paymentServiceProvider->start($paymentPersistence);

try {
$this->em->persist($paymentPersistence);
$this->em->flush();
Expand All @@ -432,9 +435,6 @@ public function startPayAction(StartPayAction $startPayAction): StartResponseInt
throw new ApiError(Response::HTTP_INTERNAL_SERVER_ERROR, 'Payment could not be updated!');
}

$paymentServiceProvider = $this->paymentServiceProviderService->getByPaymentContract($paymentContract);
$startResponse = $paymentServiceProvider->start($paymentPersistence);

return $startResponse;
}

Expand Down

0 comments on commit 675314e

Please sign in to comment.