Commit: 9c24ca4

Commit Details

SHA9c24ca40dbca995b0007e09659176f7c90e13392
Tree4c630341b69f778f78daa19bfebcc1bfdebe1836
Author<f69e50@finnacloud.com> 1766442705 +0300
Committer<f69e50@finnacloud.com> 1766442705 +0300
Message
add CI configuration and test script for Jenkins build
GPG Signature
-----BEGIN PGP SIGNATURE-----

iQJSBAABCAA8FiEEWJb139mJI+vZ81KkoAIVSUsXI0oFAmlJxtEeHHNvcGhpYS5l
cmFzbGFuQGZpbm5hY2xvdWQuY29tAAoJEKACFUlLFyNKwOEP/RJdPEnaGlYKr4zE
NkU5vATgzcYMHxCO6p3T6JqsfHsvv2d65vedOJ8LsSHFtT9AN/yXqZKV2722R5CG
WLsPzbVYJSXexKVZ8D7Zpf+DTu+/OAlWUE+XHMm+bJYVpDmqUo0ak/qX6vz6VYtW
bSRPMtM9g8WZKZqbBxLK7Sg1IkYFsFjEWmvn6mbD9C7k/0y4Sxp6Xee26xAx1sdI
+srAjwFgF+wJw0OAQoBA2jykTOiib93n9gdc9wbgl4AYUvdcaX3Hxv8LTl3Bu88N
2rqaL+OmjXtkFkEAiBaruvZZCt+aqp14gTgOM0wcLp1I1FP7uOFNOg0F0zSUawzY
Fuw3w6CKebkpbixGfxtJqrLl1IbPAhd92TxRVerZbDEnWpXW3a9HoGWRu5KFX/ny
ww+8M53ziWFNcHqpIyI5adRjG74C+5MdvC04J0/Sh1X8mykWcjE96Wu2/iRY9XQe
07I94ZVO0RaBSjSUnIItfhAgBXi03nzx+ZPw2tM4VHosn2zZjpzT8+KNQ0EXYhuT
AzgqcOKV94ZkM+48ZePvUFXsJxhMSkpXIQxGWWBnU9gjm3QAUsuCyqZGKXgVY9Vo
mDlLBl83Nhx+/7V8AFJO2gUmaph9YB01p3SMDfE++lLqX1BwdguFVrQib30OsRnq
e86d/6MrRABKf+FjtaulHY9+e8LS
=9ZJj
-----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