Commit c99bbd06 by Yvon

fix payment occurence to take into account first payment, set back payzen config…

fix payment occurence to take into account first payment, set back payzen config and cotiz limitation to prod mode
parent fcf65aff
...@@ -70,11 +70,11 @@ class CaptureAction implements ActionInterface, GatewayAwareInterface, GenericTo ...@@ -70,11 +70,11 @@ class CaptureAction implements ActionInterface, GatewayAwareInterface, GenericTo
$model['vads_sub_amount'] = strval($payment->getRecurrenceAmount()); // 1000 for 10.00 EUR $model['vads_sub_amount'] = strval($payment->getRecurrenceAmount()); // 1000 for 10.00 EUR
$model['vads_sub_currency'] = $model['vads_currency']; $model['vads_sub_currency'] = $model['vads_currency'];
$model['vads_sub_effect_date'] = (new \DateTime('tomorrow', new \DateTimeZone('UTC')))->format('Ymd'); // tomorrow, to avoid duplicate payment this day $model['vads_sub_effect_date'] = (new \DateTime('tomorrow', new \DateTimeZone('UTC')))->format('Ymd'); // tomorrow, to avoid duplicate payment this day
$model['vads_sub_desc'] = 'RRULE:FREQ=DAILY;INTERVAL=1;COUNT=2'; //FOR TEST : $model['vads_sub_desc'] = 'RRULE:FREQ=DAILY;INTERVAL=1;COUNT=2';
// $monthsCount = $payment->getRecurrenceMonthsCount(); $count = $payment->getRecurrenceMonthsCount() - 1; //initial payment is not considered by payzen as the first occurence
// $monthDay = $payment->getRecurrenceMonthDay(); $monthDay = $payment->getRecurrenceMonthDay();
// $model['vads_sub_desc'] = "RRULE:FREQ=MONTHLY;COUNT={$monthsCount};BYMONTHDAY={$monthDay}"; $model['vads_sub_desc'] = "RRULE:FREQ=MONTHLY;COUNT={$count};BYMONTHDAY={$monthDay}";
} }
} }
......
...@@ -130,7 +130,7 @@ class UserAdherentController extends FluxController ...@@ -130,7 +130,7 @@ class UserAdherentController extends FluxController
private function paiementCotisTavValidation($flux) { private function paiementCotisTavValidation($flux) {
// Look for existing cotisation // Look for existing cotisation
if ($this->tavCotisationsUtils->checkExistingCotisation($flux)) { if ($this->tavCotisationsUtils->checkExistingCotisation($flux)) {
// return "Cotisation déjà payée ce mois-ci."; return "Cotisation déjà payée ce mois-ci.";
} }
$destinataire = $flux->getDestinataire(); $destinataire = $flux->getDestinataire();
......
...@@ -12,6 +12,7 @@ use Symfony\Component\Form\Extension\Core\Type\IntegerType; ...@@ -12,6 +12,7 @@ use Symfony\Component\Form\Extension\Core\Type\IntegerType;
use Symfony\Component\Form\Extension\Core\Type\SubmitType; use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver; use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Validator\Constraints\GreaterThanOrEqual;
class AchatMonnaieAdherentRecurrentFormType extends AchatMonnaieAdherentFormType class AchatMonnaieAdherentRecurrentFormType extends AchatMonnaieAdherentFormType
{ {
...@@ -27,7 +28,10 @@ class AchatMonnaieAdherentRecurrentFormType extends AchatMonnaieAdherentFormType ...@@ -27,7 +28,10 @@ class AchatMonnaieAdherentRecurrentFormType extends AchatMonnaieAdherentFormType
'label' => 'Nombre d\'échéances désirées : ', 'label' => 'Nombre d\'échéances désirées : ',
'required' => true, 'required' => true,
'mapped' => false, 'mapped' => false,
'help' => "Une échéance par mois.", 'constraints' => [
new GreaterThanOrEqual(['value' => 2]),
],
'help' => "Une échéance par mois. Le premier paiement compte comme la première échéance.",
'attr' => ['autocomplete' => 'off'] 'attr' => ['autocomplete' => 'off']
]) ])
->add('jourPrelevement', ChoiceType::class, [ ->add('jourPrelevement', ChoiceType::class, [
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment