fix: missing trad and clear payment session on error (#744)
This commit is contained in:
parent
5a370bc9aa
commit
06a76374bc
7 changed files with 25 additions and 11 deletions
|
|
@ -2,7 +2,7 @@
|
|||
apiVersion: batch/v1
|
||||
kind: CronJob
|
||||
metadata:
|
||||
name: {{ include "plateforme-ebs" . }}-cronjob-end-membership
|
||||
name: {{ include "plateforme-ebs" . }}-cronjob-end-p-membership
|
||||
labels:
|
||||
{{- include "plateforme-ebs.labels" . | nindent 4 }}
|
||||
spec:
|
||||
|
|
@ -23,7 +23,7 @@ spec:
|
|||
serviceAccountName: {{ include "plateforme-ebs.serviceAccountName" . }}
|
||||
restartPolicy: Never
|
||||
containers:
|
||||
- name: {{ .Chart.Name }}-cronjob-end-membership
|
||||
- name: {{ .Chart.Name }}-cronjob-end-p-membership
|
||||
image: "{{ .Values.php.image.repository }}:{{ .Values.php.image.tag | default .Chart.AppVersion }}"
|
||||
imagePullPolicy: {{ .Values.php.image.pullPolicy }}
|
||||
command: ['/bin/sh', '-c']
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
apiVersion: batch/v1
|
||||
kind: CronJob
|
||||
metadata:
|
||||
name: {{ include "plateforme-ebs" . }}-cronjob-notify-ms-e-1
|
||||
name: {{ include "plateforme-ebs" . }}-cronjob-notify-pms-e-1
|
||||
labels:
|
||||
{{- include "plateforme-ebs.labels" . | nindent 4 }}
|
||||
spec:
|
||||
|
|
@ -23,7 +23,7 @@ spec:
|
|||
serviceAccountName: {{ include "plateforme-ebs.serviceAccountName" . }}
|
||||
restartPolicy: Never
|
||||
containers:
|
||||
- name: {{ .Chart.Name }}-cronjob-notify-ms-e-1
|
||||
- name: {{ .Chart.Name }}-cronjob-notify-pms-e-1
|
||||
image: "{{ .Values.php.image.repository }}:{{ .Values.php.image.tag | default .Chart.AppVersion }}"
|
||||
imagePullPolicy: {{ .Values.php.image.pullPolicy }}
|
||||
command: ['/bin/sh', '-c']
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
apiVersion: batch/v1
|
||||
kind: CronJob
|
||||
metadata:
|
||||
name: {{ include "plateforme-ebs" . }}-cronjob-notify-ms-e-7
|
||||
name: {{ include "plateforme-ebs" . }}-cronjob-notify-pms-e-7
|
||||
labels:
|
||||
{{- include "plateforme-ebs.labels" . | nindent 4 }}
|
||||
spec:
|
||||
|
|
@ -23,7 +23,7 @@ spec:
|
|||
serviceAccountName: {{ include "plateforme-ebs.serviceAccountName" . }}
|
||||
restartPolicy: Never
|
||||
containers:
|
||||
- name: {{ .Chart.Name }}-cronjob-notify-ms-e-7
|
||||
- name: {{ .Chart.Name }}-cronjob-notify-pms-e-7
|
||||
image: "{{ .Values.php.image.repository }}:{{ .Values.php.image.tag | default .Chart.AppVersion }}"
|
||||
imagePullPolicy: {{ .Values.php.image.pullPolicy }}
|
||||
command: ['/bin/sh', '-c']
|
||||
|
|
|
|||
|
|
@ -359,7 +359,7 @@ abstract class AbstractUserCrudController extends AbstractCrudController impleme
|
|||
$vacationModeField = BooleanField::new('vacationMode');
|
||||
$addressField = AssociationField::new('address');
|
||||
$groupsCountField = AssociationField::new('userGroups')->setLabel('Groups number');
|
||||
$membershipPaidField = BooleanField::new('membershipPaid');
|
||||
$membershipPaidField = $this->getSimpleBooleanField('membershipPaid');
|
||||
$startAt = DateField::new('startAt');
|
||||
$endAt = DateField::new('endAt');
|
||||
$expiresInField = IntegerField::new('expiresIn')
|
||||
|
|
|
|||
|
|
@ -62,6 +62,7 @@ final class DoneAction extends AbstractController
|
|||
/** @var GetHumanStatus $status */
|
||||
$status = $this->commandBus->dispatch(new PlatformMembershipPaidCommand($platformOffer->getId(), $user->getId(), $token));
|
||||
|
||||
$request->getSession()->remove('payment_in_progress');
|
||||
// Not captured
|
||||
if (!$status->isCaptured()) {
|
||||
$this->addFlashWarning($this->translator->trans($this->getI18nPrefix().'.status.'.$status->getValue()));
|
||||
|
|
@ -73,8 +74,6 @@ final class DoneAction extends AbstractController
|
|||
'%platform%' => $platformOffer->getConfiguration()?->getPlatformName()],
|
||||
));
|
||||
|
||||
$request->getSession()->remove('payment_in_progress');
|
||||
|
||||
$group = $user->getMyGroupsAsInvited()->first();
|
||||
if ($group !== false) {
|
||||
return $this->redirectToRoute('app_group_show_logged', $group->getRoutingParameters());
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ class DoneActionTest extends TestCase
|
|||
$comandBus->method('dispatch')->willReturn(new GetHumanStatus(new PaymentToken()));
|
||||
|
||||
$doneAction = new DoneAction(
|
||||
$this->getCommandBus(),
|
||||
$comandBus,
|
||||
$payum,
|
||||
$translator,
|
||||
$this->getLogger(),
|
||||
|
|
@ -95,6 +95,7 @@ class DoneActionTest extends TestCase
|
|||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
$session->method('getFlashBag')->willReturn(new FlashBag());
|
||||
$session->method('remove')->with('payment_in_progress')->willReturn(true);
|
||||
|
||||
$requesStack = $this->getMockBuilder(RequestStack::class)
|
||||
->disableOriginalConstructor()
|
||||
|
|
@ -106,9 +107,13 @@ class DoneActionTest extends TestCase
|
|||
$container->method('get')->willReturn($requesStack);
|
||||
$doneAction->setContainer($container);
|
||||
|
||||
$request = new Request();
|
||||
$request->setSession($session);
|
||||
$requesStack->push($request);
|
||||
|
||||
$this->expectException(\Error::class); // or more mock are needed. To clean up later
|
||||
|
||||
$doneAction->__invoke(new Request(), $this->getPlatformOffer(), $this->getUser());
|
||||
$doneAction->__invoke($request, $this->getPlatformOffer(), $this->getUser());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -327,6 +327,11 @@
|
|||
<target>Informations</target>
|
||||
</trans-unit>
|
||||
|
||||
<trans-unit id="n4CnzfH" resname="panel.payment_information">
|
||||
<source>panel.payment_information</source>
|
||||
<target>Informations sur l'abonnement</target>
|
||||
</trans-unit>
|
||||
|
||||
<!-- Files and images -->
|
||||
<trans-unit id="AHzY4cd" resname="images.help">
|
||||
<source>images.help</source>
|
||||
|
|
@ -378,6 +383,11 @@
|
|||
<target>Abonnement à la plateforme payé</target>
|
||||
</trans-unit>
|
||||
|
||||
<trans-unit id="hgruegV" resname="Platform Offer">
|
||||
<source>Platform Offer</source>
|
||||
<target>Tarif d'adhésion</target>
|
||||
</trans-unit>
|
||||
|
||||
</body>
|
||||
</file>
|
||||
</xliff>
|
||||
|
|
|
|||
Loading…
Reference in a new issue