class Command(BaseCommand):
help = 'Reads Receipts'
def add_arguments(self, parser):
parser.add_argument('storeId', type=str)
parser.add_argument('purchaseDate', type=str)
parser.add_argument('cardType', type=str)
parser.add_argument('total', type=str)
parser.add_argument('lastFourDigits', type=str)
def handle(self, *args, **options):
data = {
"storeId": options['storeId'],
"purchaseDate": options['purchaseDate'],
"cardType": options['cardType'],
"total": options['total'],
"lastFourDigits": options['lastFourDigits']
}
storeId = data['storeId']
headers = {
'sec-ch-ua': '"Chromium";v="98", " Not A;Brand";v="99", "Google Chrome";v="98"',
'accept': 'application/json',
'content-type': 'application/json',
'sec-ch-ua-mobile': '?0',
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36',
'sec-ch-ua-platform': '"Mac OS X"'
}
# Good documentation about requests response codes.
#print("Status Code", response.status_code)
#print(response.text)
#print("JSON Response ", response.json())
base_JSON = response.json()
#tester = base_JSON
#return json.dumps(base_JSON, indent=4)
self.stdout.write(type(base_JSON))