Why do my Next.js Commerce Store and Shopify checkout have different URLS - url

I created shopify storefront with Next.JS Commerce with my own domain ( mystoredomain.com ) when I proceed to checkout it directs me to my generic shopify store with a generic url ( blahblahwhatever.myshopify.com ) which is hidden since its not in use. I want the shopify checkout to keep using my storefront ( mystoredomain.com ) URL. Any ideas on how to fix this?
Tried to see if I could switch the domain on my shopify template domain to ( mystoredomain.com ) but then my next.js commerce app doesnt have the correct domain.

Related

Implementing Stripe with NextJS and Rails backend

I would like to accept payments on my NextJS + Rails (backend) application. The Rails backend handles bookings and has a few tables (user, bookings, etc). I want it to be as 'easy' as possible so Stripe Checkout seems to be a good fit.
However, I struggle to understand if I need to set up Stripe only using NextJS (front + NextJS API), or if I should do the backend part using the Rails server.
The Stripe docs only show the Stripe set up with NextJS (front) and NextJS api.
Thanks in advance for your help!
Hello 👋🏻 While the term “easy” is subjective, I think Stripe Checkout with Prebuilt Checkout page flow would be an ideal choice. It has a pretty solid guide to get started [1] as well as it requires a lot less code and offers various customization options.
All you have to do is;
Build a form on your NextJS frontend that makes a POST request on your backend
Build a route on your rails app that creates a Stripe Checkout session [2]
Then redirect the users to the Stripe hosted
checkout page
Stripe will take care of accepting the payments and sending users back to your app [3].
While there are no official example docs on Stripe Integration with Rails, you can tweak the Ruby + Sinatra snippets to fit into your rails app.
[1] https://stripe.com/docs/payments/accept-a-payment?platform=web&ui=checkout
[2] https://stripe.com/docs/api/checkout/sessions/create?lang=ruby
[3] https://stripe.com/docs/api/checkout/sessions/create?lang=ruby#create_checkout_session-success_url
[4] https://stripe.com/docs/api/checkout/sessions/create?lang=ruby#create_checkout_session-cancel_url
[5] https://stripe.com/partners/pay-rails

Big picture of domain, mobile app website and server

I am new to backend world, currently I am very confused with these concept relationships and really need some help here.
So currently I already have an iOS app and backend server(using python, hosting at AWS) ready. Now I need to register a new domain name and build a basic website to explain and promote my app.
Let's assume I am using goDaddy to register a domain name as "hello.com", now I have my basic website ready as well, I guess I need to upload html files to goDaddy hosting server then the website should be able to run, but then how can I link it to our python server?
For example, in the iOS code when I am sending a http request, I will need to send it to "https://hello.com/api/xxx", correct? Please correct me if I am wrong.
You should use subdomains for the different servers:
www.hello.com = your static website hosted on Godaddy or wherever
api.hello.com = your Python api server
etc...
To make this work you would just edit your DNS zone on Godaddy (or wherever you have your domain hosted) and create a record for "www" that points to your website server and a record for "api" that points to your API server.

octopress (ruby on rails) stripe integration

I would like to integrate stripe payment system to my octopress blog. The problem is that octopress is used to build static web sites, and integration stripe requires to add new Controllers (dynamic) to handle user payments.
how can I add such a controller without breaking the octopress file structure.
regards,
I'm not familiar with octopress. But I'm assuming it's similar to Wordpress, and whenever I want to use rails functionality on a wordpress application, I create a subdomain that points to my rails app using a service like dnsimple.
So if someone visits railsapp.mywebsiteurl.com they will receive a response from my rails application. However, if someone visits www.mywebsiteurl.com they will get a response from octopress.

How do I create 301 redirect from WordPress (hosted on wsynth) to a Rails app hosted on Heroku?

I have a website (example.com) that is a WordPress site hosted on WSYNTH.
I am redesigning the site, same domain (example.com) in ROR hosted on Heroku.
I have been told that for SEO purposes, once I point my domain to the ROR app on Heroku, all the old pages from the Wordpress site will go dark. (Makes sense.) But this would be very bad for SEO, since example.com will now have many URLs associated with it (created from the WP site) that are no longer valid.
I've heard that a 301 Redirect for those WordPress URLs will take care of this SEO issue. But how and where should I do this? Should I be installing a plugin in WordPress that will automate the redirects to the pages I want to send them to in the ROR/Heroku app?)
Also, is it possible to keep some of those old WordPress URLs live?
DNS
The 301 redirect is not the issue - you can use Wordpress itself to redirect to specific pages (using the simple 301 redirects plugin), or a better way will be to redirect your domain (with your DNS) to your Rails app, and then use the routes to handle any stray pages
The world of "SEO" is highly overrated - Google is just a system which
follows links. If it cannot find a page, it removes it from its
rankings; if it can find the page, it judges its on & off-site
optimization to determine its relevance.
This means the only thing you need to concern yourself with is ensuring you don't have any "holes" in your URLs. The redirections essentially mean you will tell Google to follow a link to the new page
--
Redirections
The first thing you need to do is ensure you have the new pages you wish to show on your site. Preferrably, you'll want to make as many of them as identical to your previous URLS as you can.
Secondly, you can introduce redirects in your Rails routing system to give Google real pages when it visits the links for your Wordpress site:
#config/routes.rb
get '/your-old-post-name', to: redirect('/your-new-post-name')
This will mean you will have to create redirections for every wordpress post in your new Rails app - but should give Google the knowledge that those pages have changed, to which it will update

Correct approach to adding a wordpress site to an existing RoR site hosted on heroku

Hello I have an app developed for a client of mine. This app is hosted on heroku on domain http://www.mydomain.com. Client has limited technical knowledge and wants a system that will easily allow him to add/edit content on some sites. Example: customer wants to create a news page and edit it, or he wants to create a blog posts..... The customer does not want to edit the main pages that i have already created for the app. So i was thinking of adding a wordpress site under http://www.mydomain/com/extras and this will be a fully managed wordpress site that my client can edit himself. Is this the correct approach? i researched and apparently it is not easy to host worpress on heroku. your recommendation is highly appreciated
thanks
Buildpacks
If you want to install Wordpress on Heroku, you'll need to use a custom buildback (typically this Wordpress buildpack)
As for running in a buried folder, I suppose it would work if you had the system set up correctly - you may need to create a custom buildpack to handle it all.
Some info for you:-
When you git push heroku, Heroku’s slug compiler prepares your code
for execution by the Heroku dyno manager. At the heart of the slug
compiler is a collection of scripts called a buildpack.
What you'll be looking for is how to create a buildpack to help your application deploy correctly. If you put your Wordpress blog in the following Rails folder, it should be accessible at least (whether it will run is another matter, as the paths might be inconsistent):
/public/path/to/your/blog
This will give you the ability to access the blog from the following URL: domain.com/path/to/your/blog
--
DNS
Another way to achieve this would be to host your Rails app on heroku, whilst deploying the Wordpress site in some shared hosting.
You could then "route" a subdomain, or perhaps a deep folder, with your DNS setup on your host - allowing you to send the traffic to different hosts without the users noticing

Resources