-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpartCreditPayment.py
More file actions
40 lines (37 loc) · 971 Bytes
/
partCreditPayment.py
File metadata and controls
40 lines (37 loc) · 971 Bytes
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
import os
import os.path
import sys
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir + os.path.sep + os.path.pardir)))
from dotenv import load_dotenv
import json
load_dotenv(os.path.pardir + os.sep + ".env")
eid = os.getenv("EID")
secret = os.getenv("SECRET")
from PaymentAPI import PaymentAPI
# Create a PaymentAPI object
api = PaymentAPI(eid, secret)
paymentPayload = {
"PaymentData": {
"number": "12345",
"partcredit": "true",
},
"Articles": [
{
"artnr": "1",
"title": "Test",
"aprice": "10000",
"taxrate": "25",
"quantity": "1",
"withouttax": "10000",
}
],
"Cart": {
"Total": {
"withouttax": "10000",
"tax": "2500",
"withtax": "12500",
},
},
}
payment = api.call(function="creditPayment", data=paymentPayload)
print(json.dumps(payment, indent=4))