diff --git a/README.md b/README.md index b8619a0..bff0a16 100644 --- a/README.md +++ b/README.md @@ -1,31 +1,111 @@ +# Solidgate API + [![PyPI version](https://badge.fury.io/py/solidgate-sdk.svg)](https://badge.fury.io/py/solidgate-sdk) -# SolidGate API -This library provides basic API options of SolidGate payment gateway. +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 + +## Structure + + + + + + + + + + + + + + +
SDK for Python containsTable 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 -- Packages: requests -- SolidGate account. If you don’t have this you can request it by contacting sales@solidgate.com +* **Python**: 3.7 or later +* **Packages**: `requests` library +* **Solidgate account**: Public and secret key (request via sales@solidgate.com) + +
## Installation -Use pip command: ```pip3 install solidgate-card-sdk``` +To start using the Python SDK: + +1. Ensure you have your public and secret key. +2. Install the SDK in your project using pip: + ```bash + 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 -Create a class instance of the 'ApiClient' class. +### 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's provided at the moment of merchant registration. -## Documentation -* https://docs.solidgate.com +- `public_key` - unique merchant identification +- `secret_key` - secret code for request signature, it is provided at the moment of merchant registration + +### Resign form + +```python +response = client.form_resign({'order_id': '12345'}) +``` + +
+ +## Errors + +Handle errors. + +```python +try: + response = client.charge({...}) +except Exception as e: + print(e) +``` + +--- -## Support -If you have any problems, questions or suggestions send your inquiry to info@solidgate.com. +Looking for help? Contact us
+Want to contribute? Submit a pull request \ No newline at end of file diff --git a/setup.py b/setup.py index 9ae2c6f..cf68d22 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setuptools.setup( name="solidgate-sdk", - version="0.3.1", + version="0.3.2", author="SolidGate", author_email="info@solidgate.com", description="Python API SDK for SolidGate payment gateway", diff --git a/solidgate/api_client.py b/solidgate/api_client.py index dba6e4a..4b752a1 100644 --- a/solidgate/api_client.py +++ b/solidgate/api_client.py @@ -76,7 +76,7 @@ def form_update(self, attributes: dict) -> FormUpdateDTO: def form_resign(self, attributes: dict) -> FormInitDTO: resign_intent = AESCipher(self.__private_key).encrypt(self.__convert_request_attributes_to_str(attributes)) - signature = self.__generate_signature(payment_intent) + signature = self.__generate_signature(resign_intent) form_resign_dto = FormResignDTO(resign_intent=resign_intent, publicKey=self.__merchant_id, signature=signature) return form_resign_dto