Python SDK provides API options for integrating Solidgate’s payment orchestrator into your Python applications.
Check our
- Payment guide to understand business value better
- API Reference to find more examples of usage
SDK for Python contains | Table of contents |
---|---|
|
Requirements Installation Usage Errors |
- Python: 3.7 or later
- Packages:
requests
library - Solidgate account: Public and secret key (request via [email protected])
To start using the Python SDK:
- Ensure you have your public and secret key.
- Install the SDK in your project using pip:
pip install solidgate-card-sdk
- Import the classes into your project:
from solidgate import ApiClient client = ApiClient(public_key='YourMerchantId', secret_key='YourPrivateKey')
- Use test credentials for integration testing. After successful testing, switch to production credentials.
Create a class instance of the ApiClient
class.
from solidgate import ApiClient
client = ApiClient(public_key, secret_key)
public_key
- unique merchant identificationsecret_key
- secret code for request signature, it is provided at the moment of merchant registration
response = client.form_resign({'order_id': '12345'})
Handle errors.
try:
response = client.charge({...})
except Exception as e:
print(e)