Skip to content

Instantly share code, notes, and snippets.

@stcalica
Created September 27, 2023 18:41
Show Gist options
  • Save stcalica/53a0d07a555cc1d70f24ffc3d274db59 to your computer and use it in GitHub Desktop.
Save stcalica/53a0d07a555cc1d70f24ffc3d274db59 to your computer and use it in GitHub Desktop.
Mastercard Main Workspace Overview
# Check Out Our Getting Started Workspace
# Sign Up on Mastercard Developer Portal
# Get Your API Keys
# Getting your Private Keys
If you are looking for a quick and easy way to get started with our APIs with no additional code, this is the place for you.
Follow these steps to get up and running quickly with the APIs:
Sign up with Mastercard Developers
Follow the Quick Start Guide to get your project setup and get access to your API keys
Fork the collection and environment "Mastercard API Sandbox Environment" into your own Postman workspace.
Open the Environments tab and choose Mastercard API Sandbox Environment as environment
Go to your Mastercard Developers Project Dashboard and copy the consumer key into the the consumerKey variable
The private key is a little trickier. We need to convert the P12 key into an RSA key. To do that, first download the P12 key file
Then convert the P12 key into an RSA key using the following command:
openssl pkcs12 -in 'mykey.p12' | openssl rsa -out myrsa.key
If the openssl command isn't recognised, you can download the toolkit from here
When prompted, use the password/passphrase you configured when you first created the key
Now you can open the myrsa.key file you just created and copy the entire string value into the privateKey variable.
These keys are picked up through the {{privateKey}} and {{consumerKey}} variables in the Authorisation tab for each Collection which has already been configured to use OAuth 1.0
Make sure you set the Environment before you start calling the API endpoints in the collections
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment