These are chat archives for rebelidealist/stripe-ruby-mock

7th
Mar 2016
Andrew Leung
@a-leung
Mar 07 2016 19:57

hi - I'm doing some partial refund work with Stripe and stripe-ruby-mock and noticed this:

charge_info = { amount: 100, currency: 'usd', token: generate_stripe_token }
charge = Stripe::Charge.create(charge_info)
charge.refund(amount: 100)
charge.amount_refunded # => 100
charge.refund(amount:100)
charge.amount_refunded # => 200

whereas Stripe's response to the second charge.refund(amount: 100) in irb is:

Stripe::InvalidRequestError: (Status 400) (Request req_XXXX) Charge ch_XXXX has already been refunded.

am I doing something wrong?