salispay-paymentgateway 0.0.5__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- salispay_paymentgateway-0.0.5/LICENSE +21 -0
- salispay_paymentgateway-0.0.5/PKG-INFO +99 -0
- salispay_paymentgateway-0.0.5/README.md +74 -0
- salispay_paymentgateway-0.0.5/salispay_paymentgateway/salispay_paymentgateway.egg-info/PKG-INFO +99 -0
- salispay_paymentgateway-0.0.5/salispay_paymentgateway/salispay_paymentgateway.egg-info/SOURCES.txt +11 -0
- salispay_paymentgateway-0.0.5/salispay_paymentgateway/salispay_paymentgateway.egg-info/dependency_links.txt +1 -0
- salispay_paymentgateway-0.0.5/salispay_paymentgateway/salispay_paymentgateway.egg-info/requires.txt +1 -0
- salispay_paymentgateway-0.0.5/salispay_paymentgateway/salispay_paymentgateway.egg-info/top_level.txt +1 -0
- salispay_paymentgateway-0.0.5/setup.cfg +4 -0
- salispay_paymentgateway-0.0.5/setup.py +26 -0
- salispay_paymentgateway-0.0.5/tests/test_gateway.py +18 -0
- salispay_paymentgateway-0.0.5/tests/test_order.py +33 -0
- salispay_paymentgateway-0.0.5/tests/test_transaction.py +16 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Credopay (https://www.credopay.com)
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: salispay-paymentgateway
|
|
3
|
+
Version: 0.0.5
|
|
4
|
+
Summary: A Python library for the Salispay payment gateway.
|
|
5
|
+
Author: Salispay
|
|
6
|
+
Author-email: support@salispay.com
|
|
7
|
+
Keywords: salispay,paymentgateway
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
10
|
+
Classifier: Operating System :: OS Independent
|
|
11
|
+
Requires-Python: >=3.6
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
License-File: LICENSE
|
|
14
|
+
Requires-Dist: requests
|
|
15
|
+
Dynamic: author
|
|
16
|
+
Dynamic: author-email
|
|
17
|
+
Dynamic: classifier
|
|
18
|
+
Dynamic: description
|
|
19
|
+
Dynamic: description-content-type
|
|
20
|
+
Dynamic: keywords
|
|
21
|
+
Dynamic: license-file
|
|
22
|
+
Dynamic: requires-dist
|
|
23
|
+
Dynamic: requires-python
|
|
24
|
+
Dynamic: summary
|
|
25
|
+
|
|
26
|
+
# CredoPay Payment Gateway
|
|
27
|
+
|
|
28
|
+
CredoPay Payment Gateway is a Python library that provides an easy-to-use interface for interacting with the CredoPay payment gateway API. This library allows you to create orders, check order statuses, and manage transactions securely and efficiently.
|
|
29
|
+
|
|
30
|
+
## Features
|
|
31
|
+
|
|
32
|
+
- **Order Management**: Create and manage orders through CredoPay.
|
|
33
|
+
- **Transaction Management**: Handle transactions with ease.
|
|
34
|
+
- **Secure Authentication**: Uses secure basic authentication for API requests.
|
|
35
|
+
- **System Information**: Attaches system and server information to each request for better tracking and security.
|
|
36
|
+
|
|
37
|
+
## Installation
|
|
38
|
+
|
|
39
|
+
You can install the package via pip. Run the following command:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
pip install credopay-paymentgateway
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Usage
|
|
46
|
+
|
|
47
|
+
### Initializing the Gateway
|
|
48
|
+
|
|
49
|
+
To start using the CredoPay Gateway, initialize the CredoPayPaymentGateway class with your client ID and client secret:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
from credopay_paymentgateway import CredoPayPaymentGateway
|
|
53
|
+
|
|
54
|
+
gateway = CredoPayPaymentGateway('your-client-id', 'your-client-secret')
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### Creating an Order
|
|
58
|
+
|
|
59
|
+
To create an order, use the create_order method of the OrderAPI class:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
order_data = {
|
|
63
|
+
'receiptId': '00000001',
|
|
64
|
+
'amount': 100,
|
|
65
|
+
'currency': 'INR',
|
|
66
|
+
'description': 'Test Payment',
|
|
67
|
+
'customerFields': {
|
|
68
|
+
'name': 'Sample User',
|
|
69
|
+
'email': 'xxx@yyy.xom',
|
|
70
|
+
'phone': '1234567890'
|
|
71
|
+
},
|
|
72
|
+
'uiMode': 'checkout',
|
|
73
|
+
'redirectType' : 'post' // or 'redirect'
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
try:
|
|
77
|
+
order_response = gateway.order.create_order(order_data)
|
|
78
|
+
print("Order Response:", order_response)
|
|
79
|
+
except Exception as e:
|
|
80
|
+
print('Error:', e)
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### Checking Order Status
|
|
84
|
+
|
|
85
|
+
To check the status of an existing order, use the check_status method:
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
order_id = 'order-id'
|
|
89
|
+
|
|
90
|
+
try:
|
|
91
|
+
status_response = gateway.order.check_status(order_id)
|
|
92
|
+
print("Order Status:", status_response)
|
|
93
|
+
except Exception as e:
|
|
94
|
+
print('Error:', e)
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## License
|
|
98
|
+
|
|
99
|
+
This project is licensed under the MIT License.
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# CredoPay Payment Gateway
|
|
2
|
+
|
|
3
|
+
CredoPay Payment Gateway is a Python library that provides an easy-to-use interface for interacting with the CredoPay payment gateway API. This library allows you to create orders, check order statuses, and manage transactions securely and efficiently.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **Order Management**: Create and manage orders through CredoPay.
|
|
8
|
+
- **Transaction Management**: Handle transactions with ease.
|
|
9
|
+
- **Secure Authentication**: Uses secure basic authentication for API requests.
|
|
10
|
+
- **System Information**: Attaches system and server information to each request for better tracking and security.
|
|
11
|
+
|
|
12
|
+
## Installation
|
|
13
|
+
|
|
14
|
+
You can install the package via pip. Run the following command:
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
pip install credopay-paymentgateway
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Usage
|
|
21
|
+
|
|
22
|
+
### Initializing the Gateway
|
|
23
|
+
|
|
24
|
+
To start using the CredoPay Gateway, initialize the CredoPayPaymentGateway class with your client ID and client secret:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
from credopay_paymentgateway import CredoPayPaymentGateway
|
|
28
|
+
|
|
29
|
+
gateway = CredoPayPaymentGateway('your-client-id', 'your-client-secret')
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### Creating an Order
|
|
33
|
+
|
|
34
|
+
To create an order, use the create_order method of the OrderAPI class:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
order_data = {
|
|
38
|
+
'receiptId': '00000001',
|
|
39
|
+
'amount': 100,
|
|
40
|
+
'currency': 'INR',
|
|
41
|
+
'description': 'Test Payment',
|
|
42
|
+
'customerFields': {
|
|
43
|
+
'name': 'Sample User',
|
|
44
|
+
'email': 'xxx@yyy.xom',
|
|
45
|
+
'phone': '1234567890'
|
|
46
|
+
},
|
|
47
|
+
'uiMode': 'checkout',
|
|
48
|
+
'redirectType' : 'post' // or 'redirect'
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
try:
|
|
52
|
+
order_response = gateway.order.create_order(order_data)
|
|
53
|
+
print("Order Response:", order_response)
|
|
54
|
+
except Exception as e:
|
|
55
|
+
print('Error:', e)
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### Checking Order Status
|
|
59
|
+
|
|
60
|
+
To check the status of an existing order, use the check_status method:
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
order_id = 'order-id'
|
|
64
|
+
|
|
65
|
+
try:
|
|
66
|
+
status_response = gateway.order.check_status(order_id)
|
|
67
|
+
print("Order Status:", status_response)
|
|
68
|
+
except Exception as e:
|
|
69
|
+
print('Error:', e)
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## License
|
|
73
|
+
|
|
74
|
+
This project is licensed under the MIT License.
|
salispay_paymentgateway-0.0.5/salispay_paymentgateway/salispay_paymentgateway.egg-info/PKG-INFO
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: salispay-paymentgateway
|
|
3
|
+
Version: 0.0.5
|
|
4
|
+
Summary: A Python library for the Salispay payment gateway.
|
|
5
|
+
Author: Salispay
|
|
6
|
+
Author-email: support@salispay.com
|
|
7
|
+
Keywords: salispay,paymentgateway
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
10
|
+
Classifier: Operating System :: OS Independent
|
|
11
|
+
Requires-Python: >=3.6
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
License-File: LICENSE
|
|
14
|
+
Requires-Dist: requests
|
|
15
|
+
Dynamic: author
|
|
16
|
+
Dynamic: author-email
|
|
17
|
+
Dynamic: classifier
|
|
18
|
+
Dynamic: description
|
|
19
|
+
Dynamic: description-content-type
|
|
20
|
+
Dynamic: keywords
|
|
21
|
+
Dynamic: license-file
|
|
22
|
+
Dynamic: requires-dist
|
|
23
|
+
Dynamic: requires-python
|
|
24
|
+
Dynamic: summary
|
|
25
|
+
|
|
26
|
+
# CredoPay Payment Gateway
|
|
27
|
+
|
|
28
|
+
CredoPay Payment Gateway is a Python library that provides an easy-to-use interface for interacting with the CredoPay payment gateway API. This library allows you to create orders, check order statuses, and manage transactions securely and efficiently.
|
|
29
|
+
|
|
30
|
+
## Features
|
|
31
|
+
|
|
32
|
+
- **Order Management**: Create and manage orders through CredoPay.
|
|
33
|
+
- **Transaction Management**: Handle transactions with ease.
|
|
34
|
+
- **Secure Authentication**: Uses secure basic authentication for API requests.
|
|
35
|
+
- **System Information**: Attaches system and server information to each request for better tracking and security.
|
|
36
|
+
|
|
37
|
+
## Installation
|
|
38
|
+
|
|
39
|
+
You can install the package via pip. Run the following command:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
pip install credopay-paymentgateway
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Usage
|
|
46
|
+
|
|
47
|
+
### Initializing the Gateway
|
|
48
|
+
|
|
49
|
+
To start using the CredoPay Gateway, initialize the CredoPayPaymentGateway class with your client ID and client secret:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
from credopay_paymentgateway import CredoPayPaymentGateway
|
|
53
|
+
|
|
54
|
+
gateway = CredoPayPaymentGateway('your-client-id', 'your-client-secret')
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### Creating an Order
|
|
58
|
+
|
|
59
|
+
To create an order, use the create_order method of the OrderAPI class:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
order_data = {
|
|
63
|
+
'receiptId': '00000001',
|
|
64
|
+
'amount': 100,
|
|
65
|
+
'currency': 'INR',
|
|
66
|
+
'description': 'Test Payment',
|
|
67
|
+
'customerFields': {
|
|
68
|
+
'name': 'Sample User',
|
|
69
|
+
'email': 'xxx@yyy.xom',
|
|
70
|
+
'phone': '1234567890'
|
|
71
|
+
},
|
|
72
|
+
'uiMode': 'checkout',
|
|
73
|
+
'redirectType' : 'post' // or 'redirect'
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
try:
|
|
77
|
+
order_response = gateway.order.create_order(order_data)
|
|
78
|
+
print("Order Response:", order_response)
|
|
79
|
+
except Exception as e:
|
|
80
|
+
print('Error:', e)
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### Checking Order Status
|
|
84
|
+
|
|
85
|
+
To check the status of an existing order, use the check_status method:
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
order_id = 'order-id'
|
|
89
|
+
|
|
90
|
+
try:
|
|
91
|
+
status_response = gateway.order.check_status(order_id)
|
|
92
|
+
print("Order Status:", status_response)
|
|
93
|
+
except Exception as e:
|
|
94
|
+
print('Error:', e)
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## License
|
|
98
|
+
|
|
99
|
+
This project is licensed under the MIT License.
|
salispay_paymentgateway-0.0.5/salispay_paymentgateway/salispay_paymentgateway.egg-info/SOURCES.txt
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
LICENSE
|
|
2
|
+
README.md
|
|
3
|
+
setup.py
|
|
4
|
+
salispay_paymentgateway/salispay_paymentgateway.egg-info/PKG-INFO
|
|
5
|
+
salispay_paymentgateway/salispay_paymentgateway.egg-info/SOURCES.txt
|
|
6
|
+
salispay_paymentgateway/salispay_paymentgateway.egg-info/dependency_links.txt
|
|
7
|
+
salispay_paymentgateway/salispay_paymentgateway.egg-info/requires.txt
|
|
8
|
+
salispay_paymentgateway/salispay_paymentgateway.egg-info/top_level.txt
|
|
9
|
+
tests/test_gateway.py
|
|
10
|
+
tests/test_order.py
|
|
11
|
+
tests/test_transaction.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
salispay_paymentgateway-0.0.5/salispay_paymentgateway/salispay_paymentgateway.egg-info/requires.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
requests
|
salispay_paymentgateway-0.0.5/salispay_paymentgateway/salispay_paymentgateway.egg-info/top_level.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
from setuptools import setup, find_packages
|
|
2
|
+
|
|
3
|
+
with open("README.md", "r") as fh:
|
|
4
|
+
long_description = fh.read()
|
|
5
|
+
|
|
6
|
+
setup(
|
|
7
|
+
name="salispay-paymentgateway",
|
|
8
|
+
version="0.0.5",
|
|
9
|
+
author="Salispay",
|
|
10
|
+
author_email="support@salispay.com",
|
|
11
|
+
description="A Python library for the Salispay payment gateway.",
|
|
12
|
+
long_description=long_description,
|
|
13
|
+
long_description_content_type="text/markdown",
|
|
14
|
+
packages=find_packages(include=['compiled_salispay_paymentgateway', 'compiled_salispay_paymentgateway.*']),
|
|
15
|
+
package_dir={'': 'salispay_paymentgateway'},
|
|
16
|
+
classifiers=[
|
|
17
|
+
"Programming Language :: Python :: 3",
|
|
18
|
+
"License :: OSI Approved :: MIT License",
|
|
19
|
+
"Operating System :: OS Independent",
|
|
20
|
+
],
|
|
21
|
+
keywords=["salispay", "paymentgateway"],
|
|
22
|
+
python_requires='>=3.6',
|
|
23
|
+
install_requires=[
|
|
24
|
+
"requests",
|
|
25
|
+
],
|
|
26
|
+
)
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import unittest
|
|
2
|
+
from credopay_paymentgateway.gateway import CredoPayPaymentGateway
|
|
3
|
+
from ompay_paymentgateway import OmpayPaymentGateway
|
|
4
|
+
|
|
5
|
+
class TestCredoPayPaymentGateway(unittest.TestCase):
|
|
6
|
+
def setUp(self):
|
|
7
|
+
self.gateway = CredoPayPaymentGateway('test_client_id', 'test_client_secret')
|
|
8
|
+
|
|
9
|
+
def test_get_basic_auth_header(self):
|
|
10
|
+
header = self.gateway._get_basic_auth_header()
|
|
11
|
+
self.assertTrue(header.startswith("Basic "))
|
|
12
|
+
|
|
13
|
+
def test_handle_request(self):
|
|
14
|
+
response = self.gateway._handle_request(self.gateway.session.get, 'https://jsonplaceholder.typicode.com/todos/1')
|
|
15
|
+
self.assertIn('title', response)
|
|
16
|
+
|
|
17
|
+
if __name__ == '__main__':
|
|
18
|
+
unittest.main()
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import unittest
|
|
2
|
+
from credopay_paymentgateway.gateway import CredoPayPaymentGateway
|
|
3
|
+
from ompay_paymentgateway import OmpayPaymentGateway
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class TestOrderAPI(unittest.TestCase):
|
|
7
|
+
def setUp(self):
|
|
8
|
+
self.gateway = CredoPayPaymentGateway('test_client_id', 'test_client_secret')
|
|
9
|
+
self.order_api = self.gateway.order
|
|
10
|
+
|
|
11
|
+
def test_create_order(self):
|
|
12
|
+
order_data = {
|
|
13
|
+
'receiptId': 'RE_DVGSD24535SFGER01',
|
|
14
|
+
'amount': 1,
|
|
15
|
+
'currency': 'INR',
|
|
16
|
+
'description': 'Test Payment',
|
|
17
|
+
'customerFields': {
|
|
18
|
+
'name': 'Madhan R',
|
|
19
|
+
'email': 'madhan.k@credopay.in',
|
|
20
|
+
'phone': '1234567890'
|
|
21
|
+
},
|
|
22
|
+
'uiMode': 'checkout',
|
|
23
|
+
'redirectType': 'redirect'
|
|
24
|
+
}
|
|
25
|
+
response = self.order_api.create_order(order_data)
|
|
26
|
+
self.assertIn('resCode', response)
|
|
27
|
+
|
|
28
|
+
def test_check_status(self):
|
|
29
|
+
response = self.order_api.check_status('invalid_order_id')
|
|
30
|
+
#self.assertIn('resCode', response)
|
|
31
|
+
|
|
32
|
+
if __name__ == '__main__':
|
|
33
|
+
unittest.main()
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import unittest
|
|
2
|
+
from credopay_paymentgateway.gateway import CredoPayPaymentGateway
|
|
3
|
+
from ompay_paymentgateway import OmpayPaymentGateway
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class TestTransactionAPI(unittest.TestCase):
|
|
7
|
+
def setUp(self):
|
|
8
|
+
self.gateway = CredoPayPaymentGateway('test_client_id', 'test_client_secret')
|
|
9
|
+
self.transaction_api = self.gateway.transaction
|
|
10
|
+
|
|
11
|
+
def test_transaction_api_initialization(self):
|
|
12
|
+
self.assertIsNotNone(self.transaction_api)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
if __name__ == '__main__':
|
|
16
|
+
unittest.main()
|