Use OrderContents#update_cart in Api::PaymentsController#create#299
Use OrderContents#update_cart in Api::PaymentsController#create#299jordan-brough wants to merge 1 commit into
Conversation
First step in getting all payment creation code going through a common path.
There was a problem hiding this comment.
would this respond with the correct payment in a failed scenario? it wouldn't be the order's last payment would it?
There was a problem hiding this comment.
Yeah I was worried about that also but it's cached inside the association since we just tried to add it through the association. There's a spec that verifies this:
There was a problem hiding this comment.
ah cool. if it were me i'd probably want a separate add_payment method that update_cart would use if it detects nested params as opposed to the other way around. but i think this is fine as well. 👍
There was a problem hiding this comment.
@athal7 cool, yeah, just trying to stay real minimal for the moment before moving on to better stuff like that.
|
👍 @jhawthorn does this look good to you? |
|
ping @jhawthorn |
|
@jhawthorn if you're going to start working on the "CartUpdate" idea perhaps we should have this use CartUpdate instead of |
|
This is taken care of in #357 |
First step in getting all payment creation code going through a common
path.
@jhawthorn @cbrunsdon @gmacdougall @athal7 @magnusvk here's a first step in the direction we talked about this afternoon. I haven't started making a
CartUpdateclass or anything yet but I'm trying to tackle this incrementally and I think this change can stand on its own, but definitely open to any thoughts.