Skip to content

Commit e232b26

Browse files
committed
Refactor of SMS, DirectBilling methods and implement base client
1 parent 4fd126a commit e232b26

File tree

21 files changed

+563
-340
lines changed

21 files changed

+563
-340
lines changed

.gitignore

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
11
venv/
22
.idea/
3-
*.iml
3+
.vscode
4+
*.iml
5+
dist
6+
build
7+
*__pycache__
8+
simpay_api.egg-info

examples/dcb.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
from simpay import Client, ClientException
2+
3+
apiKey = ""
4+
apiPassword = ""
5+
hashSign = ""
6+
client = Client(apiKey, apiPassword)
7+
8+
serviceID = "0d742940"
9+
smsService = client.DirectBilling.get_service(serviceID)
10+
smsServiceTransactions = client.DirectBilling.get_transactions(serviceID)
11+
12+
try:
13+
transaction = client.DirectBilling.generate_transaction(serviceID, hashSign, 1)
14+
# Redirect customer to url from variable transaction.redirectUrl
15+
# Optional validation BY specific number, client.SMS.verify_code(serviceID, 'CODE', NUMBER)
16+
verified = client.DirectBilling.verify_transaction("...POST FIELDS from http as dict", hashSign)
17+
except ClientException as error:
18+
print(error.message)

examples/sms.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
from simpay import Client, ClientException
2+
3+
apiKey = ""
4+
apiPassword = ""
5+
client = Client(apiKey, apiPassword)
6+
7+
serviceID = "0d742940"
8+
smsService = client.SMS.get_service(serviceID)
9+
smsServiceTransactions = client.SMS.get_transactions(serviceID)
10+
11+
try:
12+
transaction = client.SMS.verify_code(serviceID, 'CODE')
13+
# Optional validation by specific number, client.SMS.verify_code(serviceID, 'CODE', NUMBER)
14+
except ClientException as error:
15+
print(error.message)

payments/directbilling.py

Lines changed: 0 additions & 128 deletions
This file was deleted.

payments/sms.py

Lines changed: 0 additions & 175 deletions
This file was deleted.

requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
requests~=2.26.0
2-
setuptools~=57.0.0
2+
setuptools~=57.0.0
3+
pydantic~=1.10.7

setup.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,13 @@
44

55
setup(
66
name='simpay-api',
7-
version='2.1.1',
7+
version='3.0',
88
description='Python wrapper for Simpay API',
99
author='Rafał Więcek <[email protected]>',
10-
1110
url='https://github.com/SimPaypl/SimPay-API-Python',
12-
13-
packages=['payments'],
14-
install_required=[
15-
'requests'
16-
]
11+
python_requires=">3.0",
12+
packages=find_packages(exclude=["tests*", "examples*"]),
13+
test_suite="tests",
14+
include_package_data=True,
15+
install_requires=['requests'],
1716
)

simpay/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from .simpay import Client, ClientException

simpay/__version__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
VERSION = "3.0"

0 commit comments

Comments
 (0)