remove unnecessary logging

This commit is contained in:
jillingk
2023-05-22 09:46:42 +02:00
parent 90620073b8
commit 7f28f65cca
2 changed files with 5 additions and 16 deletions

View File

@@ -52,7 +52,6 @@ public class CheckoutResource {
log.info("REST request to get Adyen payment methods {}", paymentMethodsRequest);
PaymentMethodsResponse response = paymentsApi.paymentMethods(paymentMethodsRequest);
log.info(response.toJson());
return ResponseEntity.ok()
.body(response);
}
@@ -66,16 +65,13 @@ public class CheckoutResource {
*/
@PostMapping("/initiatePayment")
public ResponseEntity<PaymentResponse> payments(@RequestBody String bodyRequest, HttpServletRequest request) throws IOException, ApiException {
log.info(bodyRequest);
// gson
// Custom (de)serialization
Gson gson = new Gson();
JsonObject obj = gson.fromJson(bodyRequest, JsonObject.class);
com.google.gson.JsonObject method = obj.getAsJsonObject("paymentMethod");
CheckoutPaymentMethod paymentMethod = CheckoutPaymentMethod.fromJson(method.toString());
log.info(paymentMethod.toString());
String type = method.getAsJsonPrimitive("type").toString();
log.info(type);
BrowserInfo browserInfo;
try {
@@ -132,7 +128,6 @@ public class CheckoutResource {
log.info("REST request to make Adyen payment {}", paymentRequest);
var response = paymentsApi.payments(paymentRequest);
log.info(response.toJson());
return ResponseEntity.ok()
.body(response);
}
@@ -161,10 +156,7 @@ public class CheckoutResource {
*/
@GetMapping("/handleShopperRedirect")
public RedirectView redirect(@RequestParam(required = false) String payload, @RequestParam(required = false) String redirectResult, @RequestParam String orderRef) throws IOException, ApiException {
log.info(redirectResult);
log.info(payload);
log.info(orderRef);
var detailsRequest = new DetailsRequest();
if (redirectResult != null && !redirectResult.isEmpty()) {
PaymentCompletionDetails paymentCompletionDetails = new PaymentCompletionDetails();

View File

@@ -35,16 +35,16 @@ async function initCheckout() {
},
}
},
// Why does this component return a data object that we cannot serialise as a PaymentRequest? (contain random params
// like clientStateIndicator
onSubmit: (state, component) => {
if (state.isValid) {
console.info("onSubmit");
console.info(state, component);
handleSubmission(state, component, "/api/initiatePayment");
}
},
onAdditionalDetails: (state, component) => {
console.info("onAdditionalDetails");
console.info(state, component);
handleSubmission(state, component, "/api/submitAdditionalDetails");
},
@@ -106,15 +106,12 @@ async function callServer(url, data) {
// Handles responses sent from your server to the client
function handleServerResponse(res, component) {
console.log(res.resultCode);
if (res.action) {
console.log(res.action.actualInstance);
let action = res.action.actualInstance;
if(action.type = "REDIRECT"){
// Why are we getting uppercase type here even though the component takes lowercase?
action.type = "redirect"
console.log(action.method);
}
console.log(action);
component.handleAction(action);
} else {
switch (res.resultCode) {