Getting "Expected input credential was not present" error when tried pullfundstransaction in POSTMAN

API_Products
Visa Developer Support Specialist

Re: Getting "Expected input credential was not present" error when tried pullfundstransact

Hi akshaymhatre,

 

In order for us to further investigate the Foreign Exchange Rates API issue, can you please provide more information on the error you have received? Please send the response request of the error received, screenshot and the Correlation ID. Please let us know if you have other questions.
 
Below are the steps to get the Correlation ID using a Google Chrome browser.
1>Open Chrome menu.
2>Click on More tools then Developer tools.
3>Check the box to Preserve Log for the Network Tab.
4>Then try to click on the add API link.
5>You can find the Correlation ID in the network log for add API call.

 




Thanks,

Diana



Was your question answered? Don't forget to click on "Accept as Solution" to help other devs find the answer to the same question.

akshaymhatre
Helper

Re: Getting "Expected input credential was not present" error when tried pullfundstransact

I was able to resolve this. Had to make a few changes in the delegate method for didReceiveAuthChallenge() in my app.

There is no sample project for Swift/iOS in the getting started guide. Let's get together and put one out there.

API_Products
Visa Developer Support Specialist

Re: Getting "Expected input credential was not present" error when tried pullfundstransact

Hi @akshaymhatre,

 

Thanks for sharing with us your success in resolving the issue! Can you please let me know what were the few changes that you did in the delegate method for didReceiveAuthChallenge() in your app?

 

 



Thanks,

Diana



Was your question answered? Don't forget to click on "Accept as Solution" to help other devs find the answer to the same question.

akshaymhatre
Helper

Re: Getting "Expected input credential was not present" error when tried pullfundstransact

The didReceiveChallenge method is invoked twice with different authenticationMethod.

Once with NSURLAuthenticationMethodServerTrust and second time with NSURLAuthenticationMethodClientCertificate.

I needed to pass the p12 certificate bundle for the NSURLAuthenticationMethodClientCertificate challenge.

For NSURLAuthenticationMethodServerTrust, had to do the performDefaultHandling.

shminerve
Regular Visitor

Re: Getting "Expected input credential was not present" error when tried pullfundstransact

Hi,

 

i'm getting same error. I'm using PHP + Postman.

 

The helloworld test is working well.

 

Bellow what i'm getting :

 

[HTTP Status: 400
]
[HTTP/1.1 100 Continue

HTTP/1.1 400 Bad Request
Server: nginx
Date: Thu,
02 Dec 2021 17: 46: 00 GMT
Content-Type: application/json;charset=UTF-8
Content-Length: 130
Connection: keep-alive
X-SERVED-BY: l73c013
X-CORRELATION-ID: 1638467160_136_1427929218_l73c013_VDP_WS
X-ERROR-ORIGIN: 9200
X-APP-STATUS: 400
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
Cache-Control: no-cache, no-store, must-revalidate
Pragma: no-cache
Expires: -1
X-Cnection: close

{
"responseStatus": {
"status": 400,
"code": "9125",
"severity": "ERROR",
"message": "Expected input credential was not present",
"info": ""
}
}
]
Error connecting to the API (https: //sandbox.api.visa.com/acs/v2/payments/authorizations/voids)

jenn_kh
Community Moderator

Re: Getting "Expected input credential was not present" error when tried pullfundstransact

Thank you for reaching out, @shminerve! An agent is looking into this for you and will get back to you shortly. If any community members know of a solution, please feel free to respond in this thread. - Jenn

SLi
Visa Developer Support Specialist
Visa Developer Support Specialist

Re: Getting "Expected input credential was not present" error when tried pullfundstransact

Hi @shminerve,

 

The Visa Payment Processing Authorization API requires Message Level Encryption (MLE). Please ensure that you are encrypting the request payload with the proper MLE credentials. 

 

Please refer to the MLE resources in the below links:

Documentation: https://developer.visa.com/pages/encryption_guide

 

Tutorial: 

https://community.developer.visa.com/t5/Message-Level-Encryption/How-to-run-MLE-Sample-Code-Project/...

 

Hope this helps, please reach back out with any further questions.

 


Best,
Stacey

Was your question answered? Don't forget to click on "Accept as Solution" to help other devs find the answer to the same question.
shminerve
Regular Visitor

Re: Getting "Expected input credential was not present" error when tried pullfundstransact

Hi,

 

followed tutorial bbut facing another issue, decrypt method returned false.

here my php code for encrypt and decrypt, what i'm doing wrong please ?

 

public function encryptPayload() {

$username = 'xxxxx';
$password = 'xxxxx';

$client_cert = 'client_cert_path';
$private_key = 'private_key_path';

$mleClientPrivateKeyPath = 'mleClientPrivateKeyPath';
$mleClientPublicCertificatePath = 'mleClientPrivateKeyPath'
$mleServerPublicCertificatePath = 'mleServerPublicCertificatePath'
$keyId = 'xxxxxx';
$acquiringBin = '408999';
$localTransactionDateTime = date_format(new DateTime(), "Y-m-d\TH:i:s");;


$payload = '{
"amount": "124.05",
"senderAddress": "901 Metro Center Blvd",
"localTransactionDateTime": "' . $localTransactionDateTime . '",
"pointOfServiceData": {
"panEntryMode": "90",
"posConditionCode": "00",
"motoECIIndicator": "0"
},
"recipientPrimaryAccountNumber": "4957030420210496",
"colombiaNationalServiceData": {
"addValueTaxReturn": "10.00",
"taxAmountConsumption": "10.00",
"nationalNetReimbursementFeeBaseAmount": "20.00",
"addValueTaxAmount": "10.00",
"nationalNetMiscAmount": "10.00",
"countryCodeNationalService": "170",
"nationalChargebackReason": "11",
"emvTransactionIndicator": "1",
"nationalNetMiscAmountType": "A",
"costTransactionIndicator": "0",
"nationalReimbursementFee": "20.00"
},
"cardAcceptor": {
"address": {
"country": "USA",
"zipCode": "94404",
"county": "San Mateo",
"state": "CA"
},
"idCode": "CA-IDCode-77765",
"name": "Visa Inc. USA-Foster City",
"terminalId": "TID-9999"
},
"senderReference": "",
"transactionIdentifier": "381228649430015",
"acquirerCountryCode": "840",
"acquiringBin": "' . $acquiringBin . '",
"retrievalReferenceNumber": "412770451018",
"senderCity": "Foster City",
"senderStateCode": "CA",
"systemsTraceAuditNumber": "451018",
"senderName": "Mohammed Qasim",
"businessApplicationId": "AA",
"settlementServiceIndicator": "9",
"merchantCategoryCode": "6012",
"transactionCurrencyCode": "USD",
"recipientName": "rohan",
"senderCountryCode": "124",
"sourceOfFundsCode": "05",
"senderAccountNumber": "4653459515756154"
}';

 

// The key encryption algorithm manager with the RSA-OAEP-256 algorithm.
$keyEncryptionAlgorithmManager = new AlgorithmManager([new RSAOAEP256(),]);

// The content encryption algorithm manager with the A128GCM algorithm.
$contentEncryptionAlgorithmManager = new AlgorithmManager([new A128GCM(),]);

// The compression method manager with the DEF (Deflate) method.
$compressionMethodManager = new CompressionMethodManager([new Deflate(),]);

// We instantiate our JWE Builder.
$jweBuilder = new JWEBuilder($keyEncryptionAlgorithmManager, $contentEncryptionAlgorithmManager, $compressionMethodManager);

// Our key.
$jwk = JWKFactory::createFromCertificateFile($mleServerPublicCertificatePath);

$milliseconds = round(microtime(true) * 1000);

$jwe = $jweBuilder
->create() // We want to create a new JWE
->withPayload($payload) // We set the payload
->withSharedProtectedHeader([
'alg' => 'RSA-OAEP-256', // Key Encryption Algorithm
'enc' => 'A128GCM', // Content Encryption Algorithm
'iat' => $milliseconds, // Current Time Stamp in milliseconds
'kid' => $keyId
])
->addRecipient($jwk) // We add a recipient (a shared key or public key).
->build(); // We build it

$serializer = new CompactSerializer();
$token = $serializer->serialize($jwe, 0);
return json_encode(['encryptedPayload' => $token], JSON_PRETTY_PRINT);
}


public function decryptJwe(Request $request) {

$encryptedPayload=$request->input('encryptedPayload');

$username = 'xxxxx';
$password = 'xxxxx';

$client_cert = 'client_cert_path';
$private_key = 'private_key_path';

$mleClientPrivateKeyPath = 'mleClientPrivateKeyPath';
$mleClientPublicCertificatePath = 'mleClientPrivateKeyPath'
$mleServerPublicCertificatePath = 'mleServerPublicCertificatePath'
$keyId = 'xxxxxx';

// The key encryption algorithm manager with the RSA-OAEP-256 algorithm.
$keyEncryptionAlgorithmManager = new AlgorithmManager([new RSAOAEP256(),]);

// The content encryption algorithm manager with the A128GCM algorithm.
$contentEncryptionAlgorithmManager = new AlgorithmManager([new A128GCM(),]);

// The compression method manager with the DEF (Deflate) method.
$compressionMethodManager = new CompressionMethodManager([new Deflate(),]);

// We instantiate our JWE Decrypter.
$jweDecrypter = new JWEDecrypter($keyEncryptionAlgorithmManager, $contentEncryptionAlgorithmManager, $compressionMethodManager);

// Our key.
$jwk = JWKFactory::createFromKeyFile($private_key);
//$encryptedPayload = json_decode($encryptedPayload, true);

//$token = $encryptedPayload['encData'];
$token = $encryptedPayload;

$serializerManager = new JWESerializerManager([new CompactSerializer(),]);

$jwe = $serializerManager->unserialize($token);

$success = $jweDecrypter->decryptUsingKey($jwe, $jwk, 0);

return json_encode(['success' => $success], JSON_PRETTY_PRINT);


/*if ($success) {
$jweLoader = new JWELoader(
$serializerManager,
$jweDecrypter,
null
);
$jwe = $jweLoader->loadAndDecryptWithKey($token, $jwk, $recipient);
return $jwe->getPayload();
} else {
throw new RuntimeException('Error Decrypting JWE');
}*/


}

 

 

shminerve
Regular Visitor

Re: Getting "Expected input credential was not present" error when tried pullfundstransact

Solved
shminerve
Regular Visitor

Re: Getting "Expected input credential was not present" error when tried pullfundstransact

Hi, i solved decrypting issue (thanks for your help).

Now i'm trying to call this endpoint : https://sandbox.api.visa.com/acs/v2/payments/authorizations/voids , i'm getting

[details] => Array
(
[message] => Error in processing request, Please Contact Visa Inc.
)
[status] => 404

The decrypting JJWE is sucess, i don't undersstand 404 ERROR (i'm using this doc : https://developer.visa.com/capabilities/vpp/reference#tag/Authorization-API_/paths/~1acs~1v2~1paymen...

Thnaks for your help again.