Commit: e6d1548

Commit Details

SHAe6d1548c463d8763fb5547ff07a35c521f15c296
Tree2d2b62527861022ccf13eb205ea2bf7c0e4013fd
Author<f69e50@finnacloud.com> 1766442769 +0300
Committer<f69e50@finnacloud.com> 1766442769 +0300
Message
add initial test workflow file
GPG Signature
-----BEGIN PGP SIGNATURE-----

iQJSBAABCAA8FiEEWJb139mJI+vZ81KkoAIVSUsXI0oFAmlJxxEeHHNvcGhpYS5l
cmFzbGFuQGZpbm5hY2xvdWQuY29tAAoJEKACFUlLFyNKb7YP/2QctdaPuHu4+vFn
fh0Opgqt1brKy9JQxV9JZ9tF5XA+rWVi6pyIZK4lywX+a4er+h29sQY7TEHZt9Xn
meAyRUhPbRPmIpRJMMCgstfILUpjNMkMcPE80kJfpp6+ZmLtO8vC4TnW3ATCK1tv
XISV00T4ajCAhZUmYTveNsvSiMMv/Tq4sF9Is4ix+JN7O/lSLseRtuUE1Vv7T7nY
citxLPwR42Eb/1CYhy0JbRYXP816cbe6dGeDeiDZp7EHKx5D8VAqULKRsAL19tSX
hup8N7owBXieuzNQ4RyaDfDJAfNoN3o9pFeD6vQPq8s7x6AloN625g58p0ssxfK+
CGhR0YHR7atR0pEens22p7g2dVJ7NsrKqDBE3TTeUOpfXfjOwqpVh1Bn/v7a2Vg9
o9mhIClSOLfYv2SXJ06+fn8l6oc70nLJkBfcTevmeF//Z9yGH7TXZNUcedxuBbFg
xfEHeJibTamiE3Z1SfHW1YLwe7QqbBogCIxq4RrpYtN15a65vT5HxyLHDJDGG20V
7z34QJhKXIni/AIGscZqx2kE/C42KSD2fBvqvA4YnPwEUQyMvnSSDSKuJ6flXPTv
RsPZMdNsWWWyJ8P/NTo0Y/PPwA/28p9pX064H2lHFNvSEzUYJdKyQXNV3pGWYAvc
PR8Z+nHfbK/EF5jOVJ8+erXzzXUN
=COmA
-----END PGP SIGNATURE-----

✓ Verified

File: src/main/java/com/paymentlink/controller/api/ConfigApiController.java

1 package com.paymentlink.controller.api;
2
3 import com.paymentlink.service.StripePaymentService;
4 import jakarta.servlet.http.HttpServletRequest;
5 import org.springframework.http.ResponseEntity;
6 import org.springframework.security.web.csrf.CsrfToken;
7 import org.springframework.web.bind.annotation.GetMapping;
8 import org.springframework.web.bind.annotation.RequestMapping;
9 import org.springframework.web.bind.annotation.RestController;
10
11 import java.util.HashMap;
12 import java.util.Map;
13
14 @RestController
15 @RequestMapping("/api")
16 public class ConfigApiController {
17
18 private final StripePaymentService stripePaymentService;
19
20 public ConfigApiController(StripePaymentService stripePaymentService) {
21 this.stripePaymentService = stripePaymentService;
22 }
23
24 /**
25 * GET /api/csrf-token - Get CSRF token
26 */
27 @GetMapping("/csrf-token")
28 public ResponseEntity<Map<String, String>> getCsrfToken(HttpServletRequest request) {
29 Map<String, String> response = new HashMap<>();
30 CsrfToken csrfToken = (CsrfToken) request.getAttribute(CsrfToken.class.getName());
31 // CSRF is disabled, return a dummy token for compatibility
32 response.put("token", csrfToken != null ? csrfToken.getToken() : "csrf-disabled");
33 return ResponseEntity.ok(response);
34 }
35
36 /**
37 * GET /api/config/stripe-key - Get Stripe publishable key
38 */
39 @GetMapping("/config/stripe-key")
40 public ResponseEntity<Map<String, Object>> getStripeKey() {
41 Map<String, Object> response = new HashMap<>();
42 response.put("success", true);
43 response.put("publishableKey", stripePaymentService.getPublishableKey());
44 return ResponseEntity.ok(response);
45 }
46 }
47
48