Skip to content
This repository has been archived by the owner on Jul 26, 2024. It is now read-only.

Commit

Permalink
docker compose add service stripe
Browse files Browse the repository at this point in the history
  • Loading branch information
fayssalmechmeche committed Jul 1, 2024
1 parent f045e7d commit 8032d99
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ dist
dist-ssr
*.local


# Editor directories and files
.vscode/*
!.vscode/extensions.json
Expand All @@ -23,3 +24,4 @@ dist-ssr
*.sln
*.sw?
*.code-workspace
.env
2 changes: 1 addition & 1 deletion backend/app/services/CheckoutService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export class CheckoutService {
metadata: { userId: userId },
line_items: products,
mode: 'payment',
cancel_url: 'http://localhost:5173/checkout/cancelled',
cancel_url: 'http://localhost:5173/checkout/cancel',
success_url: 'http://localhost:5173/checkout/success',
});
return session;
Expand Down
3 changes: 1 addition & 2 deletions backend/app/services/StripeService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,9 @@ export class StripeService {
}
case 'checkout.session.expired': {
const checkoutSessionCancelled = event.data.object;

CheckoutService.updateOrder(
'sneakpeak-' + checkoutSessionCancelled.id,
'cancelled',
'expired',
'unpaid',
);

Expand Down
8 changes: 8 additions & 0 deletions compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,14 @@ services:
depends_on:
- mongo

stripe_cli:
image: stripe/stripe-cli
depends_on:
- backend
volumes:
- ./stripe:/root/.config/stripe
command: listen --forward-to http://backend/webhook --api-key $STRIPE_SECRET_KEY

volumes:
postgres:
mongo:

0 comments on commit 8032d99

Please sign in to comment.