#createitcarlos-terminals

1 messages · Page 1 of 1 (latest)

plush nebula
#

Hi there! What does WPF stand for? Are you using Connect?

compact musk
#

@plush nebula , WPF is a Windows platform application. So it is a .Net desktop application. The frontend is WPF/XAML Windows markup language, the server-side code is .Net

plush nebula
#

Thanks makes sense

#

So sounds like you are using the Server driven integration then?

compact musk
#

More or less we are looking at the server-driven examples, but in any case, theoretcially, we would write different applicatoins with different front ends to run the Terminals and if the Stripe calls were running as a single applicatiion instead of installed per device, would it be possible to use it as a service.

plush nebula
#

Gotcha, thanks for clarifying

compact musk
#

The examples online are using the JS web for the client and there aren't any real non-JS web-based examples using .Net

plush nebula
#

Hmm thinking. I'm not as familiar with server-driven so may need to ask a colleague if we have a strong recommendation here.

compact musk
#

So let's say we build an iOS/Android app and a Windows app, but we only want to have Stripe run as a service on a server and just have the applications talk to the single service instead of having to manage and redeploy multiple applications each time we need to add to the Stripe API service.
I did not know if there are good examples of multiple clients talking to a single Stripe service.
Thanks for asking, that would be super helpful

plush nebula
#

My understanding is this is totally fine and we would indeed recommend just using a single server here but I'm double checking.

compact musk
#

Thank you, help with the calls on how to differentiate or configure the traffic from and to each terminal would be very helpful too. More or less how would we know which terminal should receive which message based on the calls to the single service.
Maybe where in the documention or what API calls we should be using.

I also did a quick diagram of what we are looking for our infrastructure.

inland nimbus
#

It should be possible to have multiple terminals pointing to the same server.

#

Sorry, still catching up on this, are you running in a specific error when trying to do this or are you trying to understand how to do a certain part of this in .NET?

compact musk
#

Trying to understand mainly. What I am wondering is from the client what parameters would we pass to let the service know what terminal the payment is coming from and then getting the response back for that specific terminal so we can show any responses on the client application

#

The example for the .Net sample uses the Stripe JS with the .Net as the backend, but it does not show an example if you have multiple terminals. Which we have two currently so we can develop against both to try to develop a service.

inland nimbus
#

Gotcha. Looking more in to the specifics of how to do this.

inland nimbus
#

You should just need to keep track of which terminal ID maps to which client and then your client can just send the terminal ID back to your server and it can use that one to charge

compact musk
#

Ok, can i post some code here to check to make sure I am doing this correctly then? I am trying to use the example from Stripe to get the terminal status but when I try to return my status object on the terminal, it comes back to the client empty

#

Mainly because I feel I am missing a step

inland nimbus
#

What call is returning empty data?

#

And yes, please send your code if you are unsure what to pass where or if you are seeing behavior like this.

#

And this is your code that is trying to send the status from the server that is turning up empty on the client?

compact musk
#

Correct. So what I am doing is currently using the JS sample project using the .Net as the server.

So my get terminal by ID in my server side code is this:

[Route("get_terminal_manually")]
[ApiController]
public class PaymentGetTerminalController : Controller
{
[HttpGet]
public ActionResult PostToGetTerminal()
{
var service = new ReaderService();
var term = service.Get("tmr_EmULswRlTPRBdX",null, null);
return Json(term); //-THIS IS SUCCESSFUL AND BRINGS BACK THE TERMINAL OBJECT, HOWEVER - SEE CLIENT CODE
}

 }

//========CLIENT CODE
function getTerminal() {
console.log("trigger get terminal");
// Do not cache or hardcode the ConnectionToken. The SDK manages the ConnectionToken's lifecycle.
return fetch('/get_terminal_manually', { method: "GET" })
.then(function (response) {
console.log(JSON.stringify(response)); //--- 'response' COMES BACK BLANK
return response.json();
})
.then(function (data) {
// return data.secret;
});
}

#

Ok so My server side code gets the object back in the 'term' and when passed back to the JSON Return the client should pick it up and but the response comes back {}

#

For my JS function I just created another simple HTML button that calls the 'getTerminal()' function