def test_make_default_payment_card_user(self): """Makes a user payment card the default.""" user = self.client.users.create({}) FundingSources.get_user_payment_card(user) payment_card_two = FundingSources.get_user_payment_card(user) updated = self.client.funding_sources( payment_card_two.token).make_default() verify_payment_card_response_model(self, updated, {'is_default_account': True})
def test_payment_card_save_error_request(self): """Tests error handling when a bad update request is passed.""" payment_card = FundingSources.get_user_payment_card() with self.assertRaises(MarqetaError): self.client.funding_sources.payment_card.save( payment_card.token, {})
def test_payment_card_find_success(self): """Verifies find returns the correct payment card.""" payment_card = FundingSources.get_user_payment_card() found = self.client.funding_sources.payment_card.find( payment_card.token) expected = FundingSources.get_funding_source_verify(payment_card) verify_payment_card_response_model(self, found, expected)
def test_payment_card_save_user(self): """Updates a payment card for a user.""" payment_card = FundingSources.get_user_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)