diff --git a/mermsemr/src/shared_tool/mermsemr_api_main.cc b/mermsemr/src/shared_tool/mermsemr_api_main.cc index 0905d9c..9747fea 100644 --- a/mermsemr/src/shared_tool/mermsemr_api_main.cc +++ b/mermsemr/src/shared_tool/mermsemr_api_main.cc @@ -14,68 +14,55 @@ main entry point for API calls Chiefsoft July 2017 */ #include "medTEmails.h" #include "medTUpload.h" -long mermsemr_api_main(CVars in, CVars &out) -{ - logfmt( logINFO, "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)"); long retval = PHP_API_BAD_PARAM; - long action = REQ_LONG( in, "action", 0, -1); - REQ_LONG( in, "pid", 0, -1); // global implementation - who is calling - try - { - if ( action == MEDTRANS_UPLOADS ) - { - return medtrans_upload(in, out); - } - if ( action == MEDTRANS_DOWNLOAD ) - { - return medtrans_download(in, out); - } - - - if ( action >=MEDTRANS_BKO_START && action <=MEDTRANS_BKO_END ) - { - return backoffice_calls(in, out); - } - - if ( action >=MEDTRANS_USER_START && action <=MEDTRANS_USER_END ) - { - return members_call(in, out); - } + long action = REQ_LONG(in, "action", 0, -1); + //REQ_LONG( in, "pid", 0, -1); // global implementation - who is calling + try { + if (action == MEDTRANS_UPLOADS) { + return medtrans_upload(in, out); + } + if (action == MEDTRANS_DOWNLOAD) { + return medtrans_download(in, out); + } - if ( action >=MEDTRANS_INTERP_START && action <=MEDTRANS_INTERP_END ) - { - } - - if ( action >=MEDTRANS_TRANSP_START && action <=MEDTRANS_TRANSP_END ) - { - return trasnporter_call(in, out); - } - if ( action >=MEDTRANS_CRON_START && action <=MEDTRANS_CRON_END ) - { - return cron_call(in, out); - } - - - if ( action == MEDTRANS_STRIPE_CHARGE_ONE ) - { - return stripe_one_time_charge(in, out); - } - if ( action == MEDTRANS_STRIPE_CHARGE_NEW ) - { - return stripe_new_customer_charge(in, out); - } - if ( action == MEDTRANS_EMAIL_TEST ) - { - return email_test(in, out); - } - - } - catch (bad_parameter) { - logfmt( logINFO, "ERROR CALL long mermsemr_api_main(CVars in, CVars &out)"); - } - return retval; - + if (action >= MEDTRANS_BKO_START && action <= MEDTRANS_BKO_END) { + return backoffice_calls(in, out); + } + + if (action >= MEDTRANS_USER_START && action <= MEDTRANS_USER_END) { + return members_call(in, out); + } + + if (action >= MEDTRANS_INTERP_START && action <= MEDTRANS_INTERP_END) { + } + + if (action >= MEDTRANS_TRANSP_START && action <= MEDTRANS_TRANSP_END) { + return trasnporter_call(in, out); + } + + if (action >= MEDTRANS_CRON_START && action <= MEDTRANS_CRON_END) { + return cron_call(in, out); + } + + + if (action == MEDTRANS_STRIPE_CHARGE_ONE) { + return stripe_one_time_charge(in, out); + } + if (action == MEDTRANS_STRIPE_CHARGE_NEW) { + return stripe_new_customer_charge(in, out); + } + if (action == MEDTRANS_EMAIL_TEST) { + return email_test(in, out); + } + + } catch (bad_parameter) { + logfmt(logINFO, "ERROR CALL long mermsemr_api_main(CVars in, CVars &out)"); + } + return retval; + }