PostBack Server

PostBack Server

Postby TimStone » Fri Mar 10, 2023 3:34 am

I've been working with a few companies who provide services I integrate into my software ( management system for small businesses ). One handles SMS, and the other credit card processing ( with an SMS option ).

Both of these need a "PostBack server" to be fully functional. This is a web address to which their system can reply with the info necessary to complete the two way process of the transaction.

They are thinking in terms of web based applications, but for those of us who have clients who still need site based systems, and not web based, this provides a challenge.

My thought is it would be nice to have an application, running as a service, that can listen on the WAN IP ( the shop based server ), and receive these responses. In essence, it would be a lightweight web server handling very little data.

Perhaps someone here has addressed this issue already, or maybe someone even has a solution we can build with FiveWin.

I would enjoy hearing your feedback.

Tim
Last edited by TimStone on Fri Mar 10, 2023 7:06 pm, edited 1 time in total.
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2945
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: Callback Server

Postby Otto » Fri Mar 10, 2023 7:05 am

Hello Tim,
this is a question we all have to address in due time.
I had a system with Pocket PC and VB6 to send SMS.
viewtopic.php?f=4&t=12991&start=30&hilit=sms
But long ago.

I think it should be possible to use, for example, ARCHER router with a SIM card or even SYNOLOGY.

Best regards,
Otto


I googled:

Yes, Synology NAS devices support sending SMS programmatically using the Synology DSM SMS API. The Synology DSM SMS API allows you to send SMS messages from your Synology NAS device using HTTP requests.

Here's an example of how to send an SMS message using the Synology DSM SMS API using JavaScript:

javascript
Copy code
const axios = require('axios');

const nasIpAddress = 'NAS_IP_ADDRESS';
const port = 'PORT_NUMBER';
const username = 'YOUR_USERNAME';
const password = 'YOUR_PASSWORD';
const message = 'Hello world!';
const phoneNumber = 'RECIPIENT_PHONE_NUMBER';

axios.post(`http://${nasIpAddress}:${port}/webapi/entry.cgi`, {
api: 'SYNO.SMS.Send',
version: 1,
method: 'send',
message: message,
to_number: phoneNumber,
account: username,
passwd: password
})
.then(response => {
console.log(response.data);
})
.catch(error => {
console.error(error);
});
In this example, you would replace "NAS_IP_ADDRESS" with the IP address of your Synology NAS device, "PORT_NUMBER" with the port number of your Synology DSM web interface, "YOUR_USERNAME" and "YOUR_PASSWORD" with your Synology DSM login credentials, "Hello world!" with the message content you want to send, and "RECIPIENT_PHONE_NUMBER" with the phone number of the recipient.

Note that the Synology DSM SMS API may require additional parameters or authentication headers depending on the NAS model and DSM version. You should consult the Synology documentation for more information.

********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6346
Joined: Fri Oct 07, 2005 7:07 pm

Re: Callback Server

Postby Otto » Fri Mar 10, 2023 7:09 am

...


he code snippets I provided in my previous answers are written in JavaScript, which is a popular programming language used for both front-end and back-end web development, as well as server-side scripting, automation, and more.

JavaScript is a dynamically typed language that is interpreted by web browsers, and also can be run on servers using Node.js. It is used to create interactive and responsive web applications, as well as build server-side applications, command-line tools, and more.


You would say if I open a web page on a Synology with your code this would send an SMS
Yes, if you open a web page on a Synology NAS device that contains the code snippet I provided in my previous answer and replace the values for "NAS_IP_ADDRESS", "PORT_NUMBER", "YOUR_USERNAME", "YOUR_PASSWORD", "Hello world!", and "RECIPIENT_PHONE_NUMBER" with the appropriate values for your Synology NAS device and SMS recipient, then the code will send an SMS message to the specified phone number.

********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6346
Joined: Fri Oct 07, 2005 7:07 pm

Re: Callback Server

Postby Otto » Fri Mar 10, 2023 7:18 am

...

In the code snippet I provided earlier for sending SMS via Synology DSM SMS API, the "YOUR_USERNAME" and "YOUR_PASSWORD" fields refer to the login credentials of an account on your Synology NAS device that has permission to access the Synology DSM SMS API.

In order to use the Synology DSM SMS API, you need to have an account on your Synology NAS device with the necessary permissions. You can create a new account with the appropriate permissions by going to "Control Panel" > "User" and creating a new user with "SMS API" permissions.

Once you have created the user, you can use the username and password of that user to replace the "YOUR_USERNAME" and "YOUR_PASSWORD" fields in the code snippet I provided earlier.

Note that the user account must have permission to access the Synology DSM SMS API, which can be granted by going to "Control Panel" > "Notification" > "SMS" and selecting the user in the "Users" tab. You can also specify a maximum number of SMS messages that the user is allowed to send per day, if desired.
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6346
Joined: Fri Oct 07, 2005 7:07 pm

Re: Callback Server

Postby cnavarro » Fri Mar 10, 2023 6:25 pm

TimStone wrote:I've been working with a few companies who provide services I integrate into my software ( management system for small businesses ). One handles SMS, and the other credit card processing ( with an SMS option ).

Both of these need a "Callback server" to be fully functional. This is a web address to which their system can reply with the info necessary to complete the two way process of the transaction.

They are thinking in terms of web based applications, but for those of us who have clients who still need site based systems, and not web based, this provides a challenge.

My thought is it would be nice to have an application, running as a service, that can listen on the WAN IP ( the shop based server ), and receive these responses. In essence, it would be a lightweight web server handling very little data.

Perhaps someone here has addressed this issue already, or maybe someone even has a solution we can build with FiveWin.

I would enjoy hearing your feedback.

Tim


I recommend that you integrate Harbor's uHttpd server into your application.
It is simple and very practical.
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
cnavarro
 
Posts: 6549
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: PostBack Server

Postby TimStone » Fri Mar 10, 2023 6:41 pm

I would be happy to explore that. Do you have any links for documentation on the Harbor uHTTPd server ? I see an hbhttpd.lib but have no clue what is in it, or how to implement it.

I did a web search but only find a couple of threads on the Harbour Google group stating it is of value with mod_harbour, but of course in this case I'm not using a full webserver ... it must be based at the local site.
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2945
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: PostBack Server

Postby karinha » Fri Mar 10, 2023 9:12 pm

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7835
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: PostBack Server

Postby TimStone » Fri Mar 10, 2023 9:36 pm

Thank you for the link.

Can you suggest any links ( or other resources, ie. books ) that will help me gain knowledge about web services ( that would apply to the principles of this code ) ? I use hosted web services for websites and know some basics, but don't have a good background in how the servers function.

I would like to increase my knowledge

Thank you.
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2945
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 97 guests