Skip to content

Commit

Permalink
gestion du 3dsv2 sur le membership
Browse files Browse the repository at this point in the history
  • Loading branch information
agallou committed Jan 3, 2024
1 parent 98b8d55 commit 203b071
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
12 changes: 10 additions & 2 deletions sources/AppBundle/Controller/MemberShipController.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
use AppBundle\Compta\BankAccount\BankAccountFactory;
use AppBundle\GeneralMeeting\GeneralMeetingRepository;
use AppBundle\LegacyModelFactory;
use AppBundle\Payment\PayboxBilling;
use AppBundle\Payment\PayboxResponseFactory;
use AppBundle\TechLetter\Model\Repository\SendingRepository;
use Assert\Assertion;
Expand Down Expand Up @@ -122,10 +123,13 @@ public function paymentAction($invoiceNumber, $token)
throw $this->createNotFoundException(sprintf('Could not find the invoice "%s" with token "%s"', $invoiceNumber, $token));
}

$payboxBilling = new PayboxBilling($company->getFirstName(), $company->getLastName(), $company->getAddress(), $company->getZipCode(), $company->getCity(), $company->getCountryIso3166Numeric());

$paybox = $this->get(\AppBundle\Payment\PayboxFactory::class)->createPayboxForSubscription(
'F' . $invoiceNumber,
(float) $invoice['montant'],
$company->getEmail()
$company->getEmail(),
$payboxBilling
);

$bankAccountFactory = new BankAccountFactory($this->legacyConfiguration);
Expand Down Expand Up @@ -344,6 +348,7 @@ public function membershipFeeAction()
$cotisations = $this->getCotisations();

$identifiant = $this->getDroits()->obtenirIdentifiant();
/** @var User $user */
$user = $userRepository->get($identifiant);
Assertion::notNull($user);
$cotisation = $userService->getLastSubscription($user);
Expand Down Expand Up @@ -402,10 +407,13 @@ public function membershipFeeAction()

$reference = (new \AppBundle\Association\MembershipFeeReferenceGenerator())->generate(new \DateTimeImmutable('now'), $type_personne, $id_personne, $user->getLastName());

$payboxBilling = new PayboxBilling($user->getFirstName(), $user->getLastName(), $user->getAddress(), $user->getZipCode(), $user->getCity(), $user->getCountryIso3166Numeric());

$paybox = $this->get(\AppBundle\Payment\PayboxFactory::class)->createPayboxForSubscription(
$reference,
(float) $montant,
$user->getEmail()
$user->getEmail(),
$payboxBilling
);

$paybox = str_replace('INPUT TYPE=SUBMIT', 'INPUT TYPE=SUBMIT class="button button--call-to-action"', $paybox);
Expand Down
4 changes: 2 additions & 2 deletions sources/AppBundle/Payment/PayboxFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function __construct(RouterInterface $router, $payboxDomainServer, $paybo
*
* @return string html with payment button
*/
public function createPayboxForSubscription($facture, $montant, $email)
public function createPayboxForSubscription($facture, $montant, $email, PayboxBilling $billing)
{
$paybox = $this->getPaybox();

Expand All @@ -54,7 +54,7 @@ public function createPayboxForSubscription($facture, $montant, $email)
->setUrlRepondreA($this->router->generate('membership_payment', [], RouterInterface::ABSOLUTE_URL))
;

return $paybox->generate($now);
return $paybox->generate($now, $billing);
}

public function createPayboxForTicket(Invoice $invoice, Event $event)
Expand Down

0 comments on commit 203b071

Please sign in to comment.