-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathInstantPaymentGetSingle.py
56 lines (50 loc) · 1.56 KB
/
InstantPaymentGetSingle.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
51
52
53
54
55
56
import zeep
import config
#
# The nain
#
def main():
wsdl = './WSDL/WinstantPayWebService.xml'
client = zeep.Client(wsdl=wsdl)
res = client.service.InstantPaymentCreate(request = {
'ServiceCallerIdentity':{
'LoginId': config.userLogin,
'Password': config.userPassword,
'ServiceCallerId': config.callerId
},
'FromCustomer': 'RALF',
'ToCustomer': 'Argie1970',
'Amount': 10.000,
'CurrencyCode': 'THB',
'ValueDate': '',
'ReasonForPayment':'',
'ExternalReference': '',
'Memo':''
})
payment_id = res.PaymentInformation.PaymentId
print("Payment id is %s\n" % payment_id)
res = client.service.InstantPaymentPost(request = {
'ServiceCallerIdentity':{
'LoginId': config.userLogin,
'Password': config.userPassword,
'ServiceCallerId': config.callerId
},
'InstantPaymentId': payment_id
})
res = client.service.InstantPaymentGetSingle(request = {
'ServiceCallerIdentity':{
'LoginId': config.userLogin,
'Password': config.userPassword,
'ServiceCallerId': config.callerId
},
'InstantPaymentId': payment_id
# Please note that we are using the same payment id, we just payed. IRL
# you would most likely use these endpoint to look into payments that happened a bit
# longer ago
})
print res
#
# Invoke Main from here to solve accidential import
#
if __name__ == "__main__":
main()