shoutem / react-native-shopify

React Native bridge to Shopify Buy SDK
262 stars 42 forks source link

why not use JS-Buy-SDK #29

Open thisisjaiswal opened 6 years ago

thisisjaiswal commented 6 years ago

Shopify API is graphql api, Android/iOS SDKs connects to this api through HTTP calls, then why not directly use JS-Buy-SDK when you are on JS App, instead of creating a double wrapper on the native SDK. React Native shouldn't be a wrapper of every native thing, but mainly the UI, everything else is better handled in JS side.

ericlewis commented 6 years ago

I wondered this too, the JS SDK doesn’t support anywhere near as many things, such as customer login etc.

ericlewis commented 6 years ago

JS-Buy-SDK isn’t exactly the same thing, there also is a new version coming out with GraphQL support currently in alpha. I am using the storefront api + Apollo currently. It’s fantastic for everything BUT checkout.

Sent from my iPhone

On Dec 3, 2017, at 10:00 AM, Sandeep Jaiswal notifications@github.com wrote:

but the underlying graph api must have all the features.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

jgrancher commented 6 years ago

Hey @ericlewis! I'm just curious to see your thoughts here. Could you provide us with more information about the differences between the JS Buy SDK and this bridge? I'm keen to know in which circonstances I'd have to use the former or the latter, as my goal is to build a storefront (mobile app) for an existing store (but so far I don't require customer login).

isaachinman commented 6 years ago

@ericlewis @jgrancher I've just come across this a few months later and am in the decision-making process myself. My thoughts:

It seems like the end goal of the JavaScript Buy SDK is to produce a Shopify checkout URL, to which you then redirect the user for the checkout process. Meaning, the JavaScript Buy SDK is not really a "buying" SDK, but more of a "cart" SDK, at the end of which you redirect to Shopify anyways. Despite the maintainers insisting it supports Node environments, it seems like an inherently web-centric lib. If you want a way to actually process orders programmatically, you'll need something else.

A question for anyone familiar with this lib: does this bridge simply wrap the entire functionality of the Mobile Buy SDKs, or is it a small subset of that intended solely for CC-based checkouts?

naiduasn commented 6 years ago

@isaachinman i am at the same place right now. So what did you choose? Any learnings on what should we use for native checkout experience?

isaachinman commented 6 years ago

@naiduasn After wasting a huge amount of time trying to piece together a working solution with Shopify's various APIs, I ultimately arrived at the conclusion that it's not presently possible if you also need to support discount codes via Shopify.

The solution I ended up with is: handle payments manually via Stripe (if you're on RN, tipsi-stripe is great), and then create Shopify orders via either of the Admin APIs server side after payment is successful. You lose cart/checkout/abandon functionality entirely. Also, you'll have to write some methods to fetch discount codes, because Shopify paginates them. There are a lot of small, annoying gotchas in the process.

All in all, working with Shopify has been an absolutely terrible developer experience. They do not offer any technical support whatsoever and the developer forum is basically ignored. The API docs are shambolic and took me days to fully understand.

I would strongly recommend you find a different solution, but if you absolutely need to integrate Shopify into a mobile app, be prepared to spend quite some time, and make many compromises.

amie-wilt commented 4 years ago

I can confirm that what @isaachinman described still stands true.

I found this comment in the early stages of embarking on this extremely frustrating journey (custom Shopify checkout) and ultimately moved away from the idea of a custom checkout and went with the webUrl option. However, after realizing there was no way of persisting the user session into the checkout flow (the user has to log in again at checkout unless you're using ShopifyPlus which is a minimum ~$2k/month), I went back to the idea of a custom checkout and decided to try and piece it together with the admin api and tipsi-stripe, just as @isaachinman described. I just hit the wall of discount codes.. which is when his comment came flashing back to me. So I went digging for it, and sure enough, my experience is exactly as he said. I'm quite frustrated with myself for getting lost in the process and forgetting about this post. Again, as @isaachinman said, we've spent a huge amount of time on this.

I will say it seems the developer forum does get more attention than maybe it did in the past, but the docs are definitely still "shambolic" (great word btw).

If you're not already locked into Shopify, I recommend looking into something with a friendlier headless approach.

arecastudio commented 3 years ago

At the end, js-buy-sdk is just an API to create draft cart, you will need to open an url which redirect user to web version to finish the order process. I use an approach by store user data in firebase, and ask the delivery address every time they are doing checkout session