✨ feat(ansible): Ajoute STRIPE_BASEURL et tâche cron pour synchroniser Stripe.
🐛 fix(CustomerController): Crée le client Stripe lors de l'ajout d'un client.
This commit is contained in:
@@ -87,6 +87,7 @@
|
|||||||
VAULT_TOKEN=hvs.QLpUdiptXtSPo5Qf7i2nn2Xz
|
VAULT_TOKEN=hvs.QLpUdiptXtSPo5Qf7i2nn2Xz
|
||||||
MAILER_DSN=ses+smtp://AKIAWTT2T22CWBRBBDYN:BBdgb6KxRQ8mNcpWFJsZCJxbSGNdgLhKFiITMErfBlQP@default?region=eu-west-3
|
MAILER_DSN=ses+smtp://AKIAWTT2T22CWBRBBDYN:BBdgb6KxRQ8mNcpWFJsZCJxbSGNdgLhKFiITMErfBlQP@default?region=eu-west-3
|
||||||
PATH_URL=https://intranet.ludikevent.fr
|
PATH_URL=https://intranet.ludikevent.fr
|
||||||
|
STRIPE_BASEURL=https://intranet.ludikevent.fr
|
||||||
dest: "{{ path }}/.env.local"
|
dest: "{{ path }}/.env.local"
|
||||||
when: ansible_os_family == "Debian"
|
when: ansible_os_family == "Debian"
|
||||||
|
|
||||||
@@ -214,6 +215,13 @@
|
|||||||
minute: "*/5"
|
minute: "*/5"
|
||||||
job: "php {{ path }}/bin/console app:search"
|
job: "php {{ path }}/bin/console app:search"
|
||||||
user: root
|
user: root
|
||||||
|
- name: "Cron Task Search"
|
||||||
|
ansible.builtin.cron:
|
||||||
|
name: "Intranet Ludikevent - Stripe"
|
||||||
|
minute: "0"
|
||||||
|
hour: "1"
|
||||||
|
job: "php {{ path }}/bin/console app:stripe:sync"
|
||||||
|
user: root
|
||||||
- name: "Cron Task Search"
|
- name: "Cron Task Search"
|
||||||
ansible.builtin.cron:
|
ansible.builtin.cron:
|
||||||
name: "Intranet Ludikevent - Backup"
|
name: "Intranet Ludikevent - Backup"
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ use App\Entity\Customer;
|
|||||||
use App\Form\CustomerType;
|
use App\Form\CustomerType;
|
||||||
use App\Logger\AppLogger;
|
use App\Logger\AppLogger;
|
||||||
use App\Repository\CustomerRepository;
|
use App\Repository\CustomerRepository;
|
||||||
|
use App\Service\Search\Client;
|
||||||
use Doctrine\ORM\EntityManagerInterface;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Knp\Component\Pager\PaginatorInterface;
|
use Knp\Component\Pager\PaginatorInterface;
|
||||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||||
@@ -44,7 +45,7 @@ class CustomerController extends AbstractController
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
#[Route(path: '/crm/customer/add', name: 'app_crm_customer_add', methods: ['GET', 'POST'])]
|
#[Route(path: '/crm/customer/add', name: 'app_crm_customer_add', methods: ['GET', 'POST'])]
|
||||||
public function add(Request $request, EntityManagerInterface $entityManager): Response
|
public function add(Request $request, EntityManagerInterface $entityManager,\App\Service\Stripe\Client $client): Response
|
||||||
{
|
{
|
||||||
$this->appLogger->record('VIEW', 'Consultation de la page de création client');
|
$this->appLogger->record('VIEW', 'Consultation de la page de création client');
|
||||||
|
|
||||||
@@ -58,6 +59,7 @@ class CustomerController extends AbstractController
|
|||||||
$entityManager->persist($customer);
|
$entityManager->persist($customer);
|
||||||
$entityManager->flush();
|
$entityManager->flush();
|
||||||
|
|
||||||
|
$client->createCustomer($customer);
|
||||||
// 2. Log de l'action de création
|
// 2. Log de l'action de création
|
||||||
$this->appLogger->record('CREATE', sprintf(
|
$this->appLogger->record('CREATE', sprintf(
|
||||||
'Nouveau client créé : %s %s (Type: %s)',
|
'Nouveau client créé : %s %s (Type: %s)',
|
||||||
|
|||||||
Reference in New Issue
Block a user