Giter Site home page Giter Site logo

adyen / adyen-java-api-library Goto Github PK

View Code? Open in Web Editor NEW
114.0 33.0 134.0 13.24 MB

Adyen API Library for Java

License: MIT License

Java 99.21% Shell 0.01% Mustache 0.75% Makefile 0.04%
java payments api api-client api-library payment-gateway payment-integration adyen hacktoberfest

adyen-java-api-library's People

Contributors

abhilash-adyen avatar adyenautomationbot avatar aleffio avatar alexandrosmor avatar amortj avatar andrei-dediu avatar antolo-arch avatar dependabot-preview[bot] avatar dependabot[bot] avatar djoykeabyah avatar gcatanese avatar jillingk avatar lancergr avatar maassenbas avatar martinsrenato avatar michaelpaul avatar morerice avatar renovate-bot avatar renovate[bot] avatar rickwieman avatar rikterbeek avatar rkewlani avatar sanmibuh avatar saquibsayyad avatar scriptease avatar smic1909 avatar sp00m avatar vladimirbutch avatar wboereboom avatar zurmalik avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

adyen-java-api-library's Issues

PaymentMethodDetails object includes deliveryAddress, billingAddress, and personalDetails attriutes

Library version: 2.0.0
Description
In the DefaultPaymentMethodDetails.java file, deliveryAddress, billingAddress, and personalDetails are listed as attributes of the paymentMethod object. However, you can't make a /payments call with deliveryAddress or billingAddress nested inside of the paymentMethod object (they aren't parsed by Adyen). Additionally, I don't know what the personalDetails field is, but it is not mentioned anywhere in the documentation or in our API explorer.

How can I simulate to test my interface?

Java version: 1.8
Library version: 1.5.4
Description
Dear friends,
I want to integrate the Adyen Java library in my project.We use it in IOS and Android system,but I need to do some work for purpose of encapsulation.Such as get the payment methods of my account and response it to the front end.When I want to simulate to test the payment endpoint, I always make some mistakes suck as
Exception in thread "main" ApiException{error=class ApiError {
status: 422
errorCode: 174
message: Unable to decrypt data
errorType: validation
pspReference: null
}, statusCode=422, message=HTTP Exception}
at com.adyen.service.Resource.request(Resource.java:61)
at com.adyen.service.Checkout.payments(Checkout.java:61)
at com.xxx.pay.service.AdyenService.payment(AdyenService.java:117)
at com.xxx.pay.service.AdyenService.main(AdyenService.java:144)
How can I do to settle this problem?
My code is as follows:
request.setPaymentMethod(new HashMap<String, String>());
request.putPaymentMethodItem("type", "scheme");
request.putPaymentMethodItem("encryptedCardNumber", "6771 7980 2500 0004");
request.putPaymentMethodItem("encryptedExpiryMonth", "10");
request.putPaymentMethodItem("encryptedExpiryYear", "2020");
request.putPaymentMethodItem("encryptedSecurityCode", "737");
Best regards.

Util.implode bug

Java version: 1.7.0_80
Library version: 1.3.0
Description

We are using com.adyen.Util.Util#implode method for making the notification signing string.
But we found that if any element of the list is null, it adds null string instead of adding empty string.

Enum value is missing for "Pending" result code

Java version: 1.8
Library version: 1.8.0
Description
As per Checkout API for v40 documentation (https://docs.adyen.com/api-explorer/#/PaymentSetupAndVerificationService/payments), possible values for /payments response resultCode are:

  • Authorised
  • Refused
  • RedirectShopper
  • Received
  • Cancelled
  • Pending
  • Error

In fact com.adyen.model.checkout.PaymentsResponse.ResultCodeEnum is missing "Pending" and
has an extra value "PartiallyAuthorised" which is not documented

Sample project

Hi, thank you for the library but I also would be very thankful if you can add a sample project where we can try to use it.
I created the sample project myself https://github.com/stokito/adyen-java-sample
There is some examples how to Create Market Account Holder and some related staff.
Could you please add it to Adyen repository?

Composite types are not supported by PaymentsRequest.additionalData

Java version: 1.8.0_44
Library version: 2.4.1
Description
Hi,

As per documentation for Basket content fields each "riskdata.basket.item" is a container object which should be serialized to JSON.

The "additionalData" member of com.adyen.model.checkout.PaymentsRequest is defined as Map<String, String>. There is no way to pass the Object to "additionalData" map value. The workaround is to serialize custom POJO to JSON string and then pass it as a map value to "additionalData".

It would be good to have the option to provide POJO as a value to "additionalData" (assuming POJO is properly annotated).

Thanks

Missing equals in ApplicationInfo

Library version: 1.8.0
Description

  • @AlexandrosMor ApplicationInfo doesn't override equals. Since it is called in AbstractPaymentRequest equals method, identical PaymentRequest3d objects return false for equals method.

Drop-In paymentMethod constructor

Library version: 2.5.0
Description
To better integrate with the drop-in solution, there should be a DefaultPaymentMethodDetails constructor that take in the properly formatted paymentMethod object outputted as the state of the drop-in component.
Currently, it seems like the merchant has to implement the logic of parsing the paymentMethod object and constructing a well-formatted DefaultPaymentMethodDetails object. However, this logic seems generic across all drop-in integrations and should be included in the SDK by default.

JsonSyntaxException java.text.ParseException: Unparseable date

Hello,
When I try to use RecurringDetailsResult object to getting result of recurring.listRecurringDetails(recurringDetailsRequest) i got next error :

com.google.gson.JsonSyntaxException: 2017-07-13T10:15:30+02:00
java.text.ParseException: Unparseable date: "2017-07-13T10:15:30+02:00"

It is raised in com.adyen.service.Recurring class in line :

RecurringDetailsResult result = (RecurringDetailsResult)GSON.fromJson(jsonResult, (new TypeToken<RecurringDetailsResult>() {
        }).getType());

Adding support for Idempotency Header

Java version: 1.8
Library version: 1.5.2
Description

Support for adding Idempotency-Key via Java API for all POST Requests made to adyen.
Needed for our (Adobe) integration with Adyen.

Missing ApplicationInfo setter in AbstractModificationRequest

Java version: 1.8.0_144
Library version: 2.2.0
Description

After making the upgrade from version 2.0.1 to 2.2.0, I noticed that AbstractModificationRequest is missing the method:

public T applicationInfo(ApplicationInfo applicationInfo)

Having such method (or simply a setter) would bring the following benefits:

  1. No compatibility issues will occur during the API upgrade
  2. Custom application info supplier could be used by integration

Thanks

Create separate CancelOrRefund request

Using cancel_or_refund request from the logs it is not clear that this is triggered because it is using the cancelRequest model. Create a separate CancelOrRefund model.

403 Forbidden in API calls

Java version: 8

Description

After building and running code , there is no successful response from server, I’m using a test account of the Adyen. I could use setup payment and verify payment APIs in both of java and the Golang code and certainly in the Postman application.
But all of the ThirdPartyPayment and also AccountHolder related APIs are returning 403, forbidden security error code.
In addition I am using the ClientToken as x-api-key in the requests header, without it I see 401-Unauthorized error code. I tried with basic authentication method and failed again.
Please help me to resolve these issues, I appreciate you.

SEPA direct debit

Java version: 1.8.0_202
Library version: 1.7.0
Description

I need to make a SEPA direct debit payment request.

  • Is this possible w/ this library? I can not set this payment method in com.adyen.model.PaymentRequest.
  • Is it possible to set the payment method and the required fields (like sepa.ibanNumber) in a generic way w/ this library?

Thanks for your advice.

HostedPaymentPages.getPostParametersFromDLRequest incomplete

Hello,
HostedPaymentPages.getPostParametersFromDLRequest is incomplete. Missing arguments:

  • shopperLocale
  • resURL
  • shopperEmail
  • shopper.firstName
  • shopper.lastName
  • shopper.telephoneNumber
  • brandCode
  • blockedMethods
  • allowedMethods
  • billingAddress.street
  • billingAddress.houseNumberOrName
  • billingAddress.city
  • billingAddress.postalCode
  • billingAddress.stateOrProvince
  • billingAddress.country

And sessionValidity could have a fallback with Util.calculateSessionValidity()

Regards

Logger implementation not needed

Java version: 1.8.0
Library version: 2.0.0
Description
log4j:log4j:1.2.17 dependency is not used. Please remove it, because we are getting this dependency transitively if we don't exclude it.

Checkout channel literal not found

Java version: 10.0.2
Library version: 2.0.2
Description

In the API integration documentation (https://docs.adyen.com/developers/checkout/api-integration#step1getavailablepaymentmethods) the following Java code statement (second to last line in code block) gives a "Cannot resolve symbol" warning:

paymentMethodsRequest.setChannel(CheckoutChannel.Web);

I have replaced it with:

paymentMethodsRequest.setChannel(PaymentMethodsRequest.ChannelEnum.WEB);

Could this be an issue of deprecated documentation? Thanks!

et this

If the payment is successful, the details are stored, and the recurringDetailReference is created. how can i get this recurringDetailReference. i think it will send back with response, anyone please help me to do this. please reply me back with sample java code for this. Thank you..

Missing PaymentRequest attrs in toString method

Java version: 1.8.0_162
Library version: 2.6.1
Description

I just realized that in our logs there are not appearing our requests params
I think the bug could be introduced in this commit, when the super.toString() sentence was removed

16ed51d#diff-6a97b0609fd25935f8dc3b1d305771b4L347

Now, the only logs we have are these:

{
accountInfo: null
bankAccount: null
card: null
merchantRiskIndicator: null
mpiData: null
recurringProcessingModel: null
splits: null
store: null
trustedShopper: null
threeDS2RequestData: null
}

accountChangeDate and accountCreationDate of AccountInfo are not properly serialized to JSON

Java version: 1.8.0_144
Library version: 2.2.0

Description
When com.adyen.model.checkout.PaymentsRequest is serialized to JSON, the accountCreationDate and accountChangeDate fields of com.adyen.model.AccountInfo are not serialized properly and the status 500 is retuned by /payments endpoint.

Raw request:

{  
   "accountInfo":{  
      "accountChangeDate":"2019-04-25",
      "accountCreationDate":"Apr 25, 2019 4:10:07 PM"
   },
...
}

Raw response:

{
    "status": 500,
    "errorCode": "702",
    "message": "Failed to serialize node Invalid date (year)",
    "errorType": "validation"
}

In fact, there are two issues with AccountInfo:

  1. The accountCreationDate is missing JSON adapter
  2. The JSON adapter for accountChangeDate doesn't follow the format provided in official documentation:

Date when the shopper's account was last changed.
Format: ISO 8601 YYYY-MM-DDThh:mm:ssTZD
Sample: 2017-07-17T13:42:40+01:00

It would be great if this issue could be fixed soon.

Make library Stateless

Nowadays library is stateful:
HttpURLConnectionClient.createRequest saves state at httpConnection.
This stateful causes a bad testing uses for API clients. If this class was stateless (minor changes), we can make a singleton wrapper with spring, improving the tests.

Methods equals and hashCode are absent

Java version: 1.8.x
Library version: 1.7.0
Description
Please add methods equals and hashCode to class com.adyen.model.checkout.DefaultPaymentMethodDetails. It was convenient to verify correctness of request created by application logic in tests.

Thanks,
Alex

GSON date conversion issue

Java version: 1.8
Library version: 1.5.2
GSON date conversion issue

listRecurringDetails request not able to convert the Date format

com.google.gson.JsonSyntaxException: 2018-09-25T13:25:37+02:00
at com.google.gson.internal.bind.DateTypeAdapter.deserializeToDate(DateTypeAdapter.java:81)
at com.google.gson.internal.bind.DateTypeAdapter.read(DateTypeAdapter.java:66)
at com.google.gson.internal.bind.DateTypeAdapter.read(DateTypeAdapter.java:41)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:93)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:172)
at com.google.gson.Gson.fromJson(Gson.java:795)
at com.google.gson.Gson.fromJson(Gson.java:761)
at com.google.gson.Gson.fromJson(Gson.java:710)
at com.adyen.service.Recurring.listRecurringDetails(Recurring.java:59)

[Feature request] : Possibly missing ENUM values in PaymentResult

Java version: 1.8.0
Library version: 2.0.0
Description

For 3D Secure 2.0 with classic API as described in https://docs.adyen.com/developers/3d-secure-2-classic-integration/browser-based-integration, in com.adyen.model.PaymentResult are missing ENUMS for IdentifyShopper and ChallengeShopper. Currently, we are getting resultCode "NULL".

Request (shortened)
final Payment payment = new Payment(getClient());
final PaymentResult result = payment.authorise(getPaymentRequest());

Response JSON:
{"additionalData":{"expiryDate":"8\/2018","threeds2.threeDSServerTransID":"XXXXXX","cardSummary":"1234","paymentMethod":"mc","threeds2.threeDS2Token":"XXXXXX","threeds2.threeDSMethodURL":"https:\/\/pal-test.adyen.com\/threeds2simulator\/acs\/startMethod.shtml"},"fraudResult":{"accountScore":61,"results":[…]},"pspReference":"XXXXXX","resultCode":"IdentifyShopper"}

Response Java after GSON mapping:
class PaymentResult { authCode: null paRequest: null issuerUrl: null md: null dccAmount: null dccSignature: null pspReference: XXXXXX resultCode: null additionalData: {expiryDate=8/2018, threeds2.threeDSServerTransID=XXXXXX cardSummary=1234, paymentMethod=mc, threeds2.threeDS2Token=XXXXXX, threeds2.threeDSMethodURL=https://pal-test.adyen.com/threeds2simulator/acs/startMethod.shtml} refusalReason: null fraudResult: class FraudResult { […] }] } }

TypeError when oneClickPaymentMethods is empty

Java version: 1.8
Library version: 2.4.1
Description
I am referring to support request #850193.

The class PaymentMethodsResponse has list attributes which are initialized using the value null.

private List<RecurringDetail> oneClickPaymentMethods = null;

This is a problem when the response does not contain i.e. oneClickPaymentMethods. When passing PaymentMethodsResponse to the frontend, more specifically to adyen.js, a TypeError is thrown.

adyen.js:4 Uncaught TypeError: Cannot read property 'filter' of null
    at Vc (adyen.js:4)
    at new e (adyen.js:4)
    at new e (adyen.js:4)

Please consider initializing list attributes with an empty list.

Missing `AuthenticationFinished` resultCode from PaymentResult.ResultCodeEnum

Java version: 1.8.x
Library version: 2.1.0
Description
The resultCode AuthenticationFinished is not present in PaymentResult.ResultCodeEnum for mapping when a completed 3DS challenge is submitted to /authorise3ds2 with the authenticationOnly flag set.

// Request
{
    "threeDS2Result": {
        "transStatus": "Y"
    },
    "threeDS2Token": "-",
    "merchantAccount": "-",
    "applicationInfo": {
        "adyenLibrary": {
            "name": "adyen-java-api-library",
            "version": "2.1.0"
        }
    }
}
// Response
{
    "additionalData": {
        "threeds2.threeDS2Result.dsTransID": "-",
        "threeds2.threeDS2Result.eci": "05",
        "threeds2.threeDS2Result.threeDSServerTransID": "-",
        "threeds2.threeDS2Token": "-",
        "threeds2.threeDS2Result.authenticationValue": "-",
        "threeds2.threeDS2Result.transStatus": "Y"
    },
    "pspReference": "-",
    "resultCode": "AuthenticationFinished"
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.