Skip to content

Commit

Permalink
First attempt with stripe
Browse files Browse the repository at this point in the history
  • Loading branch information
ciukstar committed Dec 1, 2023
1 parent 9afd44c commit cb92fe5
Show file tree
Hide file tree
Showing 30 changed files with 443 additions and 186 deletions.
14 changes: 13 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,22 @@ RUN mkdir -p /opt/salon \
&& apt-get install -y --no-install-recommends build-essential zlib1g-dev libpq-dev libicu-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

ARG YESOD_DEMO_LANG=EN
ARG YESOD_MAPBOX_PK
ARG YESOD_STRIPE_PK
ARG YESOD_STRIPE_SK

WORKDIR /opt/salon
COPY salon /opt/salon
COPY static /opt/salon/static
COPY config /opt/salon/config
ENV YESOD_PORT=8080 YESOD_DEMO_LANG=EN

ENV YESOD_PORT=8080
ENV YESOD_DEMO_LANG=${YESOD_DEMO_LANG}
ENV YESOD_MAPBOX_PK=${YESOD_MAPBOX_PK}
ENV YESOD_STRIPE_PK=${YESOD_STRIPE_PK}
ENV YESOD_STRIPE_SK=${YESOD_STRIPE_SK}

EXPOSE 8080
CMD ["./salon"]
13 changes: 0 additions & 13 deletions DockerfileFR

This file was deleted.

13 changes: 0 additions & 13 deletions DockerfileRO

This file was deleted.

13 changes: 0 additions & 13 deletions DockerfileRU

This file was deleted.

12 changes: 12 additions & 0 deletions README.fr.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,18 @@ Tout utilisateur également enregistré en tant que membre du personnel a le rô

Tous les utilisateurs peuvent devenir clients par simple inscription et utilisation des services proposés.

## Intégration avec des API externes

* Passerelle de paiement: [Stripe](https://stripe.com/)
```
ENV: YESOD_STRIPE_PK, YESOD_STRIPE_SK
```

* Cartes en ligne: [Mapbox](https://www.mapbox.com/)
```
ENV: YESOD_MAPBOX_PK
```

## Diagramme ERD

![Diagramme entité-relation](static/img/Salon-ERD.svg)
Expand Down
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,17 @@ Any user who is also registered as a staff member has the role "Employee". A use
All users can become customers by simply registering and using the services offered.


## Integration with external APIs

* Payment gateway: [Stripe](https://stripe.com/)
```
ENV: YESOD_STRIPE_PK, YESOD_STRIPE_SK
```
* Online maps: [Mapbox](https://www.mapbox.com/)
```
ENV: YESOD_MAPBOX_PK
```

## ERD Diagram

![Entity Relationship Diagram](static/img/Salon-ERD.svg)
Expand Down
11 changes: 11 additions & 0 deletions README.ro.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,17 @@ Orice utilizator care este înregistrat și ca membru al personalului are rolul

Toți utilizatorii pot deveni clienți prin simpla înregistrare și utilizarea serviciilor oferite.

## Integrare cu API-uri externe
* Gateway de plată: [Stripe](https://stripe.com/)
```
ENV: YESOD_STRIPE_PK, YESOD_STRIPE_SK
```

* Hărți online: [Mapbox](https://www.mapbox.com/)
```
ENV: YESOD_MAPBOX_PK
```


## Diagrama ERD

Expand Down
11 changes: 11 additions & 0 deletions README.ru.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,17 @@

Все пользователи могут стать клиентами, просто зарегистрировавшись и воспользовавшись предлагаемыми услугами.

## Интеграция с внешними API
* Платежный шлюз: [Stripe](https://stripe.com/)
```
ENV: YESOD_STRIPE_PK, YESOD_STRIPE_SK
```

* Онлайн карты: [Mapbox](https://www.mapbox.com/)
```
ENV: YESOD_MAPBOX_PK
```

## ER-диаграмма

![Диаграмма отношений сущностей](static/img/Salon-ERD.svg)
Expand Down
3 changes: 1 addition & 2 deletions config/routes.yesodroutes
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,10 @@

/book/search BookSearchR GET POST
/book/end BookEndR GET
/book/#UserId/pi/#Text BookPaymentIntentCancelR POST
/book/#UserId/pi/cancel BookPaymentIntentCancelR POST
/book/#UserId/pay-completion BookPayCompletionR GET
/book/#UserId/pi/#Int/#Text BookPaymentIntentR POST
/book/#UserId/pay-now BookPayNowR GET
/book/#UserId/pay-at-venue BookPayAtVenueR GET
/book/#UserId/pay BookPayR GET POST
/book/customer BookCustomerR GET POST
/book/time BookTimeR GET POST
Expand Down
6 changes: 5 additions & 1 deletion messages/en.msg
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
OnlineMaps: Online maps
PaymentGateway: Payment gateway
PaymentIntentCancelled: Payment intent was cancelled
Pay: Pay
PaymentAmount: Payment amount
Expand Down Expand Up @@ -409,4 +411,6 @@ Doc012: An administrator can assign the role "Analyst" to any other registered u

Doc013: Any user who is also registered as a staff member has the role "Employee". A user with the role "Employee" has access to the service request queue.

Doc014: All users can become customers by simply registering and using the services offered.
Doc014: All users can become customers by simply registering and using the services offered.

Doc015: Integration with external APIs
6 changes: 5 additions & 1 deletion messages/fr.msg
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
OnlineMaps: Cartes en ligne
PaymentGateway: Passerelle de paiement
PaymentIntentCancelled: L'intention de paiement a été annulée
Pay: Payez
PaymentAmount: Montant du paiement
Expand Down Expand Up @@ -411,4 +413,6 @@ Doc012: Un administrateur peut attribuer le rôle « Analyste » à tout autre

Doc013: Tout utilisateur également enregistré en tant que membre du personnel a le rôle "Employé". Un utilisateur avec le rôle « Employé » a accès à la file d'attente des demandes de service.

Doc014: Tous les utilisateurs peuvent devenir clients par simple inscription et utilisation des services proposés.
Doc014: Tous les utilisateurs peuvent devenir clients par simple inscription et utilisation des services proposés.

Doc015: Intégration avec des API externes
6 changes: 5 additions & 1 deletion messages/ro.msg
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
OnlineMaps: Hărți online
PaymentGateway: Gateway de plată
PaymentIntentCancelled: Intenția de plată a fost anulată
Pay: Plătiți
PaymentAmount: Suma de plată
Expand Down Expand Up @@ -411,4 +413,6 @@ Doc012: Un administrator poate atribui rolul „Analist” oricărui alt utiliza

Doc013: Orice utilizator care este înregistrat și ca membru al personalului are rolul „Angajat”. Un utilizator cu rolul „Angajat” are acces la coada de solicitări de servicii.

Doc014: Toți utilizatorii pot deveni clienți prin simpla înregistrare și utilizarea serviciilor oferite.
Doc014: Toți utilizatorii pot deveni clienți prin simpla înregistrare și utilizarea serviciilor oferite.

Doc015: Integrare cu API-uri externe
6 changes: 5 additions & 1 deletion messages/ru.msg
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
OnlineMaps: Онлайн карты
PaymentGateway: Платежный шлюз
PaymentIntentCancelled: Намерение платежа было отменено
Pay: Заплатить
PaymentAmount: Сумма платежа
Expand Down Expand Up @@ -411,4 +413,6 @@ Doc012: Администратор может назначить роль «Ан

Doc013: Любой пользователь, который также зарегистрирован как сотрудник, имеет роль «Сотрудник». Пользователь с ролью «Сотрудник» имеет доступ к очереди запросов на обслуживание.

Doc014: Все пользователи могут стать клиентами, просто зарегистрировавшись и воспользовавшись предлагаемыми услугами.
Doc014: Все пользователи могут стать клиентами, просто зарегистрировавшись и воспользовавшись предлагаемыми услугами.

Doc015: Интеграция с внешними API
1 change: 0 additions & 1 deletion src/Application.hs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ import Handler.Book
, getBookTimeR, postBookTimeR
, getBookCustomerR, postBookCustomerR
, getBookPayR, postBookPayR
, getBookPayAtVenueR
, getBookPayNowR, postBookPaymentIntentR
, postBookPaymentIntentCancelR, getBookPayCompletionR
, getBookEndR
Expand Down
3 changes: 1 addition & 2 deletions src/Foundation.hs
Original file line number Diff line number Diff line change
Expand Up @@ -230,11 +230,10 @@ instance Yesod App where
isAuthorized ContactR _ = return Authorized

isAuthorized BookEndR _ = return Authorized
isAuthorized (BookPaymentIntentCancelR _ _) _ = isAuthenticated
isAuthorized (BookPaymentIntentCancelR _) _ = isAuthenticated
isAuthorized (BookPayCompletionR _) _ = isAuthenticated
isAuthorized (BookPaymentIntentR {}) _ = isAuthenticated
isAuthorized (BookPayNowR _) _ = isAuthenticated
isAuthorized (BookPayAtVenueR _) _ = isAuthenticated
isAuthorized (BookPayR _) _ = isAuthenticated
isAuthorized BookCustomerR _ = return Authorized
isAuthorized BookTimeR _ = return Authorized
Expand Down
Loading

0 comments on commit cb92fe5

Please sign in to comment.