Esempio n. 1
0
    def test_check_handle_401(self):
        payload = {
            "user_handle": check_handle_status_401
        }

        response = User.checkHandle(app, payload)
        self.log.info(response)
        self.assertEqual(response["status"], "FAILURE")
Esempio n. 2
0
def requestKyc():
    '''SECURITY ALERT
    Never transmit private keys over the network in the request body
    You see a private key in request body here as this is intended for testing linkaccount and other endpoints locally
    Refer to documentation for how to manage your private keys and how it is used by our sdks locally to sign a transaction 
    '''
    data = request.json
    result = json.dumps(User.requestKyc(app1, data, data["private_key"]))
    return result
Esempio n. 3
0
    def test_check_handle_200(self):
        payload = {
            "user_handle": user_handle
        }

        response = User.checkHandle(app, payload)
        self.log.info(response)
        self.log.info(response.status_code)
        self.assertEqual(response["status"], "SUCCESS")
Esempio n. 4
0
 def post(self):
   parser = reqparse.RequestParser()
   parser.add_argument("handle", required=True)
   params = parser.parse_args()
   payload = {
     "user_handle": params["handle"]
   }
   response = User.checkHandle(silaApp, payload)
   if response["status_code"] == 200:
       return response["message"], 200
   else:
       return response["message"], 400
Esempio n. 5
0
 def post(self):
   parser = reqparse.RequestParser()
   parser.add_argument("user_handle", required=True)
   parser.add_argument("user_private_key", required=True)
   params = parser.parse_args()
   payload = {
     "user_handle": params["user_handle"]
   }
   response = User.requestKyc(silaApp, payload, params["user_private_key"], use_kyc_level=False)
   if response["status_code"] == 200:
       return response["message"], 200
   else:
       return response["message"], 400
Esempio n. 6
0
 def post(self):
   parser = reqparse.RequestParser()
   parser.add_argument("country", required=True)
   parser.add_argument("user_handle", required=True)
   parser.add_argument("first_name", required=True)
   parser.add_argument("last_name", required=True)
   parser.add_argument("entity_name", required=True)
   parser.add_argument("identity_value", required=True)
   parser.add_argument("phone", type=int, required=True)
   parser.add_argument("email", required=True)
   parser.add_argument("street_address_1", required=True)
   parser.add_argument("city", required=True)
   parser.add_argument("state", required=True)
   parser.add_argument("postal_code", type=int, required=True)
   parser.add_argument("crypto_address", required=True)
   parser.add_argument("birthdate", required=True)
   payload = parser.parse_args()
   payload["phone"] = int(payload["phone"])
   payload["postal_code"] = int(payload["postal_code"])
   response = User.register(silaApp, payload)
   if response["status_code"] == 200:
       return response["message"], 200
   else:
       return response["message"], 400
Esempio n. 7
0
    def test_register_200(self):
        payload = {
            "country": "US",
            "user_handle": user_handle,
            "first_name": name,
            "last_name": name,
            "entity_name": 'Example User',
            "identity_value": "123452222",
            "phone": 1234567890,
            "email": "*****@*****.**",
            "street_address_1": '123 Main Street',
            "city": 'New City',
            "state": 'OR',
            "postal_code": 97204,
            "crypto_address": eth_address,
            "crypto_alias": "python_wallet_1",
            "birthdate": "1990-05-19"
        }

        response = User.register(app, payload)
        self.assertEqual(response["status"], "SUCCESS")
        utility.insertData(inserthandle=user_handle,
                           insertethkey=eth_private_key)
        self.log.info(response)
Esempio n. 8
0
def register():
    # read json + reply
    data = request.json
    result = json.dumps(User.register(app1, data))
    return result
Esempio n. 9
0
def checkHandle():
    data = request.json
    result = json.dumps(User.checkHandle(app1, data))
    return result