Skip to content

Commit

Permalink
Merge pull request #449 from Adyen/feature/AD-251_1
Browse files Browse the repository at this point in the history
AD-251 Develop Endpoint for Handling Redirection from External Paymen…
  • Loading branch information
pjaneta authored Sep 20, 2024
2 parents ed9d2c6 + 5ebf73f commit 6453dfd
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import de.hybris.platform.acceleratorfacades.flow.CheckoutFlowFacade;
import de.hybris.platform.acceleratorservices.urlresolver.SiteBaseUrlResolutionService;
import de.hybris.platform.commercefacades.order.CartFacade;
import de.hybris.platform.commerceservices.i18n.CommerceCommonI18NService;
import de.hybris.platform.commerceservices.request.mapping.annotation.ApiVersion;
import de.hybris.platform.commerceservices.strategies.CheckoutCustomerStrategy;
import de.hybris.platform.order.InvalidCartException;
Expand Down Expand Up @@ -63,6 +64,9 @@ public class PlaceOrderController extends PlaceOrderControllerBase {
@Resource(name = "checkoutCustomerStrategy")
private CheckoutCustomerStrategy checkoutCustomerStrategy;

@Resource(name = "commerceCommonI18NService")
private CommerceCommonI18NService commerceCommonI18NService;

@Secured({"ROLE_CUSTOMERGROUP", "ROLE_CLIENT", "ROLE_CUSTOMERMANAGERGROUP", "ROLE_TRUSTED_CLIENT"})
@PostMapping(value = "/place-order", produces = MediaType.APPLICATION_JSON_VALUE)
@Operation(operationId = "placeOrder", summary = "Handle place order request", description =
Expand Down Expand Up @@ -100,9 +104,11 @@ public ResponseEntity<Void> onCancel() throws InvalidCartException, CalculationE
@Override
public String getPaymentRedirectReturnUrl() {
String occBaseUrl = webServicesBaseUrlResolver.getOCCBaseUrl(true);
String currency = commerceCommonI18NService.getCurrentCurrency().getIsocode();
String language = commerceCommonI18NService.getCurrentLanguage().getIsocode();
String baseSiteUid = baseSiteService.getCurrentBaseSite().getUid();

return occBaseUrl + "/v2/" + baseSiteUid + "/adyen/redirect";
return occBaseUrl + "/v2/" + baseSiteUid + "/adyen/redirect?lang=" + language + "&curr=" + currency;
}

@Override
Expand Down

0 comments on commit 6453dfd

Please sign in to comment.