Skip to content

Identity map is not properly mapped in the Python client #55

Description

@mahmoudimus

If I delete a card from a Customer:

customer.cards[0].delete()

and the customer only has 1 card, any further operation on the customer object will issue a PUT on the actual customer object, however, the source_uri which might reference the deleted card will throw a 409 since that card will have been deleted.

Here's an executable snippet:

card = balanced.Card.find('/v1/marketplaces/:marketplace_id/cards/:card_id')
customer = balanced.Customer().save()
customer.add_card(card.uri)
assert len(customer.cards) == 1
assert customer.cards[0].uri == card.uri
assert customer.source_uri == card.uri
customer.cards[0].delete()
assert len(customer.cards) == 0
customer.source_uri # this still exists, it should be None!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions