|
3 | 3 | import java.util.Map;
|
4 | 4 | import javax.annotation.Resource;
|
5 | 5 | import javax.servlet.http.HttpSession;
|
6 |
| - |
| 6 | +// import org.apache.commons.lang3.ObjectUtils; |
| 7 | + |
7 | 8 | import com.cybersource.flex.sdk.CaptureContext;
|
8 | 9 | import de.hybris.platform.acceleratorstorefrontcommons.controllers.pages.AbstractCheckoutController;
|
9 | 10 | import de.hybris.platform.commercefacades.order.data.AbstractOrderData;
|
|
40 | 41 |
|
41 | 42 | //OLH: For Reflected XSS fix. Used to sanitize some text
|
42 | 43 | import org.apache.commons.text.StringEscapeUtils;
|
| 44 | +import isv.sap.payment.addon.utils.AjaxResponse; |
43 | 45 |
|
44 | 46 | @Controller
|
45 | 47 | @RequestMapping(path = "/checkout/payment/flex")
|
@@ -67,18 +69,24 @@ public class FlexMicroformController extends AbstractCheckoutController
|
67 | 69 |
|
68 | 70 | @GetMapping(value = "/newJwk", produces = MediaType.APPLICATION_JSON_VALUE)
|
69 | 71 | @ResponseBody
|
70 |
| - public String newJwk(final HttpSession session, final UriComponentsBuilder uriComponentsBuilder) |
| 72 | + public AjaxResponse newJwk(final HttpSession session, final UriComponentsBuilder uriComponentsBuilder) |
71 | 73 | {
|
72 | 74 | final String targetOrigin = uriComponentsBuilder
|
73 | 75 | .replacePath(null).replaceQuery(null).userInfo(null).fragment(null)
|
74 | 76 | .build()
|
75 | 77 | .toUriString();
|
| 78 | + final Map<String, String> captureContext = flexService.createKey(targetOrigin); |
76 | 79 |
|
77 |
| - final CaptureContext captureContext = flexService.createKey(targetOrigin); |
| 80 | + session.setAttribute(FLEX_CAPTURE_CONTEXT_ATTRIBUTE, captureContext.get("captureContext")); |
78 | 81 |
|
79 |
| - session.setAttribute(FLEX_CAPTURE_CONTEXT_ATTRIBUTE, captureContext.toString()); |
| 82 | + // session.setAttribute("clientLiberary", captureContext.get("clientLiberary")); |
| 83 | + // session.setAttribute("clientLibraryIntegrity",captureContext.get("clientLibraryIntegrity")); |
| 84 | + return AjaxResponse.success() |
| 85 | + .put("captureContext", captureContext.get("captureContext")) |
| 86 | + .put("clientLibrary", captureContext.get("clientLibrary")) |
| 87 | +.put("clientLibraryIntegrity", captureContext.get("clientLibraryIntegrity")); |
80 | 88 |
|
81 |
| - return captureContext.toString(); |
| 89 | + // return captureContext.get("captureContext"); |
82 | 90 | }
|
83 | 91 |
|
84 | 92 | @PostMapping(value = "/verifyToken", consumes = MediaType.APPLICATION_JSON_VALUE)
|
|
0 commit comments