Giter Site home page Giter Site logo

americanexpress / amex-api-java-client-core Goto Github PK

View Code? Open in Web Editor NEW
26.0 15.0 25.0 87 KB

Library for authenticating with APIs published to the Amex for Developers portal.

License: Apache License 2.0

Java 100.00%
amex-for-developers authentication api amex

amex-api-java-client-core's Introduction

amex-api-java-client-core

This library encapsulates header creation necessary to authenticate with APIs published to the Amex for Developers portal.

Usage

Code Samples

Code samples have been provided for each API that is callable via this library.

Artifacts

Artifacts are coming soon to JCenter. Stay tuned!

Contributing

We welcome Your interest in the American Express Open Source Community on Github. Any Contributor to any Open Source Project managed by the American Express Open Source Community must accept and sign an Agreement indicating agreement to the terms below. Except for the rights granted in this Agreement to American Express and to recipients of software distributed by American Express, You reserve all right, title, and interest, if any, in and to Your Contributions. Please fill out the Agreement.

License

Any contributions made under this project will be governed by the Apache License 2.0.

Code of Conduct

This project adheres to the American Express Community Guidelines. By participating, you are expected to honor these guidelines.

Analytics

amex-api-java-client-core's People

Contributors

dvysotskiy avatar osgduff avatar sunny-hirani avatar tklever avatar twwio 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

Watchers

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

amex-api-java-client-core's Issues

getting NoClassDefFoundError in samles/AmexCardApplicationOffersClient.java

Exception in thread "main" java.lang.NoClassDefFoundError: okhttp3/MediaType
at Experemental.AmexCardApplicationOffersClient.(AmexCardApplicationOffersClient.java:23)
Caused by: java.lang.ClassNotFoundException: okhttp3.MediaType
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 1 more

Account data encryption failing using amex encryption util

{JOSEException@20708} "com.nimbusds.jose.JOSEException: Couldn't create AES/GCM/NoPadding cipher: unknown parameter type."
detailMessage = "Couldn't create AES/GCM/NoPadding cipher: unknown parameter type."
cause = {InvalidAlgorithmParameterException@20711} "java.security.InvalidAlgorithmParameterException: unknown parameter type."
detailMessage = "unknown parameter type."
cause = {InvalidAlgorithmParameterException@20711} "java.security.InvalidAlgorithmParameterException: unknown parameter type."
stackTrace = {StackTraceElement[110]@20719}
0 = {StackTraceElement@20721} "org.bouncycastle.jce.provider.JCEBlockCipher.engineInit(Unknown Source)"
1 = {StackTraceElement@20722} "javax.crypto.Cipher.init(Cipher.java:1397)"
2 = {StackTraceElement@20723} "javax.crypto.Cipher.init(Cipher.java:1330)"
3 = {StackTraceElement@20724} "com.nimbusds.jose.crypto.impl.AESGCM.encrypt(AESGCM.java:121)"
4 = {StackTraceElement@20725} "com.nimbusds.jose.crypto.impl.ContentCryptoProvider.encrypt(ContentCryptoProvider.java:192)"
5 = {StackTraceElement@20726} "com.nimbusds.jose.crypto.AESEncrypter.encrypt(AESEncrypter.java:222)"
6 = {StackTraceElement@20727} "com.nimbusds.jose.JWEObject.encrypt(JWEObject.java:370)"
7 = {StackTraceElement@20728} "com.mmt.tms.utility.gateway.AmexTokenGatewayUtil.encrypt(AmexTokenGatewayUtil.java:49)"

Maven install fails

Artifact bcprov-jdk15on is marked with version 1.6, but maven central does not have that version and maven install fails, after chaging for 1.60 still fails but because the test suit is not passing. So I changed jackson-annotations version to 2.9.3.

I guess this issue is just to inform what I did to build successfully.

Could you fix the pom.xml?
Thanks.

PayWithPoints - sandbox internal server error

We're experimenting with pay-with-points feature, and stumbling upon a sandbox issue.
I have created a unit test that is using your sample code:

gibffe@c028fc6

I have included my sandbox credentials in that file.

Errors we're seeing when using your sample client:

{
  "error_code": "163001",
  "error_description": "Amex internal system error",
  "error_type": "Invalid_Request",
  "more_info": {
    "merchant_client_id": "PWP_ONLINE",
    "response_code": "INQ3001",
    "response_description": "Amex internal system error",
    "status": "fail",
    "timestamp": "2019-07-15T13:40:55.694-07:00"
  }
}

when changing merchant id to PWP_POS, error is:

{
  "error_code": "161001",
  "error_description": "Invalid Request Id",
  "error_type": "Invalid_Request",
  "more_info": {
    "merchant_client_id": "PWP_POS",
    "response_code": "INQ1001",
    "response_description": "Invalid Request Id",
    "status": "fail",
    "timestamp": "2019-07-15T13:42:47.806-07:00"
  }
}

Please help :)

In C# 3-Party Payment intigration Getting error

I am working on C# 3-Party Payment integration.

For amex post i have below parameters.

Field Name Value
vpc_Version 1
vpc_Command pay
vpc_AccessCode XXXXXXX
vpc_MerchTxnRef 6AQ55F3
vpc_Merchant TEST1234567890
vpc_OrderInfo TEST002019
vpc_Amount 100
vpc_Currency SGD
vpc_Locale en

and i have used below function for create hash

public static string ComputeSha256HashNewString(AMEXModel Model)
{
var secureSecret = "BB48A64077A1CBF08FF0D91C5A9FE42B";
var args = new SortedDictionary<string, string>()
{
//{"user_SessionId" , Model.user_SessionId},
{"vpc_AccessCode" , Model.vpc_AccessCode},
{"vpc_Amount" , Model.vpc_Amount},
{"vpc_Command" , Model.vpc_Command},
{"vpc_Currency" , Model.vpc_Currency},
{"vpc_Locale" , Model.vpc_Locale},
{"vpc_Merchant" , Model.vpc_Merchant},
{"vpc_MerchTxnRef" , Model.vpc_MerchTxnRef},
{"vpc_OrderInfo" , Model.vpc_OrderInfo},
{"vpc_ReturnURL" , Model.vpc_ReturnURL},
{"vpc_Version" , Model.vpc_Version}
};
var getPart = "";
foreach (var arg in args)
{
getPart += arg.Key + "=" + arg.Value + "&";
}
getPart = getPart.TrimEnd('&');
var keyBytes = new byte[secureSecret.Length / 2];
for (int i = 0; i < keyBytes.Length; i++)
{
keyBytes[i] = byte.Parse(secureSecret.Substring(i * 2, 2), System.Globalization.NumberStyles.HexNumber);
}
var hmac = new HMACSHA256(keyBytes);
var hash = hmac.ComputeHash(Encoding.ASCII.GetBytes(getPart));
var hashString = BitConverter.ToString(hash).Replace("-", "");
return hashString;
}

after create hash i m trying post url like below.
https://vpos.amxvpos.com/vpcpay?vpc_AccessCode=XXXXXXX&vpc_Amount=100&vpc_Command=pay&vpc_Currency=SGD&vpc_Locale=en&vpc_Merchant=TEST1234567890&vpc_MerchTxnRef=6AQ55F3&vpc_OrderInfo=TEST002019&vpc_ReturnURL=http://localhost:50582/Home/ThankYou&vpc_Version=1&vpc_SecureHash=03358B9D8CD1B34781AD5251BBD8909E3F5E8C7786527AC600FCF925583DB865&vpc_SecureHashType=SHA256

but i am getting below error.
HTTP Status - 400
E5000: Cannot form a matching secure hash based on the merchant's request using either of the two merchant's secrets

Please advice for above issue.

API for getting Transactional Data

Sorry if thisn't the correct repo for this but it was the closest I could find for this request.

I am looking for an API I can use to get my transactional data. I want some way to get all my transactions between some period of time. It would be great if I could then use the API to submit tags for the transactions.

So the problem that I am trying to solve is that the tags on the site take too much time and effort to do them in bulk. I would rather be queried for the tag at or near the time of the transaction. I presently have the SMS feature set to >= $10. I have a bot that can then ask me for the transaction tag and record it locally for my own accounting purposes. I have some anti-aliasing logic to reconcile the pending transactions with the posted transactions. I also scrape the recent transactions csv from the site to make sure I don't miss anything. All of this is buggy and super hacky and having an API would greatly improve this. Or if you could implement similar capabilities into the SMS bot or Android App.

Thanks

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.