-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
allow updates to existing cards #133
allow updates to existing cards #133
Conversation
i have updated this branch based on issues outlined in #100 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be helpful to add comments explaining the logic of post_card
for the next maintainer. The reason I say this is because I look at all the if conditionals and I think:
- What happens if
$card
is not a ref, but not a token either (also - it would be good to explain what the/^tok_...
means - What happens if
$card
is a Token but doesn't have an id - What happens if it's a ref, but not a
Net::Stripe::Token
and not aHASH
? I suspect you're going to say "then it falls through to line 593" but it would be nice to make it clear that all possibilities are covered.
welllll... several times i was tempted to massage the structure of that sub to clarify and tighten, and i have been trying to resist the urge. but since you asked, i'll have at it :-) |
@andrewsolomon i would appreciate your thoughts on
|
I agree that there's lots of scope for making the code more robust. As long as you're confident that your testing covers any changes you make you should feel free to make the code better :-) |
upon review (of my own code :-)) i see that i managed to both remove the code path that handles |
5e86d7e
to
9e2afff
Compare
* add update_card() method to allow updates to card address, expiration, metadata, etc for existing customer cards * update convert_to_form_fields() to handle customer card metadata * add unit tests to confirm card metdata update * correct errant 'rw' on metadata attribute in `Net::Stripe::Card`
9e2afff
to
d84ba41
Compare
allow updates to existing cards
i left this stalled a while ago, but i figured i'd dust it off for inclusion in the next release. discussed preciously in #100 .