Skip to content

Commit

Permalink
AD-244 Develop OCC Endpoint for Retrieving Adyen Payment Methods - cr…
Browse files Browse the repository at this point in the history
…eate extension and test controller
  • Loading branch information
pjaneta committed May 6, 2024
1 parent 083188b commit 5155352
Show file tree
Hide file tree
Showing 15 changed files with 328 additions and 0 deletions.
79 changes: 79 additions & 0 deletions adyenocc/buildcallbacks.xml
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>
24 changes: 24 additions & 0 deletions adyenocc/extensioninfo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?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"/>


<coremodule generated="true" manager="com.adyen.commerce.jalo.AdyenoccManager" packageroot="com.adyen.commerce"/>




</extension>


</extensioninfo>
11 changes: 11 additions & 0 deletions adyenocc/external-dependencies.xml
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>
14 changes: 14 additions & 0 deletions adyenocc/project.properties
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
20 changes: 20 additions & 0 deletions adyenocc/resources/adyenocc-beans.xml
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>
40 changes: 40 additions & 0 deletions adyenocc/resources/adyenocc-items.xml
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>
18 changes: 18 additions & 0 deletions adyenocc/resources/adyenocc-spring.xml
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>
11 changes: 11 additions & 0 deletions adyenocc/resources/adyenocc.build.number
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 adyenocc/resources/localization/adyenocc-locales_de.properties
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 adyenocc/resources/localization/adyenocc-locales_en.properties
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
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
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
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>
15 changes: 15 additions & 0 deletions adyenocc/src/com/adyen/commerce/constants/AdyenoccConstants.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/*
* 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";

private AdyenoccConstants()
{
//empty
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* Copyright (c) 2020 SAP SE or an SAP affiliate company. All rights reserved.
*/
package com.adyen.commerce.controllers;

import de.hybris.platform.webservicescommons.swagger.ApiBaseSiteIdParam;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping(value = "/{baseSiteId}/test")
public class AdyenoccController
{
@GetMapping
@ApiBaseSiteIdParam
public String getNewResource()
{
return "newSampleResource";
}
}

0 comments on commit 5155352

Please sign in to comment.