-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #415 from Adyen/feature/AD-244
Feature/ad 244
- Loading branch information
Showing
20 changed files
with
372 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
<!-- | ||
Copyright (c) 2020 SAP SE or an SAP affiliate company. All rights reserved. | ||
--><!-- | ||
All hybris buildcallbacks.xml macrodefinitions: | ||
Build/Documentation | ||
before/after ant macro "clean" | ||
<macrodef name="adyenocc_before_clean"/> | ||
<macrodef name="adyenocc_after_clean"/> | ||
before/after ant macro "build" | ||
<macrodef name="adyenocc_before_build"/> | ||
<macrodef name="adyenocc_after_build"/> | ||
before/after ant macro "compile_core" - the core module of the extension | ||
<macrodef name="adyenocc_before_compile_core"> | ||
<macrodef name="adyenocc_after_compile_core"> | ||
before/after ant macro "compile_web" - the web module of the extension | ||
<macrodef name="adyenocc_before_compile_web" /> | ||
<macrodef name="adyenocc_after_compile_web" /> | ||
Preparing extension | ||
will be called in the beginning of the ant call and only once (also when using multiple | ||
ant targets e.g. ant build yunittest) | ||
<macrodef name="adyenocc_only_once_prepare"/> | ||
Creating ear module/production | ||
before/after ant macro "ear" | ||
<macrodef name="adyenocc_before_ear"/> | ||
<macrodef name="adyenocc_after_ear"/> | ||
before/after ant macro "production" - for hybris server only | ||
<macrodef name="adyenocc_before_production" /> | ||
<macrodef name="adyenocc_after_production" /> | ||
JUnit Test | ||
before/after ant macro "yunitinit" | ||
<macrodef name="adyenocc_before_yunitinit" /> | ||
<macrodef name="adyenocc_after_yunitinit" /> | ||
before/after ant macro "yunit" | ||
<macrodef name="adyenocc_before_yunit" /> | ||
<macrodef name="adyenocc_after_yunit" /> | ||
Distribution package | ||
before/after ant macro "dist" - internal target; only for use when platform is available in source code | ||
<macrodef name="adyenocc_after_dist"/> | ||
<macrodef name="adyenocc_before_dist"/> | ||
before/after ant macro "dist_copy" - internal target; only for use when platform is available in source code | ||
<macrodef name="adyenocc_before_dist_copy"/> | ||
<macrodef name="adyenocc_after_dist_copy"/> | ||
--><project name="adyenocc_buildcallbacks"> | ||
|
||
<!-- | ||
Called whenever 'ant ear' is used. this callback can be used to modify the content of the ear file | ||
${ear.path}: path to ear | ||
--> | ||
|
||
<macrodef name="adyenocc_before_ear"> | ||
|
||
<sequential> | ||
|
||
<!-- you can do anything before the EAR file is being packed --> | ||
|
||
</sequential> | ||
|
||
</macrodef> | ||
|
||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
<!-- | ||
Copyright (c) 2020 SAP SE or an SAP affiliate company. All rights reserved. | ||
--><extensioninfo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="extensioninfo.xsd"> | ||
|
||
|
||
<extension abstractclassprefix="Generated" classprefix="Adyenocc" description="adyenocc extension" jaloLogicFree="true" managername="AdyenoccManager" managersuperclass="de.hybris.platform.jalo.extension.Extension" name="adyenocc"> | ||
|
||
|
||
<!-- you should add all required extensions to this list, except platform extensions which are automatically required --> | ||
|
||
|
||
<requires-extension name="commercewebservices"/> | ||
<requires-extension name="adyenv6core"/> | ||
|
||
|
||
<coremodule generated="true" manager="com.adyen.commerce.jalo.AdyenoccManager" packageroot="com.adyen.commerce"/> | ||
|
||
|
||
|
||
|
||
</extension> | ||
|
||
|
||
</extensioninfo> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<!-- | ||
Copyright (c) 2020 SAP SE or an SAP affiliate company. All rights reserved. | ||
--> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<groupId>de.hybris.platform</groupId> | ||
<artifactId>adyenocc</artifactId> | ||
<version>2211.3</version> | ||
<packaging>jar</packaging> | ||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# --------------------------------------------------------------------------- | ||
# Copyright (c) 2020 SAP SE or an SAP affiliate company. All rights reserved. | ||
# --------------------------------------------------------------------------- | ||
# you can put key/value pairs here. | ||
# Use Config.getParameter(..) to retrieve the values during runtime. | ||
|
||
adyenocc.key=value | ||
|
||
# Specifies the location of the spring context file added automatically to the global platform application context. | ||
adyenocc.application-context=adyenocc-spring.xml | ||
|
||
#Use for generating static swagger documentation | ||
adyenocc.documentation.static.generate=true | ||
ext.adyenocc.extension.webmodule.webroot=/occ/v2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?xml version="1.0" encoding="ISO-8859-1"?> | ||
<!-- | ||
Copyright (c) 2020 SAP SE or an SAP affiliate company. All rights reserved. | ||
--> | ||
<!-- | ||
ATTENTION: This is just an example file. You have to edit it according to your needs. | ||
--> | ||
|
||
<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="beans.xsd"> | ||
|
||
<!-- | ||
Example Data POJO | ||
<bean class="yemptypackage.data.MyPojo"> | ||
<property name="id" type="String"/> | ||
<property name="flag" type="boolean"/> | ||
</bean> | ||
--> | ||
|
||
</beans> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?xml version="1.0" encoding="ISO-8859-1"?> | ||
<!-- | ||
Copyright (c) 2020 SAP SE or an SAP affiliate company. All rights reserved. | ||
--> | ||
<!-- | ||
ATTENTION: This is just an example file. You have to edit it according to your needs. | ||
--> | ||
|
||
<items xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="items.xsd"> | ||
|
||
<itemtypes> | ||
<!-- | ||
<itemtype generate="true" | ||
code="MyProduct" | ||
jaloclass="com.adyen.commerce.jalo.MyProduct" | ||
extends="Product" | ||
autocreate="true" | ||
> | ||
<attributes> | ||
<attribute qualifier="myExampleInitialStringField" type="java.lang.String"> | ||
<description>My Example Initial String Value</description> | ||
<modifiers initial="true"/> | ||
<persistence type="property"/> | ||
</attribute> | ||
<attribute qualifier="myExampleBooleanField" type="java.lang.Boolean"> | ||
<description>Example Initial Boolean Field</description> | ||
<persistence type="property"/> | ||
</attribute> | ||
<attribute qualifier="media" type="Media"> | ||
<persistence type="property"/> | ||
</attribute> | ||
</attributes> | ||
</itemtype> | ||
--> | ||
</itemtypes> | ||
</items> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
Copyright (c) 2020 SAP SE or an SAP affiliate company. All rights reserved. | ||
--> | ||
<beans xmlns="http://www.springframework.org/schema/beans" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xmlns:aop="http://www.springframework.org/schema/aop" | ||
xmlns:context="http://www.springframework.org/schema/context" | ||
xsi:schemaLocation="http://www.springframework.org/schema/beans | ||
http://www.springframework.org/schema/beans/spring-beans.xsd | ||
http://www.springframework.org/schema/aop | ||
http://www.springframework.org/schema/aop/spring-aop.xsd | ||
http://www.springframework.org/schema/context | ||
http://www.springframework.org/schema/context/spring-context.xsd"> | ||
|
||
<context:annotation-config/> | ||
|
||
</beans> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#Ant properties | ||
#Wed Feb 08 03:32:01 CET 2023 | ||
version.api=2211 | ||
vendor=hybris | ||
group.id=de.hybris.platform | ||
name=adyenocc | ||
description=adyenocc | ||
builddate=20230208 0330 | ||
releasedate=20221109 1322 | ||
version=2211.3 | ||
module.name=platform-module |
22 changes: 22 additions & 0 deletions
22
adyenocc/resources/localization/adyenocc-locales_de.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# --------------------------------------------------------------------------- | ||
# Copyright (c) 2020 SAP SE or an SAP affiliate company. All rights reserved. | ||
# --------------------------------------------------------------------------- | ||
# put localizations of item types into this file | ||
# Note that you can also add special locatizations which | ||
# can be retrieved with the | ||
# | ||
# ...tools.localization.Localization.getLocalizedString(...) | ||
# | ||
# methods. | ||
# | ||
# syntax for type localizations: | ||
# | ||
# type.<code of type>.name=XY | ||
# type.<code of type>.<qualifier of attribute>.name=XY | ||
# type.<code of type>.description=XY | ||
# type.<code of type>.<qualifier of attribute>.description=XY | ||
# | ||
# yourcustomlocalekey=value | ||
|
||
#NOTR | ||
Dummy=Dummy |
22 changes: 22 additions & 0 deletions
22
adyenocc/resources/localization/adyenocc-locales_en.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# --------------------------------------------------------------------------- | ||
# Copyright (c) 2020 SAP SE or an SAP affiliate company. All rights reserved. | ||
# --------------------------------------------------------------------------- | ||
# put localizations of item types into this file | ||
# Note that you can also add special locatizations which | ||
# can be retrieved with the | ||
# | ||
# ...tools.localization.Localization.getLocalizedString(...) | ||
# | ||
# methods. | ||
# | ||
# syntax for type localizations: | ||
# | ||
# type.<code of type>.name=XY | ||
# type.<code of type>.<qualifier of attribute>.name=XY | ||
# type.<code of type>.description=XY | ||
# type.<code of type>.<qualifier of attribute>.description=XY | ||
# | ||
# yourcustomlocalekey=value | ||
|
||
#NOTR | ||
Dummy=Dummy |
8 changes: 8 additions & 0 deletions
8
adyenocc/resources/occ/v2/adyenocc/messages/base_de.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# --------------------------------------------------------------------------- | ||
# Copyright (c) 2020 SAP SE or an SAP affiliate company. All rights reserved. | ||
# --------------------------------------------------------------------------- | ||
# put localizations or messages used in your web application into this file | ||
# | ||
|
||
#NOTR | ||
Dummy=Dummy |
8 changes: 8 additions & 0 deletions
8
adyenocc/resources/occ/v2/adyenocc/messages/base_en.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# --------------------------------------------------------------------------- | ||
# Copyright (c) 2020 SAP SE or an SAP affiliate company. All rights reserved. | ||
# --------------------------------------------------------------------------- | ||
# put localizations or messages used in your web application into this file | ||
# | ||
|
||
#NOTR | ||
Dummy=Dummy |
15 changes: 15 additions & 0 deletions
15
adyenocc/resources/occ/v2/adyenocc/web/spring/adyenocc-web-spring.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
Copyright (c) 2020 SAP SE or an SAP affiliate company. All rights reserved. | ||
--> | ||
<beans xmlns="http://www.springframework.org/schema/beans" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xmlns:context="http://www.springframework.org/schema/context" | ||
xsi:schemaLocation="http://www.springframework.org/schema/beans | ||
http://www.springframework.org/schema/beans/spring-beans.xsd | ||
http://www.springframework.org/schema/context | ||
http://www.springframework.org/schema/context/spring-context.xsd"> | ||
|
||
<context:component-scan base-package="com.adyen.commerce.controllers"/> | ||
|
||
</beans> |
17 changes: 17 additions & 0 deletions
17
adyenocc/src/com/adyen/commerce/constants/AdyenoccConstants.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/* | ||
* Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. | ||
*/ | ||
package com.adyen.commerce.constants; | ||
|
||
public class AdyenoccConstants extends GeneratedAdyenoccConstants | ||
{ | ||
public static final String EXTENSIONNAME = "adyenocc"; | ||
public static final String ADYEN_USER_CART_PREFIX = "/{baseSiteId}/users/{userId}/carts/{cartId}/adyen"; | ||
public static final String ADYEN_USER_PREFIX = "/{baseSiteId}/users/{userId}/adyen"; | ||
|
||
private AdyenoccConstants() | ||
{ | ||
//empty | ||
} | ||
} | ||
|
36 changes: 36 additions & 0 deletions
36
adyenocc/src/com/adyen/commerce/controllers/PaymentMethodsController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
* Copyright (c) 2020 SAP SE or an SAP affiliate company. All rights reserved. | ||
*/ | ||
package com.adyen.commerce.controllers; | ||
|
||
import com.adyen.commerce.constants.AdyenoccConstants; | ||
import com.adyen.service.exception.ApiException; | ||
import com.adyen.v6.dto.CheckoutConfigDTO; | ||
import com.adyen.v6.facades.AdyenCheckoutFacade; | ||
import de.hybris.platform.commerceservices.request.mapping.annotation.ApiVersion; | ||
import de.hybris.platform.webservicescommons.swagger.ApiBaseSiteIdUserIdAndCartIdParam; | ||
import io.swagger.v3.oas.annotations.Operation; | ||
import io.swagger.v3.oas.annotations.tags.Tag; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.stereotype.Controller; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
|
||
@Controller | ||
@RequestMapping(value = AdyenoccConstants.ADYEN_USER_CART_PREFIX) | ||
@ApiVersion("v2") | ||
@Tag(name = "Adyen") | ||
public class PaymentMethodsController | ||
{ | ||
@Autowired | ||
private AdyenCheckoutFacade adyenCheckoutFacade; | ||
|
||
@GetMapping(value = "/checkout-configuration") | ||
@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()); | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
adyenocc/src/com/adyen/commerce/exception/AdyenOCCControllerException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package com.adyen.commerce.exception; | ||
|
||
public class AdyenOCCControllerException extends RuntimeException { | ||
} |
15 changes: 15 additions & 0 deletions
15
adyenocc/src/com/adyen/commerce/exceptionhandler/AdyenOCCControllerExceptionHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package com.adyen.commerce.exceptionhandler; | ||
|
||
import com.adyen.commerce.exception.AdyenOCCControllerException; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.ControllerAdvice; | ||
import org.springframework.web.bind.annotation.ExceptionHandler; | ||
|
||
@ControllerAdvice | ||
public class AdyenOCCControllerExceptionHandler { | ||
|
||
@ExceptionHandler(value = AdyenOCCControllerException.class) | ||
public ResponseEntity<Void> handleAdyenControllerException(AdyenOCCControllerException exception) { | ||
return ResponseEntity.badRequest().build(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.