def test_issue_sila_vaccount_200(self): payload = { "virtual_account_name": "test_v_acc", "user_handle": user_handle } response = User.openVirtualAccount(app, payload, eth_private_key) self.assertTrue(response["success"]) v_id = response.get("virtual_account").get("virtual_account_id") payload = { "user_handle": user_handle } response = User.getPaymentMethods(app, payload, eth_private_key) self.assertTrue(response["success"]) for item in response.get("payment_methods"): if item["payment_method_type"] == "card": card_id = item.get("card_id") descriptor = "test descriptor" payload = { "message": "issue_msg", "user_handle": user_handle, "amount": 200, "source_id": card_id, "descriptor": descriptor, "business_uuid": business_uuid, "processing_type": ProcessingTypes.STANDARD_ACH, "destination_id": v_id, } response = Transaction.issue_sila(app, payload, eth_private_key) self.assertEqual(response.get("success"), True) self.assertEqual(response["status"], "SUCCESS") self.assertIsNotNone(response["transaction_id"])
def test_001_reverse_transaction_200(self): payload = { "user_handle": user_handle, "amount": 200, "card_name": "visa" } response = Transaction.issue_sila(app, payload, eth_private_key) self.assertEqual(response.get("success"), True) payload = { "user_handle": user_handle, 'search_filters': { 'bank_account_name': 'visa' } } response1 = User.get_transactions(app, payload, eth_private_key) while response1['transactions'][0]['status'] == "pending": time.sleep(50) response1 = User.get_transactions(app, payload, eth_private_key) payload = { "user_handle": user_handle, "transaction_id": response["transaction_id"] } response2 = Transaction.reverseTransaction(app, payload, eth_private_key) self.assertTrue(response2.get('success'))
def test_issue_sila_200_with_card_name(self): payload = { "user_handle": user_handle, "amount": 200, "card_name": "visa" } response = Transaction.issue_sila(app, payload, eth_private_key) self.assertTrue(response["success"])
def test_issue_sila_400(self): payload = { "user_handle": user_handle, "amount": "-1" } response = Transaction.issue_sila(app, payload, eth_private_key) self.assertEqual(response["status"], "FAILURE")
def test_issue_sila_400_card_name_account(self): payload = { "user_handle": user_handle, "amount": 200, "account_name": "test_account", "card_name": "visa" } response = Transaction.issue_sila(app, payload, eth_private_key) self.assertFalse(response["success"])
def test_transfer_sila_v2v_200(self): payload = { "virtual_account_name": "source_v_acc", "user_handle": user_handle } response = User.openVirtualAccount(app, payload, eth_private_key) self.assertTrue(response["success"]) source_v_id = response.get("virtual_account").get("virtual_account_id") payload = { "virtual_account_name": "destination_v_acc", "user_handle": user_handle } response = User.openVirtualAccount(app, payload, eth_private_key) self.assertTrue(response["success"]) destination_v_id = response.get("virtual_account").get( "virtual_account_id") descriptor = "test descriptor" payload = { "message": "issue_msg", "user_handle": user_handle, "amount": 200, "account_name": "default_plaid", "descriptor": descriptor, "business_uuid": business_uuid, "processing_type": ProcessingTypes.STANDARD_ACH, "destination_id": source_v_id, } response = Transaction.issue_sila(app, payload, eth_private_key) poll(self, response["transaction_id"], "success", app, user_handle, eth_private_key) payload = { "message": "transfer_msg", "user_handle": user_handle, "source_id": source_v_id, "destination_id": destination_v_id, "destination": user_handle, "amount": 100, "descriptor": "test descriptor", "business_uuid": business_uuid } response = Transaction.transferSila(app, payload, eth_private_key) poll(self, response["transaction_id"], "success", app, user_handle, eth_private_key) self.assertEqual(response["status"], "SUCCESS") self.assertEqual(response["descriptor"], "test descriptor") self.assertIsNotNone(response["transaction_id"])
def test_issue_sila_200(self): payload = { "user_handle": user_handle, "amount": 200, "account_name": "default_plaid" } response = Transaction.issue_sila(app, payload, eth_private_key) self.assertEqual(response.get("success"), True) poll(self, response["transaction_id"], "success", app, user_handle, eth_private_key) self.assertEqual(response["status"], "SUCCESS") self.assertIsNotNone(response["transaction_id"])
def test_issue_sila_200_instant_ach(self): payload = { "user_handle": instant_ach_handle, "amount": 200, "account_name": "default_plaid", "business_uuid": business_uuid, "processing_type": ProcessingTypes.INSTANT_ACH } response = Transaction.issue_sila(app, payload, eth_private_key_4) self.assertEqual(response.get("success"), True) poll(self, response["transaction_id"], "pending_confirmation", app, instant_ach_handle, eth_private_key_4) self.assertEqual(response["status"], "SUCCESS") self.assertIsNotNone(response["transaction_id"])
def test_transfer_sila_v2block_chain_200(self): payload = { "virtual_account_name": "source_v_acc", "user_handle": user_handle } response = User.openVirtualAccount(app, payload, eth_private_key) self.assertTrue(response["success"]) source_v_id = response.get("virtual_account").get("virtual_account_id") # payload = { # "virtual_account_name": "destination_v_acc", # "user_handle": user_handle # } # response = User.openVirtualAccount(app, payload, eth_private_key) # self.assertTrue(response["success"]) # destination_v_id = response.get( # "virtual_account").get("virtual_account_id") payload = {"user_handle": user_handle} response = User.getPaymentMethods(app, payload, eth_private_key) self.assertTrue(response["success"]) for item in response.get("payment_methods"): if item["payment_method_type"] == "blockchain_address": blockchain_address = item.get("blockchain_address") descriptor = "test descriptor" payload = { "message": "issue_msg", "user_handle": user_handle, "amount": 200, "account_name": "default_plaid", "descriptor": descriptor, "business_uuid": business_uuid, "processing_type": ProcessingTypes.STANDARD_ACH, "destination_id": source_v_id, } response = Transaction.issue_sila(app, payload, eth_private_key) poll(self, response["transaction_id"], "success", app, user_handle, eth_private_key) payload = { "message": "transfer_msg", "user_handle": user_handle, "source_id": source_v_id, "destination_id": blockchain_address, "destination": user_handle, "amount": 100, "descriptor": "test descriptor", "business_uuid": business_uuid } response = Transaction.transferSila(app, payload, eth_private_key) poll(self, response["transaction_id"], "success", app, user_handle, eth_private_key) self.assertEqual(response["status"], "SUCCESS") self.assertEqual(response["descriptor"], "test descriptor") self.assertIsNotNone(response["transaction_id"])