Re: Enroll PAN api testing in Sandbox Account.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Enroll PAN api testing in Sandbox Account.
"clientAppID": "APP1",
"locale": "en_US",
"panSource": "MOBILEAPP",
"encPaymentInstrument": ""
}
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Enroll PAN api testing in Sandbox Account.
I'm looking into this for you.
Thanks,
Ricardo
Was your question answered? Don't forget to click on "Accept as Solution" to help other devs find the answer to the same question.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Enroll PAN api testing in Sandbox Account.
Hi there,
There will be no Test data on the portal for this field but In the VTS guides we have the details on how to get the value for encPaymentInstrument. This is an encrypted value which uses JSON Web Encryption.
Find the information here:
https://qaint.vdp.visa.com/products/vts/guides#merchants_and_wallet_providers
Let me know how this works out!
-Ricardo
Was your question answered? Don't forget to click on "Accept as Solution" to help other devs find the answer to the same question.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Enroll PAN api testing in Sandbox Account.
MessageDigest md = MessageDigest.getInstance("SHA-256");
byte[] digest = md.digest(shared_secret.getBytes("UTF-8"));
JsonWebEncryption jwe = new JsonWebEncryption();
// A256GCMKW for key wrap
jwe.setAlgorithmHeaderValue(KeyManagementAlgorithmIdentifiers.A256GCMKW);
// A256GCM for content encryption
jwe.setEncryptionMethodHeaderParameter(ContentEncryptionAlgorithmIdentifiers.AES_256_GCM);
// the key (from above)
jwe.setKey(new SecretKeySpec(digest, "AES"));
// whatever content you want to encrypt
jwe.setPayload("{\"accountNumber\":\"4957031040790002\",\"cvv2\":\"758\",\"billingAddress\":{\"country\":\"BAN\"},\"name\":\"Rabbi\",\"expirationDate\":{\"month\":\"10\",\"year\":\"2020\"}}");
// Produce the JWE compact serialization, which is where the actual encryption is done.
// The JWE compact serialization consists of five base64url encoded parts
// combined with a dot ('.') character in the general format of
// <header>.<encrypted key>.<initialization vector>.<ciphertext>.<authentication tag>
String serializedJwe = jwe.getCompactSerialization();
"clientAppID": "MyWallet",
"locale": "en_US",
"panSource": "MOBILEAPP",
"encPaymentInstrument": "eyJhbGciOiJBMjU2R0NNS1ciLCJlbmMiOiJBMjU2R0NNIiwiaXYiOiJOcFZ5UW9Sb0lYZERiTXBVIiwidGFnIjoiOXYyYlM2dDByM0dORm55ZGd3SldOdyJ9.TVME0j9MVYct95P_juiAHXSJGE1gAWupG8KYpzIO19A.Iz_ULcaT7pHeQlcg.iqvuloANeaHxLA8su5dWzt9iGCpWsyxt5XdlONMLgylcMvyadnBH3wFX5pEnyG2wLBO-J-N5Cih2f5tl7jp19s_d4R1VUNat6keSoN36KXrKqsJtro9-C7njckXrP0ap6GsMILaN33KLuHJSMhoLvyVp5AgsYk8dLARmEPE8Bhk4UUMj4efkv_OmbZgWS09kSQ.xRV4VxN-93x756TCL67EIw"
}
"errorResponse": {
"status": 401,
"message": "Token Validation Failed",
"reason": "inputValidationError",
"details": [
{
"location": "x-pay-token"
}
]
}
}
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Enroll PAN api testing in Sandbox Account.
Hi,
I am batteling with the exact same problem but from C#.
I have assembled this method below but the error received is the same as which you did and I would like to know if you ever managed to get past this issue?
Any help will be greatly appreciated.
public static string JWEEncodeJose(string message,string key, string secret)
{
HMACSHA256 hmacsha256 = new HMACSHA256();
var keyToUse = hmacsha256.ComputeHash(Encoding.ASCII.GetBytes(secret));
long expireTime = ((long)DateTime.UtcNow.AddHours(1).Subtract(new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc)).TotalMilliseconds) / 1000;
var extraHeaders = new Dictionary<string, object>()
{
{ "kid", key },
{ "iat", expireTime.ToString() }
};
string result = Jose.JWT.Encode(message, keyToUse, JweAlgorithm.A256GCMKW, JweEncryption.A256GCM,extraHeaders: extraHeaders);
return result;
}
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Enroll PAN api testing in Sandbox Account.
did anybody resolved this?