Skip to content

Commit

Permalink
Update src from PHP Codesniffer
Browse files Browse the repository at this point in the history
  • Loading branch information
GitHub Actions committed Apr 17, 2023
1 parent 996d023 commit 17f6f17
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/Service/PaymentService.php
Original file line number Diff line number Diff line change
Expand Up @@ -328,10 +328,10 @@ public function createPayment(): ?array
// @TODO add the values amount from huwelijk object etc to array
$paymentSchema = $this->gatewayResourceService->getSchema('https://huwelijksplanner.nl/schemas/hp.mollie.schema.json', 'common-gateway/huwelijksplanner-bundle');

$redirectUrl = null;
$redirectUrl = null;
$application = $this->entityManager->getRepository('App:Application')->findOneBy(['reference' => 'https://huwelijksplanner.nl/application/hp.frontend.application.json']);
if ($application !== null && $application->getDomains() !== null && count($application->getDomains()) > 0) {
$domain = $application->getDomains()[0];
$domain = $application->getDomains()[0];
$redirectUrl = 'https://'.$domain.'/voorgenomen-huwelijk/betalen/betaalstatus-verificatie';
}

Expand All @@ -344,27 +344,29 @@ public function createPayment(): ?array
$productPrices = $this->getSDGProductPrices($huwelijkObject->toArray());

$paymentObject = new ObjectEntity($paymentSchema);
$paymentArray = [
$paymentArray = [
'amount' => [
'currency' => 'EUR',
'value' => $this->calculatePrice($productPrices, 'EUR'), // Calculate new price
'value' => $this->calculatePrice($productPrices, 'EUR'),
// Calculate new price
],
'description' => 'Payment made for huwelijk with id: '.$huwelijkObject->getId()->toString(),
'redirectUrl' => $redirectUrl,
'webhookUrl' => $this->configuration['webhookUrl'],
'method' => $this->configuration['method'],
'status' => 'paid' // @TODO temporary set the status to paid
'status' => 'paid',
// @TODO temporary set the status to paid
];
$paymentObject->hydrate($paymentArray);
$this->entityManager->persist($paymentObject);
$this->entityManager->flush();

// return $this->createMolliePayment($paymentArray);
// todo: temporary, redirect to return [redirectUrl]. Instead of this $paymentArray and return^

return [
'paymentId' => $paymentObject->getId()->toString(),
'redirectUrl' => $paymentObject->getValue('redirectUrl') // @TODO set redirectUrl to the checkout url
'paymentId' => $paymentObject->getId()->toString(),
'redirectUrl' => $paymentObject->getValue('redirectUrl'),
// @TODO set redirectUrl to the checkout url
];

}//end createPayment()
Expand Down

0 comments on commit 17f6f17

Please sign in to comment.