Commit 4a6deb62 by Yvon Kerdoncuff

Merge branch '6709-prelevement-doublon-raison-date-effet-incorrecte' into 'develop'

avoid double payments by making sure recurring payment effect date is strictly…

See merge request cooperatic/kohinos-tav!113
parents 13a8e0c6 4e082805
......@@ -68,7 +68,11 @@ class CaptureAction implements ActionInterface, GatewayAwareInterface, GenericTo
$model['vads_page_action'] = 'REGISTER_PAY_SUBSCRIBE';
$model['vads_sub_amount'] = strval($payment->getRecurrenceAmount()); // 1000 for 10.00 EUR
$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
//Pour éviter les doublons de paiement, la date d'effet doit être ultérieure à recurrenceMonthDay.
//Ce jour étant calculé du point de vue du fuseau horaire du serveur,
//la date d'effet doit donc elle aussi être calculée dans le fuseau horaire du serveur, et non dans
//le fuseau horaire UTC.
$model['vads_sub_effect_date'] = (new \DateTime('tomorrow'))->format('Ymd'); // tomorrow, to avoid duplicate payment this day
//FOR TEST : $model['vads_sub_desc'] = 'RRULE:FREQ=DAILY;INTERVAL=1;COUNT=2';
$count = $payment->getRecurrenceMonthsCount() - 1; //initial payment is not considered by payzen as the first occurence
......
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