Metadata-Version: 2.4
Name: salispay-paymentgateway
Version: 0.0.6
Summary: A Python library for the Salispay payment gateway.
Author: Salispay
Author-email: support@salispay.com
Keywords: salispay,paymentgateway
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: keywords
Dynamic: license-file
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# Salispay Payment Gateway

Salispay Payment Gateway is a Python library that provides an easy-to-use interface for interacting with the Salispay payment gateway API. This library allows you to create orders, check order statuses, and manage transactions securely and efficiently.

## Features

- **Order Management**: Create and manage orders through Salispay.
- **Transaction Management**: Handle transactions with ease.
- **Secure Authentication**: Uses secure basic authentication for API requests.
- **System Information**: Attaches system and server information to each request for better tracking and security.

## Installation

You can install the package via pip. Run the following command:

```bash
pip install salispay-paymentgateway
```

## Usage

### Initializing the Gateway

To start using the Salispay Gateway, initialize the SalispayPaymentGateway class with your client ID and client secret:

```bash
from salispay_paymentgateway import SalispayPaymentGateway

gateway = salispayPaymentGateway('your-client-id', 'your-client-secret')
```

### Creating an Order

To create an order, use the create_order method of the OrderAPI class:

```bash
order_data = {
    'receiptId': '00000001',
    'amount': 100,
    'currency': 'INR',
    'description': 'Test Payment',
    'customerFields': {
        'name': 'Sample User',
        'email': 'xxx@yyy.xom',
        'phone': '1234567890'
    },
    'uiMode': 'checkout',
    'redirectType' : 'post' // or 'redirect'
}

try:
    order_response = gateway.order.create_order(order_data)
    print("Order Response:", order_response)
except Exception as e:
    print('Error:', e)
```

### Checking Order Status

To check the status of an existing order, use the check_status method:

```bash
order_id = 'order-id'

try:
    status_response = gateway.order.check_status(order_id)
    print("Order Status:", status_response)
except Exception as e:
    print('Error:', e)
```

## License

This project is licensed under the MIT License.
