mastercard / mastercard-api-client-tutorial Goto Github PK
View Code? Open in Web Editor NEWGenerating and Configuring a Mastercard API Client
Home Page: https://mstr.cd/2AWz6pm
License: MIT License
Generating and Configuring a Mastercard API Client
Home Page: https://mstr.cd/2AWz6pm
License: MIT License
Hello, I have implemented this client code (csharp) for the Mastercard merchant mappings, getting an 'Internal Server Error' in response while posting the request to Mastercard Directory Services as it includes encryption and decryption.
Unfortunately, there isn't a lot of details in the error:
Response:
{"Errors":{"Error":[{"Source":"SYSTEM","ReasonCode":"SERVICE_ERROR","Description":"","Recoverable":false}]}}
P.S. I am getting a successful response while fetching an existing sample mapping record.
Support isn't helpful yet so... Thanx in advance.
Dears
I have the same issue
mentioned here
#29
#20
I followed this tutorial https://developer.mastercard.com/mdes-digital-enablement/documentation/tutorials/create-a-new-project/#6-download-client-encryption-key-sandbox
I download this github project for c#
I modified the specified fields in the doc link
but when running the test, we get all fields null, except responseId
please help
var MdesForMerchants = require('mdes_for_merchants');
cannot find module mdes_for_merchants, please how can i solve this issue ?
hello,
i'am working on tokenization project,i'am using tokenizeApi but when i send a tokenization request i get null response( all fields are null)
i don't know what is the problem.
help please
openapi-generator-cli version-manager set 5.1.0
(node:59180) UnhandledPromiseRejectionWarning: Error: java.lang.UnsupportedClassVersionError: org/openapitools/codegen/OpenAPIGenerator : Unsupported major.minor version 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)
Exception in thread "main"
at C:\Users\Rukhiya\AppData\Roaming\npm\node_modules@openapitools\openapi-generator-cli\main.js:636:32
at ChildProcess.exithandler (child_process.js:397:5)
at ChildProcess.emit (events.js:400:28)
at maybeClose (internal/child_process.js:1055:16)
at Socket. (internal/child_process.js:441:11)
at Socket.emit (events.js:400:28)
at Pipe. (net.js:675:12)
(Use node --trace-warnings ...
to show where the warning was created)
(node:59180) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict
(see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:59180) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will
terminate the Node.js process with a non-zero exit code.
Java version on my system
C:\windows\system32>java -version
java version "1.7.0_79"
Java(TM) SE Runtime Environment (build 1.7.0_79-b15)
Java HotSpot(TM) 64-Bit Server VM (build 24.79-b02, mixed mode)
Please advise how to fix this issue.
Heya, I generated a C# client from the openapi spec.
I noticed the generated API client will call paths relative to sandbox
For example TokenizeApi.CreateTokenizeWithHttpInfoAsync
Notice the path ...PostAsync<TokenizeResponseSchema>("/digitization/static/1/0/tokenize",
This works in sandbox,
baseURL https://sandbox.api.mastercard.com/mdes
+ path /digitization/static/1/0/tokenize
However if I were to use the same client in mtf or prod, the resulting path would include /digitization/static/1/0
, which would fail.
According to the api reference, the environment domains are:
prod https://api.mastercard.com/mdes/digitization/1/0/tokenize
mtf https://api.mastercard.com/mdes/digitization/mtf/1/0/tokenize
sandbox https://sandbox.api.mastercard.com/mdes/digitization/static/1/0/tokenize
I could hack TokenizeApi (and the other Api classes) to ...PostAsync<TokenizeResponseSchema>("/1/0/tokenize",
and use different baseURLs like
https://api.mastercard.com/mdes/digitization
https://api.mastercard.com/mdes/digitization/mtf
https://sandbox.api.mastercard.com/mdes/digitization/static
Works, but it's a hack. What am I missing here?
I am using PHP library for tokenization and tried to run the test case, but it is returning error message and the response does not contain any data.
I also tried the step by step guide (https://developer.mastercard.com/platform/documentation/security-and-authentication/generating-and-configuring-a-mastercard-api-client/#step-by-step-guide) and that is also returning the same result. Please see the attached screenshot for reference.
I am unable to open the csharp project in VS2015
The default XML namespace of the project must be the MSBuild XML namespace. If the project is authored in the MSBuild 2003 format, please add xmlns="http://schemas.microsoft.com/developer/msbuild/2003" to the element. If the project has been authored in the old 1.0 or 1.2 format, please convert it to MSBuild 2003 format. E:\MasterCard\mastercard-api-client-tutorial-main\csharp\Acme.App.MastercardApi.Client\Acme.App.MastercardApi.Client.csproj
The default XML namespace of the project must be the MSBuild XML namespace. If the project is authored in the MSBuild 2003 format, please add xmlns="http://schemas.microsoft.com/developer/msbuild/2003" to the element. If the project has been authored in the old 1.0 or 1.2 format, please convert it to MSBuild 2003 format. E:\MasterCard\mastercard-api-client-tutorial-main\csharp\Acme.App.MastercardApi.Client.Tests\Acme.App.MastercardApi.Client.Tests.csproj
hello,
while i'm testing i get this error message : The method buildTokenizeRequestSchema() is undefined
in this line :
TokenizeRequestSchema request = buildTokenizeRequestSchema();
help plz
After executing the below line api-client folder is created.
openapi-generator-cli generate -g csharp-netcore -i *.yaml -c config.json -o api_client
I have chosen CSharp but when I try to oepn the solution using VS2015 it is unable to load the project.
Which tool is needed to open the api-client project?
In this generated model
Acme.App.MastercardApi.Client/Model/AuthenticationMethods.cs
the id is of type int, but the openapi spec says string
this causes an error when the API client tries de-serialize a response with a large ID, essentially ending up with null Data:
{
"StatusCode": 200,
"Headers": { ... },
"Data": null,
"ErrorText": "JSON integer 3123456789 is too large or small for an Int32. Path 'authenticationMethods[0].id', line 7, position 22."
}
was this client generated by an older openapi spec perhaps?
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.