lundi 28 août 2017

Zapier - Python IF/ELIF not printing result, "output_missing: Please define output or return early."

I'm incredibly weak with Python, but I thought I could knock together a basic script to alert me when a new user adds a card, and compare their credentials against the account sign-up information (to check for spammers)

Here's what I have in Zapier:

if input_data['card_name'] == input_data['account_name'] and input_data['card_country'] == input_data['account_country'] and input_data['card_type'] != 'prepaid': print "Low Risk (valid credentials)"
elif input_data['card_name'] == input_data['account_name'] and input_data['card_country'] == input_data['account_country'] and input_data['card_type'] == 'prepaid': print "Medium Risk (prepaid card)"
elif input_data['card_name'] != input_data['account_name'] and input_data['card_country'] == input_data['account_country'] and input_data['card_type'] != 'prepaid': print "Medium Risk (name mismatch)"
elif input_data['card_name'] == input_data['account_name'] and input_data['card_country'] != input_data['account_country'] and input_data['card_type'] != 'prepaid': print "Medium Risk (country mismatch)"
elif input_data['card_name'] != input_data['account_name'] and input_data['card_country'] != input_data['account_country'] and input_data['card_type'] == 'prepaid': print "High Risk (consider investigating)"

It's a big CF of IF/ELIF, but for some reason it's not printing the output. I had it working when it was only two conditions per argument, but with three it seems to not want to print the output.

I'm getting this error now: "output_missing: Please define output or return early."

Am I making any dumb mistakes that's preventing this from printing properly? Help would be most appreciated!

Aucun commentaire:

Enregistrer un commentaire