-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupdatePayment.py
More file actions
61 lines (58 loc) · 1.59 KB
/
updatePayment.py
File metadata and controls
61 lines (58 loc) · 1.59 KB
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
51
52
53
54
55
56
57
58
59
60
61
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": "4003208",
"method": "8",
"currency": "SEK",
"language": "sv",
"country": "SE",
"orderid": "123456",
"bankid": "true",
"accepturl": "https://example.com/accept",
"cancelurl": "https://example.com/cancel",
"callbackurl": "https://example.com/callback",
},
"Customer": {
"pno": "550101-1018",
"Billing": {
"firstname": "Tess T",
"lastname": "Person",
"street": "Testvägen 1",
"zip": "12345",
"city": "Testinge",
"country": "SE",
"phone": "0700000000",
"email": "test@example.com",
}
},
"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="updatePayment", data=paymentPayload)
print(json.dumps(payment, indent=4))