We're working out our checkout flow with Foxy, and have hit a snag where we need to substantially alter the cart during checkout. When someone logs in on the Foxy checkout via SSO, we need to look up any discounts they're eligible for on our main server, what funds they have on file, and possibly lower overall prices. We require everything that's added to the cart be signed, so I'm looking at an indirect approach, instead of altering the cart via the FC object. When someone logs in, I'll capture that event on the checkout page. That'll make a GET request back to our server with the email address and Foxy session id. Our server does its lookup, then uses the hAPI to adjust anything needed in the cart. When everything finishes, the GET request returns and it reloads + renders the new cart.
I have all the pieces working, but one: I can't figure out how to go from the fcsid to a cart id that the hAPI can recognize. I could probably find the cart deductively by working backwards from carts index API route, but that makes me uneasy. I could also pass up enough information to recreate the cart, then redirect the user to a new checkout page + fcsid, but that also seems inelegant, and we'd greatly prefer to avoid the refresh. Can someone point me in the right direction? I'd also be happy with a, "no, dummy, you missed this other obvious way to do that," if that's the case!