cybersource api testing via POSTMAN or test framework (SuperTest) - postman

Below API is being used by our apps (android and IOS) for payment.
https://testsecureacceptance.cybersource.com/silent/pay and at app side this URL gets loaded in WebView which works as expected.
We are trying to perform sandbox testing by including this API in our API automation tool.
We tried testing the same API via postman and we get 200 with HTML response. However, we get status as DECLINE with below error from cybersource.
"transaction_id" : "6595086289756494503004"
"message" : "AVS check failed",
"decision" : "DECLINE"
"reason_code" : "200"
Can anyone guide here on how to perform API testing without using device (android or IOS) but postman or API automation testing frameworks like supertest etc.
Response of https://testsecureacceptance.cybersource.com/silent/pay API

Related

ResetPasswordAsync fails with Invalid Token error in Asp.net core 2.1

In my Asp.Net Core 2.1 Web Api + Angular App setup, I am trying to reset user password token using identity framework. Token is generated by calling GeneratePasswordResetTokenAsync(), emailed and request is sent back from client, verified by ResetPasswordAsync. I have checked that the two tokens are same but still ResetPasswordAsync fails with Invalid Token result.
I am using PG SQL as database, and JWT for Authentication, The SecurityStamp is also not null, my client app is written in angular and served from a different web server than the one serving the web api. However when testing on local machine there is no problem.
I have enabled CORS in web api allowing any origin, however I have noticed that my client request contain
Origin: https://my-domain.com
Referer: https://my-domain.com/myangularapp
Please let me know if any info is missing, any help will be appreciated.

Extracting cookies from Postman Interceptor

I have an application which uses websso for authentication and I want to test my APIs using Postman. I used Postman Chrome App and Postman Interceptor to capture requests. These requests work fine in Chrome App. Then I've opened my saved requests in Postman Standalone App however they are not working because cookies are not transferred. Is there a way to use those requests in standalone app together with their saved cookies?
#canan,
Postman supports capturing requests and cookies from the v7.14. Install Postman interceptor extension and postman version above v7.14 and start capturing requests and cookies.
For more information on how to use interceptor go through this learning center

.NET Core Console Application JWT Authentication

I am creating a .netcore console application which makes API calls to a web application. Before it can make the API call, it needs to authenticate itself to the webapp. I am inheriting the IClientMessageInspector class and trying to add the JWT to MessageHeader.CreateHeader in the following manner -public object BeforeSendRequest(ref Message request, IClientChannel channel)
{
request.Headers.Add(MessageHeader.CreateHeader("Cookies", "m3", "jwt="+GetTheJWT()));
}
I understand that the JWT is hardcoded and would expire after a time period but currently my concern is that the JWT that I am trying to add as a part of the Header is not getting reflected in the header.
I am receiving the message as HttpRequest object in the web application and I see that JWT is missing as a part of the Cookies Property of the HttpRequest object.
The following are my queries -
1) I wanted to know whether it could be done this way?
2) What am I doing wrong?
3) Is SOAP still relevant with .netcore or do I have to use REST API?
4) Is authentication still possible with SOAP on .netcore using JWT?

getting 403 Forbidden when trying to add bulk devices on IBM IoT Platform

I'm getting "403 Forbidden" when trying to use Postman in order to add a POST call so that I can add bulk devices to IBM Watson IoT Platform
The bulk add endpoint /api/v0002/bulk/devices/add works fine for me in the Postman native app. I get the
201 Created
back and they are created.
You are sparse on details but I'd guess you are using the chrome addon. Go Native for the best Postman experience.

POST request working on localhost but not on azure

I am new to microsoft azure, but good with web api.
I have created web api services, and able to test it from postman tool when it is on localhost.
Now I have uploaded my services on azure and now I am not able to call it from postman tool.
Azure url: not working
http://******.azurewebsites.net/api/account/signIn
body
userName and password... both are string
localhost url: working
http://localhost:62676/api/account/signIn
body
userName and password... both are string
What do I need to change in services ? Please suggest.
I suggest you to enable debugging mode for your web api service in Azure to see the detailed error message and stacktrace for troubleshooting.
Alternatively, you can also enable Remote Debugging for your web api and set the necessary breakpoint to debug through your web api in Azure.