Backend Model added

This commit is contained in:
2019-03-03 22:39:22 +00:00
parent 3dcf91bd7e
commit 5680845ed3
+38 -51
View File
@@ -14,67 +14,54 @@ main entry point for API calls Chiefsoft July 2017 */
#include "medTEmails.h" #include "medTEmails.h"
#include "medTUpload.h" #include "medTUpload.h"
long mermsemr_api_main(CVars in, CVars &out) long mermsemr_api_main(CVars in, CVars &out) {
{ logfmt(logINFO, "long mermsemr_api_main(CVars in, CVars &out)");
logfmt( logINFO, "long mermsemr_api_main(CVars in, CVars &out)");
long retval = PHP_API_BAD_PARAM; long retval = PHP_API_BAD_PARAM;
long action = REQ_LONG( in, "action", 0, -1); long action = REQ_LONG(in, "action", 0, -1);
REQ_LONG( in, "pid", 0, -1); // global implementation - who is calling //REQ_LONG( in, "pid", 0, -1); // global implementation - who is calling
try try {
{ if (action == MEDTRANS_UPLOADS) {
if ( action == MEDTRANS_UPLOADS ) return medtrans_upload(in, out);
{ }
return medtrans_upload(in, out); if (action == MEDTRANS_DOWNLOAD) {
} return medtrans_download(in, out);
if ( action == MEDTRANS_DOWNLOAD ) }
{
return medtrans_download(in, out);
}
if ( action >=MEDTRANS_BKO_START && action <=MEDTRANS_BKO_END ) if (action >= MEDTRANS_BKO_START && action <= MEDTRANS_BKO_END) {
{ return backoffice_calls(in, out);
return backoffice_calls(in, out); }
}
if ( action >=MEDTRANS_USER_START && action <=MEDTRANS_USER_END ) if (action >= MEDTRANS_USER_START && action <= MEDTRANS_USER_END) {
{ return members_call(in, out);
return members_call(in, out); }
}
if ( action >=MEDTRANS_INTERP_START && action <=MEDTRANS_INTERP_END ) if (action >= MEDTRANS_INTERP_START && action <= MEDTRANS_INTERP_END) {
{ }
}
if ( action >=MEDTRANS_TRANSP_START && action <=MEDTRANS_TRANSP_END ) if (action >= MEDTRANS_TRANSP_START && action <= MEDTRANS_TRANSP_END) {
{ return trasnporter_call(in, out);
return trasnporter_call(in, out); }
}
if ( action >=MEDTRANS_CRON_START && action <=MEDTRANS_CRON_END ) if (action >= MEDTRANS_CRON_START && action <= MEDTRANS_CRON_END) {
{ return cron_call(in, out);
return cron_call(in, out); }
}
if ( action == MEDTRANS_STRIPE_CHARGE_ONE ) if (action == MEDTRANS_STRIPE_CHARGE_ONE) {
{ return stripe_one_time_charge(in, out);
return stripe_one_time_charge(in, out); }
} if (action == MEDTRANS_STRIPE_CHARGE_NEW) {
if ( action == MEDTRANS_STRIPE_CHARGE_NEW ) return stripe_new_customer_charge(in, out);
{ }
return stripe_new_customer_charge(in, out); if (action == MEDTRANS_EMAIL_TEST) {
} return email_test(in, out);
if ( action == MEDTRANS_EMAIL_TEST ) }
{
return email_test(in, out);
}
} } catch (bad_parameter) {
catch (bad_parameter) { logfmt(logINFO, "ERROR CALL long mermsemr_api_main(CVars in, CVars &out)");
logfmt( logINFO, "ERROR CALL long mermsemr_api_main(CVars in, CVars &out)"); }
} return retval;
return retval;
} }