americanexpress / amex-api-java-client-core Goto Github PK
View Code? Open in Web Editor NEWLibrary for authenticating with APIs published to the Amex for Developers portal.
License: Apache License 2.0
Library for authenticating with APIs published to the Amex for Developers portal.
License: Apache License 2.0
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:
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 :)
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.
{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)"
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.
It would much easier to use this project if it was in Maven Central. A guide can be found here https://central.sonatype.org/pages/ossrh-guide.html
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
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.