예제 #1
0
    def test_redeem_sila_400_both_card_account(self):
        payload = {
            "user_handle": user_handle,
            "amount": 50,
            "account_name": "test_account",
            "card_name": "visa"
        }

        response = Transaction.redeemSila(app, payload, eth_private_key)

        self.assertFalse(response["success"])
예제 #2
0
    def test_redeem_sila_card_200(self):
        payload = {
            "user_handle": user_handle,
            "amount": 50,
            "card_name": "visa",
            "processing_type": ProcessingTypes.CARD
        }
        response = Transaction.redeemSila(app, payload, eth_private_key)
        # poll(self, response["transaction_id"], "success",
        #      app, user_handle, eth_private_key)

        self.assertEqual(response["status"], "SUCCESS")
예제 #3
0
    def test_redeem_sila_200_with_card_name(self):
        payload = {
            "user_handle": user_handle,
            "amount": 50,
            "card_name": "visa"
        }

        response = Transaction.redeemSila(app, payload, eth_private_key)

        # poll(self, response["transaction_id"], "success",
        #      app, user_handle, eth_private_key)

        self.assertTrue(response["success"])
예제 #4
0
    def test_redeem_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,
            "account_name": "default_plaid",
            "descriptor": descriptor,
            "business_uuid": business_uuid,
            "processing_type": ProcessingTypes.STANDARD_ACH,
            "destination_id": v_id,
        }

        response = Transaction.issue_sila(app, payload, eth_private_key)

        poll(self, response["transaction_id"], "success", app, user_handle,
             eth_private_key)

        descriptor = "test descriptor"
        payload = {
            "message": "redeem_msg",
            "user_handle": user_handle,
            "amount": 100,
            "destination_id": card_id,
            "descriptor": descriptor,
            "business_uuid": business_uuid,
            "processing_type": ProcessingTypes.STANDARD_ACH,
            "source_id": v_id,
        }
        response = Transaction.redeemSila(app, payload, eth_private_key)
        self.assertEqual(response["status"], "SUCCESS")
예제 #5
0
    def test_redeem_sila_200(self):
        payload = {
            "user_handle": user_handle,
            "amount": 50,
            "account_name": "default_plaid",
            "descriptor": "test descriptor",
            "business_uuid": business_uuid,
            "processing_type": ProcessingTypes.STANDARD_ACH
        }

        response = Transaction.redeemSila(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_redeem_sila_403_redeem(self):
        payload = {
            "user_handle": user_handle,
            "amount": 50,
            "account_name": "default_plaid",
            "descriptor": "test descriptor",
            "business_uuid": business_uuid,
            "processing_type": ProcessingTypes.STANDARD_ACH
        }

        response = Transaction.redeemSila(app, payload, eth_private_key)

        payload = {
            "user_handle": user_handle,
            "transaction_id": response["transaction_id"]
        }

        response = Transaction.cancelTransaction(app, payload, eth_private_key)

        self.assertEqual(response["status"], "FAILURE")
예제 #7
0
    def test_redeem_sila_401(self):
        payload = {"user_handle": "", "amount": "-1"}

        response = Transaction.redeemSila(app, payload, eth_private_key)
        self.assertEqual(response["status"], "FAILURE")