Skip to content

Commit

Permalink
Merge pull request #3 from e2y/release/2205-v1.1
Browse files Browse the repository at this point in the history
[AB] Release 2205-v1.1
  • Loading branch information
adbame authored May 26, 2023
2 parents adff54c + 039a12a commit f926b0c
Show file tree
Hide file tree
Showing 370 changed files with 7,302 additions and 1,353 deletions.
Binary file modified .DS_Store
Binary file not shown.
Binary file not shown.
Binary file added hybris/.DS_Store
Binary file not shown.
Binary file added hybris/bin/.DS_Store
Binary file not shown.
Binary file added hybris/bin/modules/.DS_Store
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import com.checkout.hybris.facades.accelerator.CheckoutComCheckoutFlowFacade;
import com.checkout.hybris.facades.payment.CheckoutComPaymentFacade;
import com.checkout.hybris.facades.payment.CheckoutComPaymentInfoFacade;
import com.checkout.payments.GetPaymentResponse;
import com.checkout.sdk.payments.GetPaymentResponse;
import de.hybris.platform.acceleratorstorefrontcommons.annotations.RequireHardLogIn;
import de.hybris.platform.acceleratorstorefrontcommons.controllers.pages.AbstractCheckoutController;
import de.hybris.platform.acceleratorstorefrontcommons.controllers.util.GlobalMessages;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,6 @@ public void setUp() throws InvalidCartException {
when(shippingContactMock.getName()).thenReturn(CUSTOMER_NAME);
doNothing().when(checkoutComWalletOrderFacadeMock).validateCartForPlaceOrder(checkoutComPlaceOrderCartValidatorMock);
when(userFacadeMock.isAnonymousUser()).thenReturn(Boolean.TRUE);
when(googlePayIntermediatePaymentDataMock.getShippingAddress()).thenReturn(shippingAddressMock);
when(googlePayIntermediatePaymentDataMock.getShippingOptionData()).thenReturn(shippingOptionsDataMock);
when(shippingOptionsDataMock.getId()).thenReturn(SHIPPING_ID);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ public void supports_WhenNotCorrectType_ShouldReturnFalse() {
@Test
public void validate_WhenValidPaymentType_ShouldCallTheCorrectValidator() {
when(paymentResolverMock.resolvePaymentMethod(FAWRY.name())).thenReturn(FAWRY);
doNothing().when(checkoutComFawryPaymentDataFormValidatorMock).validate(FAWRY, errors);

testObj.validate(paymentDataForm, errors);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>de.hybris.platform</groupId>
<artifactId>checkoutaddon</artifactId>
<version>1905.0</version>
<version>2205.0</version>

<packaging>jar</packaging>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#Tue, 18 Apr 2023 09:11:38 +0000
#Thu, 25 May 2023 11:30:52 +0000
# Specifies the location of the spring context file added automatically to the global platform application context.
checkoutaddon.application-context=checkoutaddon-spring.xml

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#Ant properties
#Tue Apr 18 09:15:35 UTC 2023
version.api=2105
#Thu May 25 11:36:02 UTC 2023
version.api=2205
vendor=hybris
group.id=de.hybris.platform
name=checkoutaddon
description=checkoutaddon
builddate=20230418 0915
releasedate=20220405 2233
version=2105.10
builddate=20230525 1135
releasedate=20220930 1705
version=2205.4
module.name=platform-module
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,10 @@
<editorArea:attribute qualifier="checkoutComPaymentReference"/>
<editorArea:attribute qualifier="achConsent"/>
</editorArea:section>
<editorArea:section name="sec.abstractorder.checkoutcom.api.payload.section">
<editorArea:attribute qualifier="requestsPayload" readonly="true"/>
<editorArea:attribute qualifier="responsesPayload" readonly="true"/>
</editorArea:section>
</editorArea:tab>
</editorArea:editorArea>
</context>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ sec.configuration.checkoutcom.payment.section=Payment redirect Url Configuration
sec.configuration.checkoutcom.details=Configuration Details
sec.configuration.checkoutcom.billingdescriptor=Billing Descriptor
sec.abstractorder.checkoutcom.details=Details
sec.abstractorder.checkoutcom.api.payload.section=Api Request/Response Payloads
sec.checkoutcom.payment.event.details=Payment Event Details
tab.configuration.checkoutcom.apm=APM Properties
sec.configuration.checkoutcom.apm=Configuration Details
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#Ant properties
#Tue Apr 18 09:15:36 UTC 2023
version.api=2105
#Thu May 25 11:36:02 UTC 2023
version.api=2205
vendor=hybris
group.id=de.hybris.platform
name=checkoutbackoffice
description=checkoutbackoffice
builddate=20230418 0915
releasedate=20220405 2233
version=2105.10
builddate=20230525 1135
releasedate=20220930 1705
version=2205.4
module.name=platform-module
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>de.hybris.platform</groupId>
<artifactId>checkoutevents</artifactId>
<version>1905.0</version>
<version>2205.0</version>

<packaging>jar</packaging>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#Ant properties
#Tue Apr 18 09:15:36 UTC 2023
version.api=2105
#Thu May 25 11:36:03 UTC 2023
version.api=2205
vendor=hybris
group.id=de.hybris.platform
name=checkoutevents
description=checkoutevents
builddate=20230418 0915
releasedate=20220405 2233
version=2105.10
builddate=20230525 1135
releasedate=20220930 1705
version=2205.4
module.name=platform-module
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ public class DefaultCheckoutComRequestEventValidator implements CheckoutComReque
protected final CheckoutComMerchantConfigurationService checkoutComMerchantConfigurationService;
protected final CheckoutComPaymentEventService checkoutComPaymentEventService;
protected final BaseSiteService baseSiteService;

public DefaultCheckoutComRequestEventValidator(final CheckoutComMerchantConfigurationService checkoutComMerchantConfigurationService,
final CheckoutComPaymentEventService checkoutComPaymentEventService,
final BaseSiteService baseSiteService) {
Expand All @@ -48,8 +47,7 @@ public boolean isRequestEventValid(final HttpServletRequest request, final Strin
final String eventAuthorizationHeaderKey = request.getHeader("authorization");
baseSiteService.setCurrentBaseSite(baseSiteService.getBaseSiteForUID(getSiteIdForTheEvent(eventBody)), false);

Optional.ofNullable(eventAuthorizationHeaderKey)
.ifPresent(evtAuthHeaderKey -> LOG.debug("Received event authorization header: [{}]; ", evtAuthHeaderKey));
LOG.debug("Received event authorization header: [{}]; ", eventAuthorizationHeaderKey);
LOG.debug("Received event signature: [{}]; ", ckoSignature);
LOG.debug("Received event body: [{}]", eventBody);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@ public class CheckoutComCleanupJobTest {

@Test
public void perform_shouldCallCleanupService_andReturnSuccess() {
when(checkoutComCleanupCronJobMock.getItemTypeCode()).thenReturn(ITEM_TYPE_CODE);
when(checkoutComCleanupCronJobMock.getItemRemovalAge()).thenReturn(AGE_IN_SECONDS);

final PerformResult result = testObj.perform(checkoutComCleanupCronJobMock);

assertEquals(CronJobResult.SUCCESS, result.getResult());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ public class CheckoutComPaymentEventListenerTest {
@Before
public void setUp() {
sourceMap = createMapEventBody();
when(paymentInfoServiceMock.getSiteIdFromPaymentId(PAYMENT_ID)).thenReturn(ELECTRONICS);
when(checkoutComPaymentEventServiceMock.getAllowedPaymentEventTypesForMerchant(ELECTRONICS)).thenReturn(EVENT_TYPES);
when(checkoutComPaymentEventReverseConverterMock.convert(sourceMap)).thenReturn(checkoutComPaymentEventModelMock);
when(checkoutComPaymentEventServiceMock.getSiteIdForTheEvent(sourceMap)).thenReturn(ELECTRONICS);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@
public class DefaultCheckoutComCleanupServiceTest {

private static final int BATCH_SIZE = 2;
private static final int AGE_IN_MONTHS = 24;
private static final String ITEM_TYPE_CODE = "ACHConsent";

@InjectMocks
private DefaultCheckoutComCleanupService testObj;
Expand All @@ -47,9 +45,7 @@ public class DefaultCheckoutComCleanupServiceTest {

@Test
public void doCleanUp_WhenItemTypeCodeAndAgeGiven_ShouldFindItemsAndRemoveThem() {
when(checkoutComCleanupCronJobMock.getItemTypeCode()).thenReturn(ITEM_TYPE_CODE);
when(checkoutComCleanupCronJobMock.getBatchSize()).thenReturn(BATCH_SIZE);
when(checkoutComCleanupCronJobMock.getItemRemovalAge()).thenReturn(AGE_IN_MONTHS);
when(checkoutComCleanupDaoMock.findItemsToCleanup(checkoutComCleanupCronJobMock)).thenReturn(new ArrayList<>(Arrays.asList(item1Mock, item2Mock)));

testObj.doCleanUp(checkoutComCleanupCronJobMock);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ public void setUp() {
emptyEventBody = createEventBodyEmpty();

when(checkoutComPaymentEventServiceMock.getSiteIdForTheEvent(new Gson().fromJson(eventBody, Map.class))).thenReturn(SITE_ID);
when(checkoutComPaymentEventServiceMock.getSiteIdForTheEvent(new Gson().fromJson(emptyEventBody, Map.class))).thenReturn(SITE_ID);
when(checkoutComMerchantConfigurationServiceMock.getSecretKey()).thenReturn(SECRET_KEY);
when(checkoutComMerchantConfigurationServiceMock.getSignatureKey()).thenReturn(SIGNATURE_KEY);
when(httpServletRequestMock.getHeader(HEADER_CKO_SIGNATURE)).thenReturn(SECRET_KEY_MESSAGE_HASH);
Expand Down Expand Up @@ -113,7 +112,6 @@ public void isRequestEventValid_whenNASIsActive_andAuthorizationHeaderIsActive_a
public void isRequestEventValid_whenNASIsActive_andAuthorizationHeaderIsNotActive_andNasSignatureKeyIsInactive_shouldReturnTrue() throws NoSuchAlgorithmException, InvalidKeyException {
when(checkoutComMerchantConfigurationServiceMock.isNasUsed()).thenReturn(true);
when(checkoutComMerchantConfigurationServiceMock.isNasSignatureKeyUsedOnNotificationValidation()).thenReturn(false);
when(checkoutComMerchantConfigurationServiceMock.getAuthorizationKey()).thenReturn(ANOTHER_KEY);

assertTrue(testObj.isRequestEventValid(httpServletRequestMock, eventBody));
verify(baseSiteServiceMock).setCurrentBaseSite(baseSiteModelMock, false);
Expand All @@ -123,7 +121,6 @@ public void isRequestEventValid_whenNASIsActive_andAuthorizationHeaderIsNotActiv
public void isRequestEventValid_whenNASIsActive_andAuthorizationHeaderIsNotActive_andNasSignatureKeyIsActive_andCKOSignatureIsValid_shouldReturnTrue() throws NoSuchAlgorithmException, InvalidKeyException {
when(checkoutComMerchantConfigurationServiceMock.isNasUsed()).thenReturn(true);
when(checkoutComMerchantConfigurationServiceMock.isNasSignatureKeyUsedOnNotificationValidation()).thenReturn(true);
when(checkoutComMerchantConfigurationServiceMock.getAuthorizationKey()).thenReturn(SECRET_KEY_MESSAGE_HASH);
doReturn(true).when(testObj).isCkoSignatureValid(SECRET_KEY_MESSAGE_HASH, eventBody);

assertTrue(testObj.isRequestEventValid(httpServletRequestMock, eventBody));
Expand All @@ -134,7 +131,6 @@ public void isRequestEventValid_whenNASIsActive_andAuthorizationHeaderIsNotActiv
public void isRequestEventValid_whenNASIsActive_andAuthorizationHeaderIsNotActive_andNasSignatureKeyIsActive_andCKOSignatureIsValid_shouldReturnFalse() throws NoSuchAlgorithmException, InvalidKeyException {
when(checkoutComMerchantConfigurationServiceMock.isNasUsed()).thenReturn(true);
when(checkoutComMerchantConfigurationServiceMock.isNasSignatureKeyUsedOnNotificationValidation()).thenReturn(true);
when(checkoutComMerchantConfigurationServiceMock.getAuthorizationKey()).thenReturn(SECRET_KEY_MESSAGE_HASH);
when(httpServletRequestMock.getHeader(HEADER_CKO_SIGNATURE)).thenReturn(ANOTHER_KEY);
doReturn(false).when(testObj).isCkoSignatureValid(ANOTHER_KEY, eventBody);

Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.checkout.hybris.events</groupId>
<artifactId>checkoutevents-web</artifactId>
<version>1905.0</version>
<version>2205.0</version>

<packaging>jar</packaging>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>de.hybris.platform</groupId>
<artifactId>checkoutfacades</artifactId>
<version>1905.0</version>
<version>2205.0</version>

<packaging>jar</packaging>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#Ant properties
#Tue Apr 18 09:15:36 UTC 2023
version.api=2105
#Thu May 25 11:36:02 UTC 2023
version.api=2205
vendor=hybris
group.id=de.hybris.platform
name=checkoutfacades
description=checkoutfacades
builddate=20230418 0915
releasedate=20220405 2233
version=2105.10
builddate=20230525 1135
releasedate=20220930 1705
version=2205.4
module.name=platform-module
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@
<alias name="defaultCheckoutComApplePayTokenRequestConverter"
alias="checkoutComApplePayTokenRequestConverter"/>
<bean id="defaultCheckoutComApplePayTokenRequestConverter" parent="abstractPopulatingConverter">
<property name="targetClass" value="com.checkout.tokens.WalletTokenRequest"/>
<property name="targetClass" value="com.checkout.sdk.tokens.WalletTokenRequest"/>
<property name="populators">
<list>
<ref bean="checkoutComApplePayTokenRequestPopulator"/>
Expand All @@ -325,7 +325,7 @@
<alias name="defaultCheckoutComGooglePayTokenRequestConverter"
alias="checkoutComGooglePayTokenRequestConverter"/>
<bean id="defaultCheckoutComGooglePayTokenRequestConverter" parent="abstractPopulatingConverter">
<property name="targetClass" value="com.checkout.tokens.WalletTokenRequest"/>
<property name="targetClass" value="com.checkout.sdk.tokens.WalletTokenRequest"/>
<property name="populators">
<list>
<ref bean="checkoutComGooglePayTokenRequestPopulator"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public abstract class CheckoutComAbstractCheckoutFlowFacadeDecorator extends Def

protected CheckoutFlowFacade checkoutFlowFacade;

public CheckoutComAbstractCheckoutFlowFacadeDecorator(final CheckoutFlowFacade checkoutFlowFacade) {
protected CheckoutComAbstractCheckoutFlowFacadeDecorator(final CheckoutFlowFacade checkoutFlowFacade) {
this.checkoutFlowFacade = checkoutFlowFacade;
}

Expand Down Expand Up @@ -154,16 +154,6 @@ public boolean removeDeliveryMode() {
return checkoutFlowFacade.removeDeliveryMode();
}

@Override
public List<CountryData> getDeliveryCountries() {
return checkoutFlowFacade.getDeliveryCountries();
}

@Override
public List<CountryData> getBillingCountries() {
return checkoutFlowFacade.getBillingCountries();
}

@Override
public List<CountryData> getCountries(final CountryType countryType) {
return checkoutFlowFacade.getCountries(countryType);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@
import com.checkout.hybris.facades.beans.AuthorizeResponseData;
import com.checkout.hybris.facades.beans.CheckoutComPaymentInfoData;
import com.checkout.hybris.facades.constants.CheckoutFacadesConstants;
import com.checkout.payments.PaymentProcessed;
import com.checkout.payments.PaymentRequest;
import com.checkout.payments.PaymentResponse;
import com.checkout.payments.RequestSource;
import com.checkout.sdk.GsonSerializer;
import com.checkout.sdk.payments.PaymentProcessed;
import com.checkout.sdk.payments.PaymentRequest;
import com.checkout.sdk.payments.PaymentResponse;
import com.checkout.sdk.payments.RequestSource;
import de.hybris.platform.acceleratorfacades.flow.CheckoutFlowFacade;
import de.hybris.platform.commercefacades.order.data.CartData;
import de.hybris.platform.core.model.order.CartModel;
Expand Down Expand Up @@ -44,6 +45,7 @@ public class DefaultCheckoutComCheckoutFlowFacadeDecorator extends CheckoutComAb
protected final CheckoutComPaymentService paymentService;
protected final Converter<AuthorizeResponse, AuthorizeResponseData> authorizeResponseConverter;


public DefaultCheckoutComCheckoutFlowFacadeDecorator(final CheckoutFlowFacade checkoutFlowFacade,
final CheckoutComAddressService addressService,
final CheckoutComRequestFactory checkoutComRequestFactory,
Expand Down Expand Up @@ -97,6 +99,13 @@ public AuthorizeResponseData authorizePayment() {
try {
final PaymentRequest<RequestSource> request = checkoutComRequestFactory.createPaymentRequest(cart);
paymentResponse = checkoutComPaymentIntegrationService.authorizePayment(request);
final GsonSerializer gsonSerializer = new GsonSerializer();
final String requestJson = gsonSerializer.toJson(request);
final String responseJson = gsonSerializer.toJson(paymentResponse);
//Parse response and request
paymentInfoService.saveRequestAndResponseInOrder(cart, requestJson, responseJson);
paymentInfoService.logInfoOut(requestJson);
paymentInfoService.logInfoOut(responseJson);
} catch (final CheckoutComPaymentIntegrationException | IllegalArgumentException e) {
LOG.error("Exception during authorization", e);
authorizeResponseData.setIsSuccess(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import com.checkout.hybris.facades.beans.WalletPaymentAdditionalAuthInfo;
import com.checkout.hybris.facades.beans.WalletPaymentInfoData;
import com.checkout.hybris.facades.enums.WalletPaymentType;
import com.checkout.payments.GetPaymentResponse;
import com.checkout.sdk.payments.GetPaymentResponse;
import de.hybris.platform.acceleratorfacades.payment.PaymentFacade;
import org.apache.http.conn.ssl.SSLConnectionSocketFactory;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.checkout.hybris.facades.payment;

import com.checkout.payments.GetPaymentResponse;
import com.checkout.sdk.payments.GetPaymentResponse;
import de.hybris.platform.commercefacades.order.data.CartData;
import de.hybris.platform.core.model.order.payment.PaymentInfoModel;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
import com.checkout.hybris.facades.enums.WalletPaymentType;
import com.checkout.hybris.facades.payment.CheckoutComPaymentFacade;
import com.checkout.hybris.facades.payment.token.request.converters.mappers.CheckoutComMappedPaymentTokenRequestConverter;
import com.checkout.payments.GetPaymentResponse;
import com.checkout.tokens.TokenResponse;
import com.checkout.tokens.WalletTokenRequest;
import com.checkout.sdk.payments.GetPaymentResponse;
import com.checkout.sdk.tokens.TokenResponse;
import com.checkout.sdk.tokens.WalletTokenRequest;
import com.google.common.base.Preconditions;
import de.hybris.platform.acceleratorfacades.payment.impl.DefaultPaymentFacade;
import de.hybris.platform.core.model.order.CartModel;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import com.checkout.hybris.facades.beans.*;
import com.checkout.hybris.facades.payment.CheckoutComPaymentInfoFacade;
import com.checkout.hybris.facades.payment.converters.CheckoutComApmMappedPaymentInfoReverseConverter;
import com.checkout.payments.GetPaymentResponse;
import com.checkout.sdk.payments.GetPaymentResponse;
import de.hybris.platform.commercefacades.order.data.CCPaymentInfoData;
import de.hybris.platform.commercefacades.order.data.CartData;
import de.hybris.platform.core.model.order.CartModel;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import com.checkout.hybris.facades.beans.WalletPaymentAdditionalAuthInfo;
import com.checkout.hybris.facades.enums.WalletPaymentType;
import com.checkout.tokens.WalletTokenRequest;
import com.checkout.sdk.tokens.WalletTokenRequest;

/**
* Converts a wallet the payload from wallet widget into a specific WalletTokenRequest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import com.checkout.hybris.facades.beans.WalletPaymentAdditionalAuthInfo;
import com.checkout.hybris.facades.enums.WalletPaymentType;
import com.checkout.hybris.facades.payment.token.request.converters.mappers.CheckoutComMappedPaymentTokenRequestConverter;
import com.checkout.tokens.WalletTokenRequest;
import com.checkout.sdk.tokens.WalletTokenRequest;
import de.hybris.platform.servicelayer.dto.converter.Converter;
import org.springframework.util.Assert;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.checkout.hybris.facades.payment.token.request.converters.populators;

import com.checkout.hybris.facades.beans.ApplePayAdditionalAuthInfo;
import com.checkout.tokens.WalletTokenRequest;
import com.checkout.sdk.tokens.WalletTokenRequest;
import de.hybris.platform.converters.Populator;
import de.hybris.platform.servicelayer.dto.converter.ConversionException;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.checkout.hybris.facades.payment.token.request.converters.populators;

import com.checkout.hybris.facades.beans.GooglePayPaymentToken;
import com.checkout.tokens.WalletTokenRequest;
import com.checkout.sdk.tokens.WalletTokenRequest;
import de.hybris.platform.converters.Populator;
import de.hybris.platform.servicelayer.dto.converter.ConversionException;

Expand Down
Loading

0 comments on commit f926b0c

Please sign in to comment.