stripe-ruby-mock / stripe-ruby-mock

A mocking library for testing stripe ruby

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to update PaymentIntent.customer

ryenski opened this issue · comments

Updating the customer attribute of a PaymentIntent does not save the customer. This works in the live API, but not in the mock.

Docs: Update a PaymentIntent

cus = Stripe::Customer.create({email: 'test1@example.com'})
pi = Stripe::PaymentIntent.create(amount: 3000, currency: 'usd')
Stripe::PaymentIntent.update(pi.id, {customer: cus.id})
pi.customer
=> nil
Stripe::PaymentIntent.retrieve(pi.id).customer
=> nil

Updating other attributes works as expected:

pi = Stripe::PaymentIntent.create(amount: 3000, currency: 'usd')
Stripe::PaymentIntent.update(pi.id, { metadata: { order_id: 'ord_1234' } })
Stripe::PaymentIntent.retrieve(pi.id).metadata
=>
#<Stripe::StripeObject:0x148b74> JSON: {
  "order_id": "ord_1234"
}

Possibly related to #856?