Registry / payments / mastercard-merchant-identifier

mastercard-merchant-identifier

JSON →
library2.0.0pypypiunverified

Mastercard Merchant Identifier API Python SDK for retrieving merchant information. Version 2.0.0. Release cadence irregular, tied to API updates.

pip install mastercard-merchant-identifier
INSTALL
IMPORT
SIG · MASTERCARD-MERCHAN
M
mastercard-merchant-identifier
paymentspythonv2.0.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

ApiClient
from mastercard_api_common import ApiClient
from mastercard_merchant_identifier import ApiClient
ApiClient is in mastercard-api-common, not this SDK package.
MerchantIdentifierApi
from mastercard_merchant_identifier.rest import MerchantIdentifierApi
from mastercard_merchant_identifier import MerchantIdentifierApi
The correct import path includes the rest module.

Quickstart using environment variables for credentials and sandbox.

import os from mastercard_api_common import ApiClient from mastercard_merchant_identifier.rest import MerchantIdentifierApi consumer_key = os.environ.get('MASTERCARD_CONSUMER_KEY', '') key_alias = os.environ.get('MASTERCARD_KEY_ALIAS', '') signing_key_path = os.environ.get('MASTERCARD_SIGNING_KEY_PATH', '') api_client = ApiClient(consumer_key, key_alias, signing_key_path, sandbox=True) api = MerchantIdentifierApi(api_client) response = api.get_merchant_identifiers(merchant_id='123456') print(response)
Debug
Known issues
breakingVersion 2.0.0 changed import paths and removed the old mastercard_merchant_identifier.client module. Code written for v1.x will not work.
fix
Update imports to use mastercard_merchant_identifier.rest and mastercard-api-common for ApiClient.
affects: <2.0.0
gotchaThe ApiClient class is not in this package; it's in mastercard-api-common. You must install and import from that separate package.
fix
pip install mastercard-api-common and import ApiClient from mastercard_api_common.
affects: >=2.0.0
deprecatedThe method 'get_merchant_identifiers' may return a dictionary, not a response object. Check the official docs for exact return type.
fix
Inspect response or rely on API reference.
affects: 2.0.0
gotchaEnvironment variables for authentication must be set explicitly; the SDK does not use .env files automatically.
fix
Set MASTERCARD_CONSUMER_KEY, MASTERCARD_KEY_ALIAS, MASTERCARD_SIGNING_KEY_PATH (or equivalently use PKCS12 keystore).
affects: all
gotchaThe Sandbox vs Production environment is controlled by a boolean parameter in ApiClient; make sure to set sandbox=False for production.
fix
Use ApiClient(..., sandbox=False) for production.
affects: >=2.0.0
Upgrade
Version history
2.0.0latest on PyPI · released May 14, 2019
Audit
Dependencies
mastercard-api-commonrequiredRequired for core API client and authentication
oauthlibrequiredUsed for OAuth 1.0a signing
Agent activity
22 hits · last 30 days
node
20
OpenAI (training)
1
Resources
mastercard-merchant-identifier — pip install mastercard-merchant-identifier · libregistry