-
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
card object and card id not legitimate arguments to post_customer() and post_card() #138
Comments
and, even if you do create a card on a different customer in order to pass a card object to creating a customer:
updating a customer:
updating the card attribute of the customer object and re-posting that object:
this is because the card object does not serialize into a useful form. the API expects the id of an object "created via the Token or Sources APIs" :
|
similar reasoning applies to |
* updated Kavorka signature to remove non-functional or illegitimate argument types * removed Net::Stripe::Card and disallowed card id for card, as neither form is valid conceptually <lukec#138> * always create a Net::Stripe::Customer object before _post() to take advantage of argument coercion during objectification <lukec#148> * include omitted arguments in object creation * clean up and centralize Net::Stripe:Token coercion code, since we always need the token id * added unit tests to exercise all allowed argument forms for customer creation and customer update <lukec#139> * closes <lukec#138>
* updated Kavorka signature to remove non-functional or illegitimate argument types * removed Net::Stripe::Card and disallowed card id for card, as neither form is valid conceptually <#138> * always create a Net::Stripe::Customer object before _post() to take advantage of argument coercion during objectification <#148> * include omitted arguments in object creation * clean up and centralize Net::Stripe:Token coercion code, since we always need the token id * added unit tests to exercise all allowed argument forms for customer creation and customer update <#139> * closes <#138>
i struggled with the wording for the title because the issue is not that the code will not handle a card object being passed to
post_customer()
, but rather that there is no way for that to actually happen, unless i am misunderstanding something.post_customer()
can be called either to create or update a customer, and in either of those cases you cannot get a card object unless it is already attached to that customer.in order to have a card object in hand, you must have called one of
post_card()
,get_card()
,get_cards()
, etc. all of these methods require that you have an existing customer with an id.if you have an existing customer with an id, you obviously cannot be calling
post_customer()
in create mode.in order to retrieve a card from an existing customer, that card must already be attached to that customer, meaning that it is a no-op to retrieve that card only to re-post it to the same customer. i have confirmed this via the below, then comparing the JSON returned from
get_customer()
and the secondpost_customer()
.attempting to attach a card which was retrieved from a different customer generates an API error, which i read to mean "you can only pass a token id during customer creation".
The text was updated successfully, but these errors were encountered: