Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update stable_api.py: increased 'action' string validation steps #224

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions iqoptionapi/stable_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -928,12 +928,16 @@ def buy_digital_spot(self, active, amount, action, duration):
# And need to be on GMT time

#Type - P or C
if action == 'put':
action = 'P'
elif action == 'call':
action = 'C'
if isinstance(action,string):
if action.lower() == 'put':
action = 'P'
elif action.lower() == 'call':
action = 'C'
else:
logging.error('buy_digital_spot active error')
return -1
else:
logging.error('buy_digital_spot active error')
logging.error('buy_digital_spot active error: need action as text')
return -1
# doEURUSD201907191250PT5MPSPT
timestamp = int(self.api.timesync.server_timestamp)
Expand Down