From 204970856baa4e05c8138e7e2bcf6329e64e6d2e Mon Sep 17 00:00:00 2001 From: Constantin Simonis Date: Wed, 5 Mar 2025 08:57:14 +0100 Subject: [PATCH] fix: add correct redirect url after deposit --- .../java/de/szut/casino/deposit/DepositController.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/backend/src/main/java/de/szut/casino/deposit/DepositController.java b/backend/src/main/java/de/szut/casino/deposit/DepositController.java index 0e1ade5..0312981 100644 --- a/backend/src/main/java/de/szut/casino/deposit/DepositController.java +++ b/backend/src/main/java/de/szut/casino/deposit/DepositController.java @@ -24,11 +24,11 @@ public class DepositController { @Value("${stripe.secret.key}") private String stripeKey; + @Value("${frontend.host}") + private String frontendHost; + @PostMapping("/deposit/checkout") - public ResponseEntity checkout( - @RequestBody @Valid AmountDto amountDto, - @RequestHeader("Origin") String origin - ) throws StripeException { + public ResponseEntity checkout(@RequestBody @Valid AmountDto amountDto) throws StripeException { Stripe.apiKey = stripeKey; SessionCreateParams params = SessionCreateParams.builder() @@ -38,7 +38,7 @@ public class DepositController { .setQuantity(1L) .setName("Einzahlung") .build()) - .setSuccessUrl(origin+"/deposit/success") + .setSuccessUrl(frontendHost+"/deposit/success") .setMode(SessionCreateParams.Mode.PAYMENT) .build();