-
Notifications
You must be signed in to change notification settings - Fork 0
/
FXDealQuoteBookAndInstantDeposit.py
61 lines (54 loc) · 1.42 KB
/
FXDealQuoteBookAndInstantDeposit.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
57
58
59
60
61
import zeep
import config
#
# The nain
#
def main():
wsdl = './WSDL/WinstantPayWebService.xml'
client = zeep.Client(wsdl=wsdl)
#
# First we get the customer Id
#
res = client.service.UserSettingsGetSingle(request = {
'ServiceCallerIdentity':{
'LoginId': config.userLogin,
'Password': config.userPassword,
'ServiceCallerId': config.callerId
}
})
customer_id = res.UserSettings.UserId
#
# Next we get a quote
#
res = client.service.FXDealQuoteCreate(request = {
'ServiceCallerIdentity':{
'LoginId': config.userLogin,
'Password': config.userPassword,
'ServiceCallerId': config.callerId
},
'CustomerId': customer_id,
'BuyCCY': "MMK",
'SellCCY': "THB",
'Amount': "1000.00",
'AmountCCY': "THB",
'DealType': "Spot",
'IsForCurrencyCalculator': False
})
quote_id = res.Quote.QuoteId
#
# Finally you can book the deal
#
res = client.service.FXDealQuoteBookAndInstantDeposit(request = {
'ServiceCallerIdentity':{
'LoginId': config.userLogin,
'Password': config.userPassword,
'ServiceCallerId': config.callerId
},
'QuoteId': quote_id
})
print res
#
# Invoke Main from here to solve accidential import
#
if __name__ == "__main__":
main()