I'm wondering if there's a way to use the ShopifyAPI ruby gem to create an order for product found using the GraphQL Storefront API.
We actually already allow a few products to be purchased through our custom Rails application. Since we're charging users via Stripe (for subscriptions that aren't available in our Shopify store), we also use Stripe to charge them for the Shopify purchase, and then we just tell Shopify that the cost of each line item should be $0 for this order and that the "financial_status" of the order is "paid."
What we'd like to do is allow product discovered in the Storefront API to be purchased "at zero cost" using the ShopifyAPI gem as described above. However, it seem the Storefront API itself doesn't allow the functionality we need (setting line item cost to $0, marking the order as "paid"), but also the `ShopifyAPI::LineItem` doesn't allow us to use the product variant IDs provided by the Shopfront GraphQL API. Neither way seems to work…
Is there any way to accomplish what we're after?
For added context, here's the general code we're currently using (but that doesn't work with variant ideas from GraphQL land):
attr_reader :user, :product_variants, :address_params
product_variants.map do |variant|
... View more