Example #1
0
    def test_make_default_payment_card_business(self):
        """Makes a business payment card the default."""

        business = self.client.businesses.create({})

        FundingSources.get_business_payment_card(business)
        payment_card_two = FundingSources.get_business_payment_card(business)

        updated = self.client.funding_sources(
            payment_card_two.token).make_default()

        verify_payment_card_response_model(self, updated,
                                           {'is_default_account': True})
    def test_addresses_list_for_business_one(self):
        """Tests when one funding source address should be returned."""

        business = self.client.businesses.create({})

        address = FundingSources.get_business_card_holder_address(business)

        FundingSources.get_business_payment_card(business)

        addresses = self.client.funding_sources.addresses.list_for_business(
            business.token)

        self.assertEqual(len(addresses), 1,
                         'Incorrect number of addresses returned')

        verify_card_holder_address_response(
            self, addresses[0], address.__dict__)
Example #3
0
    def test_payment_card_save_business(self):
        """Updates a payment card for a business."""

        payment_card = FundingSources.get_business_payment_card()

        updated = self.client.funding_sources.payment_card.save(
            payment_card.token, self.token_update_request)

        verify = FundingSources.get_funding_source_verify(payment_card)
        verify["exp_date"] = self.token_update_request["exp_date"]

        verify_payment_card_response_model(self, updated, verify)
    def test_funding_sources_list_for_business_filter_type(self):
        """Filters list by type."""

        business = self.client.businesses.create({})

        FundingSources.get_business_ach_funding_source(business)
        card = FundingSources.get_business_payment_card(business)

        results = self.client.funding_sources.list_for_business(
            business.token, params={"type": "paymentcard"})

        self.assertEqual(len(results), 1,
                         'Unexpected number of funding sources returned')

        self.assertEqual(
            results[0].type, 'paymentcard',
            'Filter did not return funding source with the correct type')

        verify = FundingSources.get_funding_source_verify(card)

        verify_funding_account_response_model(self, results[0], verify)