Example #1
0
def step_impl(context):
  global pairing_code
  time.sleep(1)
  client = Client(api_uri=ROOT_ADDRESS, insecure=True, pem=PEM)
  try:
    pairing_code = client.create_token("merchant")
  except Exception as error:
    if error.args[0] == "500: Unable to create token because of too many requests.":
      time.sleep(60)
      pairing_code = client.create_token("merchant")
Example #2
0
def step_impl(context):
    global pairing_code
    time.sleep(1)
    client = Client(api_uri=ROOT_ADDRESS, insecure=True, pem=PEM)
    try:
        pairing_code = client.create_token("merchant")
    except Exception as error:
        if error.args[
                0] == "500: Unable to create token because of too many requests.":
            time.sleep(60)
            pairing_code = client.create_token("merchant")