stripe-ruby icon indicating copy to clipboard operation
stripe-ruby copied to clipboard

Inline object expansion no longer working on master

Open jbrowning opened this issue 11 years ago • 2 comments

According to the docs, one should be able to inline expandable objects like so:

Stripe::Charge.retrieve(:id => "ch_15WVnGLyXYFcSpmwtX0U9GZv", :expand => ['customer'])

This is no longer working on master. Example:

[1] pry(main)> customer = Stripe::Customer.retrieve(id: "cus_5hzCdC0TpN5MOJ", expand: ['default_card'])
=> #<Stripe::Customer:0x3fea0714ff88 id=cus_5hzCdC0TpN5MOJ> JSON: {
  "id": "cus_5hzCdC0TpN5MOJ",
  "object": "customer",
  "default_card": "card_15WZHlLyXYFcSpmwkQebO6Ip",
  ...
}
[2] pry(main)> customer.default_card
=> "card_15WZHlLyXYFcSpmwkQebO6Ip"

I believe this was caused by #203. Seems that there's no spec for this.

@bkrausz: You may want to address this before releasing 1.19.

jbrowning avatar Feb 15 '15 21:02 jbrowning

Thanks for the report @jbrowning!

CC @russelldavis

bkrausz avatar Feb 16 '15 04:02 bkrausz

I believe that this issue has cropped up again - I'm not able to get inline object expansion working on master using the following:

stripe_charge = Stripe::Charge.retrieve("ch_18WWaW4QFaGycgRKreD14QhN", :expand => ['customer'])
=> #<Stripe::Charge:0x36fe64c id=ch_18WWaW4QFaGycgRKreD14QhN> JSON: {
  "id": "ch_18WWaW4QFaGycgRKreD14QhN",
  "object": "charge"
  ...
stripe_charge.customer
=> "cus_8o8s5t5T0fqezB"

The docs cover the necessary arguments for #retrieve, but there's no example of object expansion in action. Am I perhaps missing something here? stripe_charge.customer should return a Stripe::Customer object, correct?

flats avatar Jul 12 '16 20:07 flats