Stripe customer integration on bootstrap html site - javascript

I built an ecommerce website using twitter bootstrap that I wish to take subscription payments from using Stripe. I want to create a new customer that has a subscription using the example code seen here on the stripe site. It has the option to execute this code using various languages (curl,ruby,python,pho,java). How can I implement this on my very basic bootstrap based website that has no real backend?

You will need a real backend one way or another. You could use Heroku, or build a simple backend on your server. I really like the nginx/gunicorn/supervisor/flask stack. I've used this tutorial several times, and it is very nice (you need to follow the link at the bottom and configure supervisor to finish it).
Also, check out the flaskr tutorial to get your bootstrap site all plugged in and ready on top of the stack so you can get started with the stripe python integration.
Good luck-- you've got a lot of work to do : )

Related

Is it ok to use two different ReactJS Code bases for one project

As I'm starting my carrier as JavaScript developer I always have this question. Let's say I'm developing an App using ReactJS. And in that project, I want to create separate domains for Admin and Client.
Because the admin can log into the backend and check the inventory, it won't get mixed with the Client / User when using the same login. And the code is also getting smaller
As an Example.
Admin is logged using admin.site.com
User / Client is logged in using site.com/login
Now, I decided to go with NodeJs as the back-end for the project. For front-end of the back-end (UI), I thought of using REactJS. Also to use Admin LTE.
For Client-side I will be also using ReactJs.
So there will be two ReactJS code bases and one Node JS.
My Questions are,
Is this method ok?
Or can I do this on one ReactJS code base?
Do you guys have any suggestions for me?

How to call a plugin outside of Wordpress?

So, I need to call a plugin from outside my woocommerce websites. I have my own database that connects to Woocommerce throught REST API when it comes to products, orders and etc. My problem is, now I need to call a plugin on admin.php?page=pluginName&action=action&orderid=123456.The server that communicates with woocommerce is using classic ASP. I already tried to simply do a POST but of course wordpress asks me for login. I even tried to post it to a custom php page inside woocommerce and then post it to the plugin page but no success. Is there any way to call the plugin URL without having to login every time? It can be a php code inside my woocommerce FTP that recieves a POST with the order ID (the only query string that changes on each recordet) and then makes an AJAX POST to the plugin or something
Tried to create a custom PHP code to retrieve the POST and then do a wp_remote_post to the admin.php URL but nothing works. I just need to run the url, the plugin does the rest then
WordPress plugins rely on a lot of WordPress core code to function. Getting them to stand alone will be a LOT of work and your result will be brittle if you can get it to work at all. (Brittle === anything might break it, including a core or plugin update.)
WordPress's REST API is the best way to access WordPress, including plugin functionality, from some other network server. WooCommerce also supports REST, documented here. It offers an API key subsystem allowing secure authentication.
It's a programming task, but not unreasonably hard, to write a small plugin that adds a REST endpoint or two for a special purpose. But it's possible the one of the existing WooCommerce REST endpoints will serve your purpose. (You didn't tell us what it is, so it's hard to give more detailed advice.)

Making Google Calendar agenda view into cards

I'm using Mobirise to build our club's website, and they want to show some of our events at the top of the page.
I thought I could make something like this, with the outer blue being where the calendar frame would end (very rough drawing, don't judge too hard).
Tockify had something pretty close, but I figured there's a way to code something like this, or perhaps another service that's free that can do this. I would prefer not to use PHP, but embed some JavaScript into the HTML that can do this.
Thanks!
To retrieve events from an account's calendar, you need to connect to the Google Calendar API using authorized credentials.
For this you need to create a project in Google Cloud Platform, and enable the calendar API for that project. You will also need to create credentials for your app to use when making calls to the API.
After you have a project, credentials and you have enabled the Calendar API, it is time to code a script that uses the credentials to get the data you want from the Calendar API.
There are several language client libraries for each developer's need. You could use JavaScript for your application.
Here is a quickstart that should get you up and running to make those Calendar API calls you are looking for.
Calendar API Quickstart

Create a GET request to Coinbase with JavaScript

I have very basic knowledge in JS and C#, and now I'm trying to build my first web app with JS. I want to create a web app which creates a GET request to Coinbase website and takes the current price of Bitcoin, Ethereum and etc. and show it in my web app.
Can you provide me a website where i can start with?
Thank you.
Coinbase has a maintained API you can use to fetch the data you need. They support various solutions (REST, Websocket, etc.), depending on your requirements.
Resources for getting started with general web development is an entirely different beast. I would suggest Angular's Heroes Tutorial, and from there read up on AJAX or Websockets (for the latter, I suggest socket.io).
Expect 100-250 hours work.

Can I use PHP SDK and JAVASCRIPT SDK at the same time?

I have a php program/app which asks for input, generate an image and post th image link to user's timeline (processor.php). I used PHP SDK in posting to timeline since I am more familiar with PHP. Now, in my gallery.php, i want to show like buttons for each generated image. I am aware that i have no option but use JS SDK in making button. but is it fine if i use two different SDK's in a single app?
processor.php - PHP SDK
gallerry.php - JS SDK
thanks for your answer! I would love to try your suggetions too
There shouldn't be any problem using PHP and JS in the same application, quite a common use case. You would normally use PHP to create the Web Application structure, handle backend logic, and then use JS to handle UI events.
There's nothing special about combining the two, just create the Web page with JS as normal for the view, and use PHP to build it.
Hope this helps.
Yes, there is no problem, the two APIs are designed to work together. The PHP API is usually used to created the backend logic (for example OAuth implementation, posting and getting data, etc) and the JS API to handle user iniated events.
Also see this: https://stackoverflow.com/a/6728092/1107118 on how to handle login state. Normally the JS API is used for logging in too, and then with the PHP API you take the access token and do the backend actions.

Categories

Resources