How to deploy and host prebuilt Stripe checkout backend java code - java

I have recently tried to create my first E-Commerce site. Its is made with React on the frontend, and then I implemented a stripe pre-built checkout page to handle payments using java, following this guide: https://stripe.com/docs/checkout/integration-builder
I am trying to deploy the application to firebase to host it, I can deploy the React very easily, however I do not know how to deploy the Java, or if I even can on firebase.
Any help would be appreciated on how to deploy it.

Unfortunately Firebase currently does not support Java:
Cloud Functions current supports the Node.js 8 JavaScript Runtime, and the Node.js 10 Engine is in beta. You can choose a Node version it from your package.json. You can also choose to write your functions in TypeScript, using either Node.js version. The Python 3.7 runtime and Go 1.11 runtime is also avalible, but is currently only accessible from the Google Cloud Console.

Related

Actions On Google Deployment using webhook

I am using Java Client Library to use google Dialogflow. My questions is what happens when we use "appEnginedeploy" using gradle? Where is the code stored and more importantly how the implemented database and other files of code stored and accessed by our agent?
Thanks!
appEngineDeploy is setup to deploy the code to App Engine, a computing platform on Google Cloud. Code and associated project files are stored as they are in your project.
It's not entirely a VM, so you shouldn't necessarily think of App Engine as locating filepaths. If the project can make the links locally, then it should behave the same way in App Engine.
With regards to databases, it would depend if you're using an embedded database or using a hosted solution through another Google Cloud service. Presumably you'd use the database APIs for a Cloud service as shown in the documentation.

How to debug server code in eclipse on deployed appengine database?

I have a Google AppEngine (Java) project in Eclipse. I want to debug my local code in Eclipse but use the deployed database on AppEngine. Until now I use Remote API with username/password (old way)
This method will be deprecated and I want to use OAuth but when I try to use it, it throws an exception:
java.lang.IllegalStateException: OAuth-based authorization not supported for clients running on App Engine
at com.google.appengine.tools.remoteapi.RemoteApiOptions.getOrCreateHttpTransportForOAuth(RemoteApiOptions.java:359)
at com.google.appengine.tools.remoteapi.RemoteApiOptions.useApplicationDefaultCredential(RemoteApiOptions.java:162)
Everthing is fine when I run a simple Java client app that uses remote api in Eclipse. But if the client is AppEngine development environment in Eclipse, it doesn't work.
How can I debug the server code in eclipse using appengine database?
Bug report: https://code.google.com/p/googleappengine/issues/detail?id=12556
This is expected, as value returned by ApiProxy.getCurrentEnvironment() will not be null, but com.google.appengine.tools.development.LocalHttpRequestEnvironment object. For development server you'll have to use old style (username/password) for now.
According to the documentation, you need to add appengine-remote-api.jar from ${SDK_ROOT}/lib/appengine-remote-api.jar to your WEB-INF/lib directory (or add it to your Maven dependencies) before this will work.
Update: Indeed, it looks like OAuth from App Engine with Remote API has not yet been implemented. I would assume this will change before ClientLogin is fully deprecated, but for now I would recommend opening a feature request on the public issue tracker.
One possible workaround would be to create a regular console application that connects to the Remote API (as per the example in the docs) and can act as a proxy for your App Engine application running on the development server.
In addition to what my colleagues Adam and Nikita previously said, I can officially confirm that the Google Cloud Engineering Team is determined to provide a solution to all reasonable use-cases which are affected by the ClientLogin shutdown before its deadline.
Presumably, the Remote API solution will be available in the upcoming releases 1.9.31/32, although this is just an assumption and there's no ETA for it yet.
As an alternative, you can access Cloud Datastore using Protobufs remotely using service account credentials, which might fit your needs for the moment.
UPDATE 2016/01/21:
The team has extended the ClientLogin shutdown deadline to April 12, 2016.
UPDATE 2016/04/12:
As mentioned before, the fix was properly applied and available in the latest versions of the SDK and gcloud. Remote API can now be used again with OAuth for app-to-app (or devserver-to-app) connection.

Docker support - Google App Engine (Java)

I recently learned about Docker and from a press release that Google App Engine supports it.
The question is,
Does it mean that we can now "package" our app using Docker (may it contain non-GAE white-listed jars) and expect it to work with Google App Engine?
How a docker app can access the Datastore API, the TaskQueue API is there a way, or this question is irrelevant?
If I package with Docker, say, a Spring app that access MongoDB, MySQL or whatever would it work GAE, if yes how come?
Or otherwise if this idea is not correct,
What is the integration of Docker and Google App Engine?
This is part of an ongoing Limited Preview Managed VMs, you can subscribe to it with the following form
Does it mean that we can now "package" our app using Docker (may it contain non-GAE white-listed jars) and expect it to work with Google App Engine?
Yes
How a docker app can access the Datastore API, the TaskQueue API is there a way, or this question is irrelevant?
Using the regular API jars.
If I package with Docker, say, a Spring app that access MongoDB, MySQL or whatever would it work GAE, if yes how come?
Because the underlying container run on a Google Compute Engine VMs, see the Managed VMs documentation referenced earlier for more details.

Is there a way to create a virtual machine in Microsoft Azure using a Java Program?

I am working on a project which requires to create a VM in azure. I have worked on AWS where I can use the AWS api to programatically create a VM in AWS. Can I do the same on Azure?
Yes, you can programmatically create VMs in Windows Azure by consuming Windows Service Management REST API. I wrote a blog post some days ago about consuming this API using Java which you can read here: http://gauravmantri.com/2013/08/25/consuming-windows-azure-service-management-api-in-java/. You just have to write code for consuming appropriate operations available in Service Management API.
My team has recently put out some major updates to the Java SDK and what's available in service management areas in our 0.6.0 release. You can check out the README in our repository to see a detailed of what all the SDK can do, and this post provides some guidance on getting started with the service management SDK using Maven and Eclipse.
Yes, you can programmatically create virtual machines in Azure using
Java SDK.
But you need to configure your java program as an application in
Azure portal.
Check this link for authenticating a java program in
azure.
Here is a sample piece of code from Azure SDK for creating a Linux
virtual
VirtualMachine linuxVM = azure.virtualMachines().define("myLinuxVM")
.withRegion(Region.US_EAST)
.withNewResourceGroup("myResourceGroup")
.withNewPrimaryNetwork("10.0.0.0/28")
.withPrimaryPrivateIpAddressDynamic()
.withNewPrimaryPublicIpAddress("mylinuxvmdns")
.withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS)
.withRootUserName("tirekicker")
.withSsh(sshKey)
.withSize(VirtualMachineSizeTypes.STANDARD_D3_V2)
.create();

ByPassing Google App Engine SDK to allow black listed classes

Is there a way to circumbent google app engine sdk to allow the usage of classes that are not present in the GAE JRE white list? I know the app that I would be building will not run in appspot, but at least in my development server, I need to access a postgresql database(java.net.socket.*) and generate some files(java.io.FileWriter) in my development server.
Run your code in another servlet container, such as jetty.

Categories