Skip to content

Latest commit

 

History

History
111 lines (84 loc) · 3.35 KB

File metadata and controls

111 lines (84 loc) · 3.35 KB

Solidgate API

PyPI version

Python SDK provides API options for integrating Solidgate’s payment orchestrator into your Python applications.

Check our

Structure

SDK for Python contains Table of contents
  • solidgate/ – main library source code for development
    • __init__.py – initializes the SDK package for importing
    • api_client.py – main file for API integration and HTTP request handling
    • encryption.py – library for encryption-related operations
    • model.py – defines data structures for payment attributes and responses
  • setup.py – script for managing dependencies and library imports
Requirements
Installation
Usage
Errors

Requirements

  • Python: 3.7 or later
  • Packages: requests library
  • Solidgate account: Public and secret key (request via sales@solidgate.com)

Installation

To start using the Python SDK:

  1. Ensure you have your public and secret key.
  2. Install the SDK in your project using pip:
    pip install solidgate-card-sdk
  3. Import the classes into your project:
    from solidgate import ApiClient
    client = ApiClient(public_key='YourMerchantId', secret_key='YourPrivateKey')
    
  4. Use test credentials for integration testing. After successful testing, switch to production credentials.

Usage

Charge a payment

Create a class instance of the ApiClient class.

from solidgate import ApiClient

client = ApiClient(public_key, secret_key)
  • public_key - unique merchant identification
  • secret_key - secret code for request signature, it is provided at the moment of merchant registration

Resign form

response = client.form_resign({'order_id': '12345'})

Errors

Handle errors.

try:
    response = client.charge({...})
except Exception as e:
    print(e)

Looking for help? Contact us
Want to contribute? Submit a pull request