diff --git a/README.md b/README.md index 5fa2db4..3f2b3a4 100644 --- a/README.md +++ b/README.md @@ -90,6 +90,20 @@ npm run dev The frontend will be available at http://localhost:4200 +### Local Stripe integration +1. Install the Stripe CLI + https://stripe.com/docs/stripe-cli + +2. Login to the casino stripe account +``` +stripe login --api-key +``` + +3. Start webhook forwarding +``` +stripe listen --forward-to localhost:8080/webhook +``` + ## Database Management ### Postgres Management diff --git a/frontend/src/app/feature/home/home.component.ts b/frontend/src/app/feature/home/home.component.ts index 88fe552..5baf2a0 100644 --- a/frontend/src/app/feature/home/home.component.ts +++ b/frontend/src/app/feature/home/home.component.ts @@ -5,7 +5,7 @@ import { Game } from '../../model/Game'; import { Transaction } from '../../model/Transaction'; import { DepositComponent } from '../deposit/deposit.component'; import { ConfirmationComponent } from '../../shared/components/confirmation/confirmation.component'; -import { ActivatedRoute } from '@angular/router'; +import { ActivatedRoute, Router } from '@angular/router'; @Component({ selector: 'app-homepage', @@ -18,10 +18,16 @@ export default class HomeComponent implements OnInit { isDepositModalOpen = false; isDepositSuccessful = false; - constructor(public route: ActivatedRoute) {} + constructor( + public route: ActivatedRoute, + public router: Router + ) {} ngOnInit() { this.isDepositSuccessful = this.route.snapshot.queryParams['success'] == 'true'; + + this.router.navigate([], { queryParams: {} }); + if (this.isDepositSuccessful) { this.openDepositConfirmationModal(); }