Skip to content

Commit

Permalink
Merge pull request #458 from Adyen/feature/AD-325
Browse files Browse the repository at this point in the history
AD-325 Apple pay doesn't work
  • Loading branch information
pjaneta authored Oct 2, 2024
2 parents a6c8458 + 1d8329d commit be71cd9
Showing 1 changed file with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
import com.adyen.service.exception.ApiException;
import com.adyen.v6.dto.CheckoutConfigDTO;
import com.adyen.v6.facades.AdyenCheckoutFacade;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import de.hybris.platform.commerceservices.request.mapping.annotation.ApiVersion;
import de.hybris.platform.webservicescommons.swagger.ApiBaseSiteIdUserIdAndCartIdParam;
import io.swagger.v3.oas.annotations.Operation;
Expand All @@ -24,6 +27,13 @@
@Tag(name = "Adyen")
public class PaymentMethodsController
{
protected static ObjectMapper objectMapper;

static {
objectMapper = new ObjectMapper();
objectMapper.registerModule(new JavaTimeModule());
}

@Autowired
private AdyenCheckoutFacade adyenCheckoutFacade;

Expand All @@ -32,7 +42,8 @@ public class PaymentMethodsController
@Operation(operationId = "getCheckoutConfiguration", summary = "Get checkout configuration", description =
"Returns configuration for Adyen dropin component")
@ApiBaseSiteIdUserIdAndCartIdParam
public ResponseEntity<CheckoutConfigDTO> getCheckoutConfiguration() throws ApiException {
return ResponseEntity.ok().body(adyenCheckoutFacade.getReactCheckoutConfig());
public ResponseEntity<String> getCheckoutConfiguration() throws ApiException, JsonProcessingException {
String response = objectMapper.writeValueAsString(adyenCheckoutFacade.getReactCheckoutConfig());
return ResponseEntity.ok().body(response);
}
}

0 comments on commit be71cd9

Please sign in to comment.