Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 2 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,10 @@
# Adyen APIs Library for Java
The Adyen API Library for Java enables you to work with Adyen APIs and Hosted Payment Page.

## Requirements

* Java 8 or higher

## Installation


## Usage
* Java 7 or higher

## Documentation

## Support

Explain how to get support.

## Licence

MIT license see LICENSE
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
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>com.adyen</groupId>
<artifactId>java-api-library</artifactId>
<artifactId>adyen-client</artifactId>
<packaging>jar</packaging>
<version>0.0.1-SNAPSHOT</version>
<name>Adyen Java API Client Library</name>
Expand Down
14 changes: 13 additions & 1 deletion src/main/java/com/adyen/Util/Util.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public static <T> String implode(String glue, List<T> list) {
return sb.toString();
}


/**
* Returns an Amount struct to use on requests
*
Expand All @@ -39,14 +40,25 @@ public static <T> String implode(String glue, List<T> list) {
* @return
*/
public static Amount createAmount(String amount, String currency) {
return createAmount(new BigDecimal(amount), currency);
}

/**
* Returns an Amount struct to use on requests
*
* @param amount
* @param currency
* @return
*/
public static Amount createAmount(BigDecimal amount, String currency) {
Amount amountData = new Amount();
amountData.setCurrency(currency);
Long amountValue;

//Adding decimal point depending on the currency
amountValue = new BigDecimal(10)
.pow(getDecimalPlaces(currency))
.multiply(new BigDecimal(amount))
.multiply(amount)
.longValue();

amountData.setValue(amountValue);
Expand Down
1 change: 1 addition & 0 deletions src/main/java/com/adyen/model/AbstractPaymentRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

import com.adyen.serializer.DateSerializer;
import com.adyen.serializer.DateTimeGMTSerializer;
import com.adyen.model.recurring.Recurring;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;

Expand Down
Loading