Skip to content

Commit

Permalink
Release 0.1.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
WorldlineAcquiring committed Sep 20, 2024
1 parent cd78151 commit 2eaf9ea
Show file tree
Hide file tree
Showing 197 changed files with 15,862 additions and 2 deletions.
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
root = true

[*]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.gitattributes export-ignore
.gitignore export-ignore

* text eol=lf
56 changes: 56 additions & 0 deletions .github/workflows/api-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: API docs

on:
push:
tags: ['[0-9]+.[0-9]+*']

permissions:
contents: write

jobs:
api-docs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
path: code
persist-credentials: false
- name: Setup Java
uses: actions/setup-java@v4
with:
java-version: '8'
distribution: 'temurin'
cache: 'maven'
- name: Build API docs
run: mvn javadoc:javadoc -Dnotimestamp
working-directory: code
- name: Checkout pages
uses: actions/checkout@v4
with:
ref: gh-pages
path: pages
- name: Deploy pages
run: |
SDK_VERSION_FOLDER=`echo "$SDK_VERSION" | awk --field-separator '.' '{print $1".x";}'`
# Create .nojekyll if it doesn't exist yet
touch .nojekyll
mkdir -p "apidocs/$SDK_VERSION_FOLDER"
rsync --quiet --archive --checksum --delete --exclude .git ../code/target/site/apidocs/ "apidocs/$SDK_VERSION_FOLDER/"
if [ -e apidocs/latest ]; then rm -r apidocs/latest; fi
pushd apidocs && ln -s "$SDK_VERSION_FOLDER" latest && popd
git config user.email "$USER_EMAIL"
git config user.name "$USER_NAME"
git add --all .
# Only commit when there are changes
git diff --quiet && git diff --staged --quiet || git commit --message "Generated API docs for version ${SDK_VERSION}"
git push
shell: bash
working-directory: pages
env:
SDK_VERSION: ${{ github.ref_name }}
USER_EMAIL: ${{ github.event.pusher.email }}
USER_NAME: ${{ github.event.pusher.name }}
31 changes: 31 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Deploy

on:
push:
tags: ['[0-9]+.[0-9]+*']

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Setup Java
uses: actions/setup-java@v4
with:
java-version: '8'
distribution: 'temurin'
cache: 'maven'
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
server-id: ossrh
server-username: OSSRH_USERNAME
server-password: OSSRH_PASSWORD
- name: Deploy
run: mvn deploy -Prelease -DskipTests -DstagingProgressTimeoutMinutes=60
env:
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/target
/.settings
/.classpath
/.project
/.checkstyle
/.idea
347 changes: 347 additions & 0 deletions LICENSE.txt

Large diffs are not rendered by default.

50 changes: 48 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,48 @@
# acquiring-sdk-java
Worldline Acquiring Java Server SDK
# Worldline Acquiring Java SDK

## Introduction

The Java SDK helps you to communicate with the Worldline Acquiring API. Its primary features are:

* convenient Java wrapper around the API calls and responses
* marshalls Java request objects to HTTP requests
* unmarshalls HTTP responses to Java response objects or Java exceptions
* handling of all the details concerning authentication
* handling of required metadata

See the [Worldline Acquiring Documentation](https://docs.acquiring.worldline-solutions.com/Developer-Tools/sdk/java) for more information on how to use the SDK.

## Structure of this repository

This repository consists out of four main components:

1. The source code of the SDK itself: `/src/main/java/` and `/src/main/generated/`
2. The source code of the SDK unit tests: `/src/test/java/`
3. The source code of the integration tests: `/src/it/java/`

## Installation

Assuming you have [Maven](http://maven.apache.org/) installed, simply include the SDK as a Maven dependency:

<dependency>
<groupId>com.worldline-solutions.acquiring</groupId>
<artifactId>acquiring-sdk-java</artifactId>
<version>x.y.z</version>
</dependency>

Alternatively, download the latest version of the SDK from GitHub. Choose the `acquiring-sdk-java-x.y.z-bin.zip` file from the [releases](https://github.com/Worldline-Acquiring/acquiring-sdk-java/releases) page, where `x.y.z` is the version number. Add all JAR files inside the `lib` folder of this file to your project, except for `acquiring-sdk-java-x.y.z-javadoc.jar` and `acquiring-sdk-java-x.y.z-sources.jar`.

## Building the repository

This repository uses [Maven](http://maven.apache.org/) to build. To build the SDK, execute the following command from its root directory (which contains the `pom.xml` file):

mvn -clean package

The build will generate the following files in the `target` directory, where `x.y.z` is the version number:
* `acquiring-sdk-java-x.y.z.jar`, containing the compiled class files
* `acquiring-sdk-java-x.y.z-javadoc.jar`, containing the generated Javadoc
* `acquiring-sdk-java-x.y.z-sources.jar`, containing the source code
* `acquiring-sdk-java-x.y.z-src.zip`, containing the contents of this folder
* `acquiring-sdk-java-x.y.z-bin.zip`, containing the necessary JAR files for standalone deployments

To use it add all JAR files inside the `lib` folder of the `acquiring-sdk-java-x.y.z-bin.zip` file to your project, except for `acquiring-sdk-java-x.y.z-javadoc.jar` and `acquiring-sdk-java-x.y.z-sources.jar`.
218 changes: 218 additions & 0 deletions checkstyle.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,218 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Checkstyle//DTD Checkstyle Configuration 1.3//EN" "https://checkstyle.org/dtds/configuration_1_3.dtd">

<module name="Checker">
<property name="severity" value="warning"/>
<module name="TreeWalker">
<!-- Annotations -->
<module name="AnnotationLocation">
<property name="allowSamelineSingleParameterlessAnnotation" value="false"/>
</module>
<module name="AnnotationUseStyle"/>
<module name="MissingDeprecated"/>
<module name="MissingOverride"/>
<module name="PackageAnnotation"/>
<module name="SuppressWarnings"/>

<!-- Block Checks -->
<module name="AvoidNestedBlocks"/>
<module name="EmptyBlock">
<property name="option" value="text"/>
</module>
<module name="EmptyCatchBlock"/>
<module name="LeftCurly">
<property name="ignoreEnums" value="false"/>
</module>
<module name="NeedBraces"/>
<module name="RightCurly"/>

<!-- Class Design -->
<module name="FinalClass"/>
<module name="HideUtilityClassConstructor"/>
<module name="InterfaceIsType"/>
<module name="MutableException"/>
<module name="OneTopLevelClass"/>
<module name="ThrowsCount">
<property name="max" value="3"/>
</module>

<!-- Coding -->
<module name="ArrayTrailingComma"/>
<module name="AvoidDoubleBraceInitialization"/>
<module name="CovariantEquals"/>
<module name="DeclarationOrder">
<property name="ignoreModifiers" value="true"/>
</module>
<module name="DefaultComesLast"/>
<module name="EmptyStatement"/>
<module name="EqualsAvoidNull"/>
<module name="EqualsHashCode"/>
<module name="FallThrough">
<property name="checkLastCaseGroup" value="true"/>
<property name="reliefPattern" value="\$FALL-THROUGH\$|fallthru|falls? ?through"/>
</module>
<module name="IllegalInstantiation">
<property name="classes" value="java.lang.Boolean, java.lang.Byte, java.lang.Character, java.lang.Short, java.lang.Integer, java.lang.Long, java.lang.Float, java.lang.Double"/>
</module>
<module name="IllegalThrows"/>
<module name="InnerAssignment"/>
<module name="MissingSwitchDefault"/>
<module name="MultipleVariableDeclarations"/>
<module name="NestedForDepth">
<property name="max" value="3"/>
</module>
<module name="NestedIfDepth">
<property name="max" value="3"/>
</module>
<module name="NestedTryDepth">
<property name="max" value="3"/>
</module>
<module name="NoFinalizer"/>
<module name="OneStatementPerLine">
<property name="treatTryResourcesAsStatement" value="true"/>
</module>
<module name="PackageDeclaration"/>
<module name="SimplifyBooleanExpression"/>
<module name="SimplifyBooleanReturn"/>
<module name="StringLiteralEquality"/>
<module name="SuperClone"/>
<module name="SuperFinalize"/>
<module name="UnnecessaryParentheses"/>
<module name="UnnecessarySemicolonAfterOuterTypeDeclaration"/>
<module name="UnnecessarySemicolonAfterTypeMemberDeclaration"/>
<module name="UnnecessarySemicolonInEnumeration"/>
<module name="UnnecessarySemicolonInTryWithResources"/>
<module name="UnusedLocalVariable"/>

<!-- Imports -->
<module name="AvoidStarImport"/>
<module name="IllegalImport">
<property name="illegalPkgs" value="sun, sunw, com.oracle, com.sun"/>
</module>
<module name="ImportOrder">
<property name="option" value="top"/>
<property name="groups" value="java,javax,jakarta,org,com,nl"/>
<property name="separated" value="true"/>
<property name="ordered" value="true"/>
<property name="separatedStaticGroups" value="true"/>
<property name="sortStaticImportsAlphabetically" value="true"/>
</module>
<module name="RedundantImport"/>
<module name="UnusedImports"/>

<!-- Javadoc Comments -->
<module name="AtclauseOrder"/>
<module name="InvalidJavadocPosition"/>
<module name="JavadocBlockTagLocation"/>
<module name="JavadocContentLocation"/>
<module name="JavadocMethod">
<property name="accessModifiers" value="public,protected"/>
<property name="allowMissingParamTags" value="true"/>
<property name="allowMissingReturnTag" value="true"/>
</module>
<module name="JavadocMissingLeadingAsterisk"/>
<module name="JavadocMissingWhitespaceAfterAsterisk"/>
<module name="JavadocStyle">
<property name="scope" value="protected"/>
<property name="checkFirstSentence" value="false"/>
</module>
<module name="JavadocType">
<property name="excludeScope" value="anoninner"/>
<property name="authorFormat" value="^.+ .+$"/>
<property name="versionFormat" value="^\d+\.\d+\.\d+"/>
</module>
<module name="NonEmptyAtclauseDescription"/>
<module name="RequireEmptyLineBeforeBlockTagGroup"/>

<!-- Miscellaneous -->
<module name="ArrayTypeStyle"/>
<module name="CommentsIndentation"/>
<module name="Indentation">
<property name="arrayInitIndent" value="8"/>
<property name="lineWrappingIndentation" value="8"/>
<property name="caseIndent" value="0"/>
</module>
<module name="NoCodeInFile"/>
<module name="OuterTypeFilename"/>
<module name="UpperEll"/>

<!-- Modifiers -->
<module name="ModifierOrder"/>
<module name="RedundantModifier"/>

<!-- Naming Conventions -->
<module name="ClassTypeParameterName"/>
<module name="ConstantName"/>
<module name="InterfaceTypeParameterName"/>
<module name="LambdaParameterName"/>
<module name="LocalFinalVariableName"/>
<module name="LocalVariableName"/>
<module name="MemberName"/>
<module name="MethodName"/>
<module name="MethodTypeParameterName"/>
<module name="PackageName"/>
<module name="ParameterName"/>
<module name="PatternVariableName"/>
<module name="RecordComponentName"/>
<module name="RecordTypeParameterName"/>
<module name="StaticVariableName"/>
<module name="TypeName"/>

<!-- Size Violations -->
<module name="OuterTypeNumber"/>

<!-- Whitespace -->
<module name="EmptyForInitializerPad">
<property name="option" value="space"/>
</module>
<module name="EmptyForIteratorPad">
<property name="option" value="space"/>
</module>
<module name="EmptyLineSeparator">
<property name="allowNoEmptyLineBetweenFields" value="true"/>
<property name="allowMultipleEmptyLines" value="false"/>
<property name="allowMultipleEmptyLinesInsideClassMembers" value="false"/>
</module>
<module name="GenericWhitespace"/>
<module name="MethodParamPad"/>
<module name="NoLineWrap"/>
<module name="NoWhitespaceAfter">
<property name="tokens" value="AT,INC,DEC,UNARY_MINUS,UNARY_PLUS,BNOT,LNOT,DOT,ARRAY_DECLARATOR,INDEX_OP,METHOD_REF"/>
</module>
<module name="NoWhitespaceBefore">
<property name="allowLineBreaks" value="true"/>
</module>
<module name="NoWhitespaceBeforeCaseDefaultColon"/>
<module name="OperatorWrap"/>
<module name="ParenPad"/>
<module name="SeparatorWrap">
<property name="option" value="nl"/>
<property name="tokens" value="DOT,AT,METHOD_REF"/>
</module>
<module name="SeparatorWrap">
<property name="option" value="eol"/>
<property name="tokens" value="COMMA,ELLIPSIS"/>
</module>
<module name="TypecastParenPad"/>
<module name="WhitespaceAfter"/>
<module name="WhitespaceAround">
<property name="ignoreEnhancedForColon" value="false"/>
</module>
</module>

<!-- Miscellaneous -->
<module name="NewlineAtEndOfFile"/>
<module name="Translation"/>
<module name="UniqueProperties"/>

<!-- Whitespace -->
<module name="FileTabCharacter">
<property name="eachLine" value="true"/>
</module>

<!-- Disable name checks for generated code -->
<module name="SuppressionSingleFilter">
<property name="files" value="src[\\/]main[\\/]generated[\\/].*"/>
<property name="checks" value="MemberName|MethodName"/>
</module>
</module>
Loading

0 comments on commit 2eaf9ea

Please sign in to comment.