-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwallet.py
executable file
·50 lines (42 loc) · 1.11 KB
/
wallet.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import os
import hashlib
import pprint
from zeep import Client
from dotenv import load_dotenv
# Load environment variables
load_dotenv()
# Parameters
id_ent_commerce = os.getenv('ID_ENT_COMMERCE')
cod_cardholder_commerce = os.getenv('COD_CARDHOLDER_COMMERCE')
name = os.getenv('NAME')
last_name = os.getenv('LAST_NAME')
mail = os.getenv('MAIL')
reserved1 = os.getenv('RESERVED1')
reserved2 = os.getenv('RESERVED2')
reserved3 = os.getenv('RESERVED3')
secret_key = os.getenv('SECRET_KEY')
# Compute verification
data = '{}{}{}{}'.format(id_ent_commerce,
cod_cardholder_commerce,
mail,
secret_key)
m = hashlib.sha512()
m.update(data.encode())
verification = m.hexdigest()
# Wallet WSDL
params = (
id_ent_commerce,
cod_cardholder_commerce,
mail,
name,
last_name,
reserved1,
reserved2,
reserved3,
verification
)
wsdl = 'https://integracion.alignetsac.com/WALLETWS/services/WalletCommerce?wsdl'
client = Client(wsdl)
result = client.service.RegisterCardHolder(*params)
pp = pprint.PrettyPrinter(indent=4)
pp.pprint(result)