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

respond_to? :business_tax_id= #392

Closed
msroot opened this Issue Mar 10, 2016 · 3 comments

Comments

Projects
None yet
3 participants
@msroot
Contributor

msroot commented Mar 10, 2016

Hi

I am trying to set a value to an account but doent respond_to business_tax_id

with another field it works:

[21] pry(#<Grape::Endpoint>)> account.legal_entity.address.respond_to? :city=
=> true

but with business_tax_id
[10] pry(#<Grape::Endpoint>)> account.legal_entity.respond_to? :business_tax_id=
=> false

ALSO:
How is it possible not to respond_to? :business_tax_id= but here its works?

[15] pry(#<Grape::Endpoint>)> account.legal_entity.business_tax_id = "123456789"
=> "123456789"
[16] pry(#<Grape::Endpoint>)> account.save; nil
=> nil
[17] pry(#<Grape::Endpoint>)> account.legal_entity.business_tax_id_provided
=> true

@remi-stripe

This comment has been minimized.

Show comment
Hide comment
@remi-stripe

remi-stripe Mar 10, 2016

Contributor

@msroot The business_tax_id can be set via the API but it's never returned afterwards. It's considered sensitive information the same way you can set the card number via the API and not retrieve it.

To confirm that you have set that value in the past we surface business_tax_id_provided as you mentioned which allows you to check whether it's been set or not.

Contributor

remi-stripe commented Mar 10, 2016

@msroot The business_tax_id can be set via the API but it's never returned afterwards. It's considered sensitive information the same way you can set the card number via the API and not retrieve it.

To confirm that you have set that value in the past we surface business_tax_id_provided as you mentioned which allows you to check whether it's been set or not.

@msroot

This comment has been minimized.

Show comment
Hide comment
@msroot

msroot Mar 10, 2016

Contributor

@remistr thank for your response

I know same will happen with ssn_last_4_provided personal_id_number_provided

but what i am saying is why doent respond as a method

account.legal_entity.respond_to? :business_tax_id=

Contributor

msroot commented Mar 10, 2016

@remistr thank for your response

I know same will happen with ssn_last_4_provided personal_id_number_provided

but what i am saying is why doent respond as a method

account.legal_entity.respond_to? :business_tax_id=

@brandur

This comment has been minimized.

Show comment
Hide comment
@brandur

brandur Mar 10, 2016

Contributor

but what i am saying is why doent respond as a method

Hey @msroot, this works via the sometimes useful and highly questionable Ruby metaprogramming feature of method_missing. Here's a link to the responsible code for inspection. I'm not crazy about the design, but it's what we have for now :)

Anyway, I'm closing this issue out for now. Let me know if you have any other questions. (And thanks @remistr!)

Contributor

brandur commented Mar 10, 2016

but what i am saying is why doent respond as a method

Hey @msroot, this works via the sometimes useful and highly questionable Ruby metaprogramming feature of method_missing. Here's a link to the responsible code for inspection. I'm not crazy about the design, but it's what we have for now :)

Anyway, I'm closing this issue out for now. Let me know if you have any other questions. (And thanks @remistr!)

@brandur brandur closed this Mar 10, 2016

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