From f172e00d0a7b8a15cee04eda73077b534ef2f5e3 Mon Sep 17 00:00:00 2001 From: Constantin Simonis Date: Wed, 5 Mar 2025 10:45:10 +0100 Subject: [PATCH] chore: add success bool to success / cancel url --- .../de/szut/casino/deposit/DepositController.java | 12 +++--------- backend/src/main/resources/application.properties | 2 +- 2 files changed, 4 insertions(+), 10 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 c178867..6bc0fbc 100644 --- a/backend/src/main/java/de/szut/casino/deposit/DepositController.java +++ b/backend/src/main/java/de/szut/casino/deposit/DepositController.java @@ -3,20 +3,13 @@ package de.szut.casino.deposit; import com.stripe.Stripe; import com.stripe.exception.StripeException; import com.stripe.model.checkout.Session; -import com.stripe.param.InvoiceItemCreateParams; -import com.stripe.param.PriceCreateParams; import com.stripe.param.checkout.SessionCreateParams; import de.szut.casino.deposit.dto.AmountDto; import de.szut.casino.deposit.dto.SessionIdDto; import jakarta.validation.Valid; import org.springframework.beans.factory.annotation.Value; -import org.springframework.boot.autoconfigure.cassandra.CassandraProperties; -import org.springframework.http.HttpHeaders; import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestHeader; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; @RestController public class DepositController { @@ -38,7 +31,8 @@ public class DepositController { .setQuantity(1L) .setName("Einzahlung") .build()) - .setSuccessUrl(frontendHost+"/home") + .setSuccessUrl(frontendHost+"/home?success=true") + .setCancelUrl(frontendHost+"/home?success=false") .setMode(SessionCreateParams.Mode.PAYMENT) .build(); diff --git a/backend/src/main/resources/application.properties b/backend/src/main/resources/application.properties index 792244e..c7ccadf 100644 --- a/backend/src/main/resources/application.properties +++ b/backend/src/main/resources/application.properties @@ -4,7 +4,7 @@ spring.datasource.password=postgres_pass server.port=8080 spring.jpa.hibernate.ddl-auto=create-drop stripe.secret.key=${STRIPE_SECRET_KEY:sk_test_51QrePYIvCfqz7ANgqam8rEwWcMeKiLOof3j6SCMgu2sl4sESP45DJxca16mWcYo1sQaiBv32CMR6Z4AAAGQPCJo300ubuZKO8I} -app.frontend-host=http://localhost:3000 +app.frontend-host=http://localhost:4200 spring.application.name=lf12_starter #client registration configuration