first commit

This commit is contained in:
2019-05-31 11:26:35 -04:00
commit c403ba19f7
5075 changed files with 965209 additions and 0 deletions
File diff suppressed because it is too large Load Diff
+644
View File
@@ -0,0 +1,644 @@
// Account management toosl
#include "clog.h"
#include "cgi.h"
#include "input.h"
#include "wrenchboard_api.h"
#include "account_mngt.h"
#include "email.h"
#include "safestring.h"
#include <string>
#include "pgsql.h"
#include "pgsql_wrapper.h"
#include "cfg.h"
#include <curl/curl.h>
#include "account.h"
long WrenchReturnMemberBankAccount(CVars in, CVars &out) {
logfmt(logINFO, "WrenchReturnMemberBankAccount()");
char vname[30];
long ret = PHP_API_BAD_PARAM;
try {
long limit = REQ_LONG(in, "limit", 1, -1);
long member_id = REQ_LONG(in, "member_id", 1, -1);
REQ_LONG(in, "page", 1, -1);
out["total_record"] = "0";
const PGresult *res;
res = pgsql_query("SELECT b.id bank_id,b.firstname||' '||b.lastname||' '||b.account_no||' '||k.name AS recipient,b.account_no,b.added "
"FROM sendmoney_recipient b "
"LEFT JOIN bank_entity_codes k ON k.code=b.bank_code "
"WHERE b.member_id = %lu AND b.status=1 LIMIT %lu", in["member_id"].Long(),limit);
if (res != NULL && pgsql_num_rows(res) > 0) {
out["total_record"] = pgsql_num_rows(res);
for (int i = 0, n = pgsql_num_rows(res); i < n; i++) {
map<const char*, const char*>f = pgsql_fetch_assoc(res, i);
if (f.empty()) continue;
CVars rec;
map_to_cvars(f, rec);
snprintf(vname, sizeof (vname), "bank_id_%05d", i);
out[vname] = rec["bank_id"];
snprintf(vname, sizeof (vname), "recipient_%05d", i);
out[vname] = rec["recipient"];
snprintf(vname, sizeof (vname), "account_no_%05d", i);
out[vname] = rec["account_no"];
snprintf(vname, sizeof (vname), "added_%05d", i);
out[vname] = rec["added"];
}
}
ret = PHP_API_OK;
out["status"] = "OK";
} catch (bad_parameter) {
logfmt(logINFO, "ERROR CALL long WrenchReturnMemberBankAccount(CVars in, CVars &out)");
}
logfmt(logINFO, "/WrenchReturnMemberBankAccount()");
return ret;
}
long WrenchReturnMemberPaymentHx(CVars in, CVars &out) {
logfmt(logINFO, "WrenchReturnMemberPaymentHx()");
char vname[30];
long ret = PHP_API_BAD_PARAM;
try {
long limit = REQ_LONG(in, "limit", 1, -1);
long member_id = REQ_LONG(in, "member_id", 1, -1);
REQ_LONG(in, "page", 1, -1);
out["total_record"] = "0";
const PGresult *res;
res = pgsql_query("SELECT m.added::date AS trx_date,m.terminatingamount*0.01 AS amount,m.fee*0.01 as fee, m.id AS trx_id,"
" r.firstname||' '||r.lastname||'<br><b>Acc:</b>'||r.account_no||'-'||b.name AS recipient,mp.confirmation,"
" CASE WHEN m.status=1 THEN 'Pending' WHEN m.status=3 THEN 'Cancelled' WHEN m.status=5 THEN 'Completed' ELSE '' END AS status "
" FROM money_transfer m "
" LEFT JOIN sendmoney_recipient r ON r.id = m.recipientid "
" LEFT JOIN bank_entity_codes b ON b.code = r.bank_code "
" LEFT JOIN members_payments mp ON mp.what_sendmoney = m.id "
" WHERE m.member_id =%lu AND mp.confirmation IS NOT NULL ORDER BY m.id DESC LIMIT %lu", in["member_id"].Long(),limit);
if (res != NULL && pgsql_num_rows(res) > 0) {
out["total_record"] = pgsql_num_rows(res);
for (int i = 0, n = pgsql_num_rows(res); i < n; i++) {
map<const char*, const char*>f = pgsql_fetch_assoc(res, i);
if (f.empty()) continue;
CVars rec;
map_to_cvars(f, rec);
snprintf(vname, sizeof (vname), "trx_date_%05d", i);
out[vname] = rec["trx_date"];
snprintf(vname, sizeof (vname), "amount_%05d", i);
out[vname] = rec["amount"];
snprintf(vname, sizeof (vname), "fee_%05d", i);
out[vname] = rec["fee"];
snprintf(vname, sizeof (vname), "recipient_%05d", i);
out[vname] = rec["recipient"];
snprintf(vname, sizeof (vname), "confirmation_%05d", i);
out[vname] = rec["confirmation"];
snprintf(vname, sizeof (vname), "status_%05d", i);
out[vname] = rec["status"];
snprintf(vname, sizeof (vname), "trx_id_%05d", i);
out[vname] = rec["trx_id"];
}
}
ret = PHP_API_OK;
out["status"] = "OK";
} catch (bad_parameter) {
logfmt(logINFO, "ERROR CALL long WrenchReturnMemberPaymentHxcd .."
"(CVars in, CVars &out)");
}
logfmt(logINFO, "/WrenchReturnMemberPaymentHx()");
return ret;
}
long WrenchMemberJobsOffers(CVars in, CVars &out) {
logfmt(logINFO, "WrenchMemberJobsOffers()******************** @@ ");
char vname[30];
long ret = PHP_API_BAD_PARAM;
try {
long limit = REQ_LONG(in, "limit", 1, -1);
long member_id = REQ_LONG(in, "member_id", 1, -1);
REQ_LONG(in, "page", 1, -1);
out["total_record"] = "0";
const PGresult *res;
res = pgsql_query("SELECT jo.added::date,mj.title, mj.description AS description, jo.job_description,mj.price, mj.timeline_days "
"FROM members_jobs_offer jo LEFT JOIN members_jobs mj ON mj.id = jo.job_id "
"WHERE jo.expire > now() AND jo.status = 1 "
"AND jo.client_id = %lu LIMIT %lu ", in["member_id"].Long(), in["limit"].Long());
if (res != NULL && pgsql_num_rows(res) > 0) {
out["total_record"] = pgsql_num_rows(res);
for (int i = 0, n = pgsql_num_rows(res); i < n; i++) {
map<const char*, const char*>f = pgsql_fetch_assoc(res, i);
if (f.empty()) continue;
CVars rec;
map_to_cvars(f, rec);
snprintf(vname, sizeof (vname), "title_%05d", i);
out[vname] = rec["title"];
snprintf(vname, sizeof (vname), "project_%05d", i);
out[vname] = rec["project"];
snprintf(vname, sizeof (vname), "description_%05d", i);
out[vname] = rec["description"];
snprintf(vname, sizeof (vname), "status_description_%05d", i);
out[vname] = rec["status_description"];
snprintf(vname, sizeof (vname), "delivery_date_%05d", i);
out[vname] = rec["delivery_date"];
snprintf(vname, sizeof (vname), "status_description_%05d", i);
out[vname] = rec["status_description"];
snprintf(vname, sizeof (vname), "timeline_days_%05d", i);
out[vname] = rec["timeline_days"];
snprintf(vname, sizeof (vname), "contract_%05d", i);
out[vname] = rec["contract"];
snprintf(vname, sizeof (vname), "job_description_%05d", i);
out[vname] = rec["job_description"];
snprintf(vname, sizeof (vname), "price_%05d", i);
out[vname] = rec["price"];
snprintf(vname, sizeof (vname), "job_id_%05d", i);
out[vname] = rec["job_id"];
snprintf(vname, sizeof (vname), "contract_id_%05d", i);
out[vname] = rec["contract_id"];
}
}
ret = PHP_API_OK;
out["status"] = "OK";
} catch (bad_parameter) {
logfmt(logINFO, "ERROR CALL long WrenchMemberJobsOffers(CVars in, CVars &out)");
}
logfmt(logINFO, "/WrenchMemberJobsOffers()");
return ret;
}
long WrenchMemberActiveJobs(CVars in, CVars &out) {
logfmt(logINFO, "WrenchMemberActiveJobs()");
char vname[30];
long ret = PHP_API_BAD_PARAM;
try {
long limit = REQ_LONG(in, "limit", 1, -1);
long member_id = REQ_LONG(in, "member_id", 1, -1);
REQ_LONG(in, "page", 1, -1);
out["total_record"] = "0";
const PGresult *res;
res = pgsql_query("SELECT mc.id AS contract_id, mc.job_id AS job_id, mc.price, mc.timeline_days,mc.contract, "
" mj.title, mj.description AS description,mc.job_detail AS job_description, "
" (CASE WHEN mc.status=4 THEN 'Review' "
" WHEN mc.status = 1 AND mc.delivery_date > now() THEN 'Active' "
" WHEN mc.status = 1 AND mc.delivery_date <now() THEN 'Past Due' "
" ELSE 'Others' END) AS status_description,mc.delivery_date "
" FROM members_jobs_contract mc LEFT JOIN members_jobs mj ON mj.id = mc.job_id LEFT JOIN members m ON m.id=mc.client_id "
" WHERE mc.member_id = %lu AND mc.status IN (1,2,4) OR mc.client_id =%lu AND mc.status IN (1,2,4) ", in["member_id"].Long(), in["member_id"].Long());
if (res != NULL && pgsql_num_rows(res) > 0) {
out["total_record"] = pgsql_num_rows(res);
for (int i = 0, n = pgsql_num_rows(res); i < n; i++) {
map<const char*, const char*>f = pgsql_fetch_assoc(res, i);
if (f.empty()) continue;
CVars rec;
map_to_cvars(f, rec);
snprintf(vname, sizeof (vname), "title_%05d", i);
out[vname] = rec["title"];
snprintf(vname, sizeof (vname), "project_%05d", i);
out[vname] = rec["project"];
snprintf(vname, sizeof (vname), "description_%05d", i);
out[vname] = rec["description"];
snprintf(vname, sizeof (vname), "status_description_%05d", i);
out[vname] = rec["status_description"];
snprintf(vname, sizeof (vname), "delivery_date_%05d", i);
out[vname] = rec["delivery_date"];
snprintf(vname, sizeof (vname), "status_description_%05d", i);
out[vname] = rec["status_description"];
snprintf(vname, sizeof (vname), "timeline_days_%05d", i);
out[vname] = rec["timeline_days"];
snprintf(vname, sizeof (vname), "contract_%05d", i);
out[vname] = rec["contract"];
snprintf(vname, sizeof (vname), "job_description_%05d", i);
out[vname] = rec["job_description"];
snprintf(vname, sizeof (vname), "price_%05d", i);
out[vname] = rec["price"];
snprintf(vname, sizeof (vname), "job_id_%05d", i);
out[vname] = rec["job_id"];
snprintf(vname, sizeof (vname), "contract_id_%05d", i);
out[vname] = rec["contract_id"];
}
}
ret = PHP_API_OK;
out["status"] = "OK";
} catch (bad_parameter) {
logfmt(logINFO, "ERROR CALL long WrenchMemberActiveJobs(CVars in, CVars &out)");
}
logfmt(logINFO, "/WrenchMemberActiveJobs()");
return ret;
}
long WrenchReturnMemberMessages(CVars in, CVars &out) {
logfmt(logINFO, "WrenchReturnMemberMessages()");
char vname[30];
long ret = PHP_API_BAD_PARAM;
try {
long limit = REQ_LONG(in, "limit", 1, -1);
long member_id = REQ_LONG(in, "member_id", 1, -1);
REQ_LONG(in, "page", 1, -1);
OPTIONAL(in, "recent") REQ_LONG(in, "recent", 1, -1);
if ( in["recent"].Long() == 1 ){
snprintf(vname, sizeof (vname), " AND now() < mm.added + '24 hours' ");
}
else
{snprintf(vname, sizeof (vname), "' ");
}
out["total_record"] = "0";
const PGresult *res;
res = pgsql_query("SELECT mm.added::date AS msg_date,mm.msg,mm.id AS msg_id ,mm.senders_id , mm.msg_type, mm.memo,ms.firstname AS msg_from "
"FROM members_messages mm LEFT JOIN members ms ON ms.id =mm.senders_id "
"WHERE mm.member_id = %lu "
" %s AND mm.reply IS NULL ORDER BY mm.id DESC LIMIT %lu", in["member_id"].Long(),vname, limit);
if (res != NULL && pgsql_num_rows(res) > 0) {
out["total_record"] = pgsql_num_rows(res);
for (int i = 0, n = pgsql_num_rows(res); i < n; i++) {
map<const char*, const char*>f = pgsql_fetch_assoc(res, i);
if (f.empty()) continue;
CVars rec;
map_to_cvars(f, rec);
snprintf(vname, sizeof (vname), "msg_id_%05d", i);
out[vname] = rec["msg_id"];
snprintf(vname, sizeof (vname), "msg_date_%05d", i);
out[vname] = rec["msg_date"];
snprintf(vname, sizeof (vname), "msg_%05d", i);
out[vname] = rec["msg"];
snprintf(vname, sizeof (vname), "msg_from_%05d", i);
out[vname] = rec["msg_from"];
}
}
ret = PHP_API_OK;
out["status"] = "OK";
} catch (bad_parameter) {
logfmt(logINFO, "ERROR CALL long WrenchReturnMemberMessages(CVars in, CVars &out)");
}
logfmt(logINFO, "/WrenchReturnMemberMessages()");
return ret;
}
/* This return the list of jobs on the home page of the apps*/
long WrenchReturnJobList(CVars in, CVars &out) {
logfmt(logINFO, "WrenchReturnJobList()");
char vname[30];
long ret = PHP_API_BAD_PARAM;
try {
long limit = REQ_LONG(in, "limit", 1, -1);
REQ_LONG(in, "page", 1, -1);
out["total_record"] = "0";
const PGresult *res;
res = pgsql_query("SELECT j.title,j.description,m.id AS job_id,m.expire,m.job_description,j.price,m.offer_code,j.timeline_days, to_char(m.expire, 'Day Mon dd, yyyy HH:MI AM') AS expire2 "
"FROM members_jobs_offer m "
"LEFT JOIN members_jobs j ON j.id=m.job_id "
"WHERE m.status = 1 AND m.client_id=0 "
"AND m.expire IS NOT NULL "
"AND m.public_view = 1 AND m.expire> now() "
"ORDER BY m.expire DESC LIMIT %lu", in["limit"].Long());
if (res != NULL && pgsql_num_rows(res) > 0) {
out["total_record"] = pgsql_num_rows(res);
for (int i = 0, n = pgsql_num_rows(res); i < n; i++) {
map<const char*, const char*>f = pgsql_fetch_assoc(res, i);
if (f.empty()) continue;
CVars rec;
map_to_cvars(f, rec);
snprintf(vname, sizeof (vname), "title_%05d", i);
out[vname] = rec["title"];
snprintf(vname, sizeof (vname), "description_%05d", i);
out[vname] = rec["description"];
snprintf(vname, sizeof (vname), "job_description_%05d", i);
out[vname] = rec["job_description"];
snprintf(vname, sizeof (vname), "expire_%05d", i);
out[vname] = rec["expire2"];
snprintf(vname, sizeof (vname), "price_%05d", i);
out[vname] = rec["price"];
snprintf(vname, sizeof (vname), "offer_code_%05d", i);
out[vname] = rec["offer_code"];
snprintf(vname, sizeof (vname), "timeline_days_%05d", i);
out[vname] = rec["timeline_days"];
snprintf(vname, sizeof (vname), "id_%05d", i);
out[vname] = rec["job_id"];
}
}
ret = PHP_API_OK;
out["status"] = "OK";
} catch (bad_parameter) {
logfmt(logINFO, "ERROR CALL long medTrReasonList(CVars in, CVars &out)");
}
logfmt(logINFO, "/WrenchReturnJobList()");
return ret;
}
long CreateMobileWrenchBoardAccount(CVars in, CVars &out) {
long ret = PHP_API_BAD_PARAM;
try {
REQ_STRING(in, "username", 5, 49, "(.*)");
REQ_STRING(in, "firstname", 2, 49, "(.*)");
REQ_STRING(in, "lastname", 2, 49, "(.*)");
REQ_STRING(in, "email", 5, 49, "(.*)");
OPTIONAL(in, "phone") REQ_STRING(in, "phone", 3, 15, "(.*)");
OPTIONAL(in, "loc") REQ_STRING(in, "loc", 3, 15, "(.*)");
long news = REQ_LONG(in, "news", 1, -1);
long terms = REQ_LONG(in, "terms", 1, -1);
REQ_STRING(in, "password", 5, 25, "(.*)");
OPTIONAL(in, "country") REQ_STRING(in, "country", 1, 3, "(.*)");
//const char * loc = getenv('REMOTE_ADDR');
//in["loc"] = loc;
OPTIONAL(in, "mobile") REQ_STRING(in, "mobile", 3, 15, "(.*)");
// in["news"] = "1";
//in["news"].set_valid( true );
ret = CreateWrenchBoardAccountPending(in, out);
} catch (bad_parameter) {
out["status"] = "ERROR";
}
return ret;
}
long CompleteMobileAccountCreation(CVars in, CVars &out){
long ret = PHP_API_BAD_PARAM;
if ( CreateWrenchBoardAccount(in, out) > 0 )
{
ret = LoginWrenchBoardAccount(in, out);
}
return ret;
}
long CreateWrenchBoardAccount(CVars in, CVars &out) {
logfmt(logINFO, "CreateWrenchBoardAccount()");
long ret = PHP_API_BAD_PARAM;
REQ_STRING(in, "verify_link", 2, 120, "(.*)");
//REQ_STRING (in, "pass1", 3, 15, "(.*)");
OPTIONAL(in, "loc") REQ_STRING(in, "loc", 3, 15, "(.*)");
//const char * loc = getenv('REMOTE_ADDR');
//in["loc"] = loc;
try {
long lonkF = load_db_record(out, "SELECT *,id AS pending_id FROM members_pending WHERE verify_link ='%s' AND expire > now() LIMIT 1", in["verify_link"].c_str());
if (lonkF) {
out["status"] = "prepare to create account";
CVars x;
x["username"] = out["username"];
x["username"].set_valid(true);
x["firstname"] = out["firstname"];
x["firstname"].set_valid(true);
x["lastname"] = out["lastname"];
x["lastname"].set_valid(true);
x["email"] = out["email"];
x["email"].set_valid(true);
x["phone"] = out["phone"];
x["phone"].set_valid(true);
x["loc"] = out["loc"];
x["loc"].set_valid(true);
x["country"] = out["country"];
x["country"].set_valid(true);
x["password"] = out["password"];
x["password"].set_valid(true);
//pgsql_query("INSERT INTO members (firstname,lastname,email,phone,password,loc,news) SELECT(firstname,lastname,email,phone,password,loc,news) FROM members_pending WHERE id = %lu AND status = 1",out["pending_id"].Long() );
ret = insert_db_record(DBS_VALID, "members", "members_id_seq", x);
if (ret > 0) {
out["member_id"] = ret;
out["member_id"].set_valid(true);
x["member_id"] = ret;
x["member_id"].set_valid(true);
x["pending_id"] = out["pending_id"];
x["pending_id"].set_valid(true);
// - password already set pgsql_query("UPDATE members SET password = md5('%s') WHERE id = %lu",in["pass1"].c_str(),ret);
pgsql_query("UPDATE members_pending SET status = 5 WHERE id = %lu", out["pending_id"].Long());
pgsql_query("UPDATE members_refer_friend SET status = 5 WHERE status = 1 AND email = '%s'", x["email"].c_str());
WelcomeAccountMail(x);
SignupCompletedAlertMailfile(x);
}
}
} catch (bad_parameter) {
out["status"] = "ERROR";
}
logfmt(logINFO, "/CreateWrenchBoardAccount()");
return ret;
}
long CreateWrenchBoardAccountPending(CVars in, CVars &out) {
long ret = PHP_API_BAD_PARAM;
out = in;
/*
CREATE TABLE members_pending (
id SERIAL,
username VARCHAR(50) UNIQUE NOT NULL,
firstname VARCHAR(50),
lastname VARCHAR(50),
email VARCHAR(50),
phone VARCHAR(25),
password VARCHAR(100),
status integer DEFAULT 1,
added timestamp without time zone DEFAULT now(),
verify_link VARCHAR(100),
terms integer DEFAULT 0,
news integer DEFAULT 0,
expire timestamp without time zone DEFAULT now() +'30 days'
);
ALTER TABLE ONLY members_pending
ADD CONSTRAINT members_pending_id_key UNIQUE (id);
*/
REQ_STRING(in, "username", 5, 49, "(.*)");
REQ_STRING(in, "firstname", 2, 49, "(.*)");
REQ_STRING(in, "lastname", 2, 49, "(.*)");
REQ_STRING(in, "email", 5, 49, "(.*)");
OPTIONAL(in, "phone") REQ_STRING(in, "phone", 3, 15, "(.*)");
OPTIONAL(in, "loc") REQ_STRING(in, "loc", 3, 15, "(.*)");
long news = REQ_LONG(in, "news", 1, -1);
long terms = REQ_LONG(in, "terms", 1, -1);
REQ_STRING(in, "password", 5, 25, "(.*)");
OPTIONAL(in, "country") REQ_STRING(in, "country", 1, 3, "(.*)");
//const char * loc = getenv('REMOTE_ADDR');
//in["loc"] = loc;
OPTIONAL(in, "mobile") REQ_STRING(in, "mobile", 3, 15, "(.*)");
int r1, r2, r3,signup_random;
char verify_link[100];
srand(time(NULL));
r1 = abs(rand()*100);
srand(time(NULL));
r2 = abs(rand() * r1);
srand(time(NULL));
r3 = abs(rand() * r2);
srand(time(NULL));
signup_random = abs(rand()*0.009);
sprintf(verify_link, "WRENCHB-%09lu-%08lu-%08lu", r1, r2, r3);
CVars x;
x["username"] = in["username"];
x["username"].set_valid(true);
x["firstname"] = in["firstname"];
x["firstname"].set_valid(true);
x["lastname"] = in["lastname"];
x["lastname"].set_valid(true);
x["email"] = in["email"];
x["email"].set_valid(true);
x["phone"] = in["phone"];
x["phone"].set_valid(true);
x["country"] = in["country"];
x["country"].set_valid(true);
if (in["loc"].length() > 0) x["loc"] = in["loc"];
x["loc"].set_valid(true);
x["verify_link"] = verify_link;
x["verify_link"].set_valid(true);
x["news"] = in["news"];
x["news"].set_valid(true);
x["terms"] = in["terms"];
x["terms"].set_valid(true);
ret = insert_db_record(DBS_VALID, "members_pending", "members_pending_id_seq", x);
if (ret > 0) {
pgsql_query("UPDATE members_pending SET password = md5('%s'),signup_random=%lu WHERE id = %lu", in["password"].c_str(),signup_random/1000, ret);
pgsql_query("UPDATE members_refer_friend SET status = 5 WHERE status = 1 AND email = '%s'", x["email"].c_str());
load_db_record(out, "SELECT *,id AS pending_id FROM members_pending WHERE id=%lu LIMIT 1", ret);
}
if (ret > 0) {
out["pending_id"] = ret;
out["pending_id"].set_valid(true);
x["pending_id"] = ret;
x["pending_id"].set_valid(true);
if (in["mobile"] != "" && in["mobile"] == "MOBILE") {
//ALTER TABLE members_pending ADD signup_random INT;
x["mobile_email"] = "100"; x["mobile_email"].set_valid( true );
AccountPendingMail(x);
} else {
AccountPendingMail(x);
}
SignupPendingAlertMailfile(x);
}
return ret;
}
//******************************************************************************
+146
View File
@@ -0,0 +1,146 @@
// Topup management toosl
#include "clog.h"
#include "cgi.h"
#include "input.h"
#include "wrenchboard_api.h"
#include "bko.h"
#include "account.h"
#include "email.h"
#include "safestring.h"
#include <string>
#include "pgsql.h"
#include "pgsql_wrapper.h"
#include <curl/curl.h>
#include "account.h"
long BkoCommonSessionCheck(long backoffice_id,long shop,long acc, const char *sessionid, int create );
long bko_calls(CVars in, CVars &out)
{
logfmt( logINFO, "bko_calls()" );
out["result"] = "YES I GET TO BACK END";
long action = REQ_LONG( in, "action", 0, -1);
switch( action )
{
case WRENCHBOARD_BKO_LOGIN:
return LoginBkoAdmin( in, out);
break;
}
logfmt( logINFO, "/bko_calls()" );
return 0;
}
long LoginBkoAdmin(CVars in, CVars &out)
{
long ret = PHP_API_BAD_PARAM;
logfmt( logINFO, "LoginBkoAdmin()" );
REQ_STRING (in, "username", 5, 49, "(.*)");
REQ_STRING (in, "password", 5, 49, "(.*)");
//REQ_STRING (in, "sessionid", 4, 40, "(.*)");
const char * loc = getenv("REMOTE_ADDR");
load_db_record( out, "SELECT md5( md5('now()')||'%d' ) AS sessionid",rand()*10000);
in["sessionid"] = out["sessionid"]; in["sessionid"].set_valid( true );
ret = load_db_record( out, "SELECT *,id AS backoffice_id FROM backoffice WHERE status=1 AND LOWER(username)=LOWER('%s') AND pass= md5('%s')", in["username"].c_str(), in["password"].c_str() );
if (ret>0) {
if (BkoCommonSessionCheck(out["id"].Long(),0,0, in["sessionid"].c_str(), 1)>0) {
out["stauts"] = "OK";
ret = PHP_API_OK;
} else {
out["status"] = "Session check failed";
}
} else {
out["status"] = "Invalid username and/or password";
}
logfmt( logINFO, "/LoginBkoAdmin()" );
return ret;
}
long BkoCommonSessionCheck(long backoffice_id,long shop,long acc, const char *sessionid, int create )
{
logfmt( logINFO, "long BkoCommonSessionCheck(long backoffice_id,long shop, const char *sessionid, int create )" );
// Sanity check
if (backoffice_id<1 || sessionid==NULL || strlen(sessionid)<4) {
return -1L; // Invalif parameters
}
char ptid[30];
if ( shop > 0 )
{
sprintf( ptid, " AND shop=%lu ", shop );
}
else
{
sprintf( ptid, " " ); // just empty space
}
// Clean old sessions
if (create>0)
{ pgsql_exec("DELETE FROM backoffice_session WHERE backoffice_id=%ld %s ", backoffice_id,ptid); }
else
{ pgsql_exec("DELETE FROM backoffice_session WHERE backoffice_id=%ld %s AND updated < (now() - interval '15 minutes')", backoffice_id,ptid); }
if (create==0 && pgsql_exec("UPDATE backoffice_session SET updated=NOW() WHERE backoffice_id=%ld %s AND sessionid='%s'", backoffice_id,ptid, sessionid)>0) {
return 1L; // Session updated
}
if (create>0) {
// Check session i?
/*
const PGresult *res = pgsql_query("SELECT * FROM backoffice_session WHERE backoffice_id=%ld %s AND sessionid<>'%s'", backoffice_id,ptid, sessionid);
if (res!=NULL && pgsql_num_rows(res)>0) {
return -2L; // Active sessions found
}
*/
CVars sess; // Do we have the same session already?
if (load_db_record( sess, "SELECT * FROM backoffice_session WHERE backoffice_id=%lu %s AND sessionid='%s'", backoffice_id,ptid, sessionid)>0) {
pgsql_exec("UPDATE backoffice_session SET updated=NOW() WHERE backoffice_id=%ld %s AND sessionid='%s'", backoffice_id,ptid, sessionid);
return sess["id"].Long();
}
// Create a new session
sess["backoffice_id"] = backoffice_id; sess["backoffice_id"].set_valid(true);
sess["sessionid"] = sessionid; sess["sessionid"].set_valid(true);
const char * loc = getenv("REMOTE_ADDR");
sess["loc"] = loc; sess["loc"].set_valid(true);
if ( shop > 0 )
{
sess["shop"] = shop; sess["shop"].set_valid(true);
}
if ( acc > 0 )
{
sess["account"] = acc; sess["account"].set_valid(true);
}
long sid = insert_db_record( DBS_VALID, "backoffice_session", "backoffice_session_id_seq", sess );
if (sid>0) {
return sid; // New session created
}
return -3L; // Failed to create new session
}
logfmt( logINFO, "/long BkoCommonSessionCheck(long backoffice_id,long shop, const char *sessionid, int create )" );
return 0L; // No route
}
/*
CREATE TABLE backoffice_session (
id SERIAL,
backoffice_id INT REFERENCES managers(id),
shop INT DEFAULT 0,
sessionid varchar(100) NOT NULL,
added timestamp without time zone DEFAULT now(),
updated timestamp without time zone DEFAULT now(),
status integer DEFAULT 1,
loc INET
);
*/
+289
View File
@@ -0,0 +1,289 @@
// Account management toosl
#include "clog.h"
#include "cgi.h"
#include "input.h"
#include "wrenchboard_api.h"
#include "contract.h"
#include "email.h"
#include "payments.h"
#include "safestring.h"
#include <string>
#include "pgsql.h"
#include "pgsql_wrapper.h"
#include "cfg.h"
#include <curl/curl.h>
long contract_calls(CVars in, CVars &out)
{
logfmt( logINFO, "contract_calls()" );
out["result"] = "YES I GET TO BACK END";
long action = REQ_LONG( in, "action", 0, -1);
switch( action )
{
case WRENCHBOARD_CONTRACT_MESSAGE:
return WrenchContractMessage( in, out);
break;
case WRENCHBOARD_CONTRACT_STATUS:
return WrenchContractStatus( in, out);
break;
}
logfmt( logINFO, "/contract_calls()" );
return 0;
}
long WrenchContractStatus( CVars in, CVars &out )
{
long ret = 0;
logfmt( logINFO, "WrenchContractStatus()" );
REQ_LONG( in, "member_id", 1, -1 );
REQ_STRING (in, "job_contract", 7, 25, "(.*)");
REQ_LONG( in, "job_id", 1, -1 );
long job_action = REQ_LONG( in, "job_action", 1, -1 );
out["result"] = "Yes i go to this back end";
long extension = 0;
in["contract_id"] = in["job_id"]; in["contract_id"].set_valid( true ); // the email system uses contract_id
switch( job_action )
{
case CONTRACT_NOTIFY_COMPLETE:
ret = load_db_record( out, "SELECT * FROM members_jobs_contract WHERE status IN (1,2) AND contract='%s' AND id=%lu AND client_id =%lu",in["job_contract"].c_str(),in["job_id"].Long(),in["member_id"].Long() );
logfmt( logINFO, "~~~~ ~~~~~ WrenchContractStatus() ret 1 = %lu",ret );
if (ret)
{
pgsql_exec("UPDATE members_jobs_contract SET status = %lu,updated=now() WHERE id = %lu",CONTRACT_NOTIFY_COMPLETE, in["job_id"].Long() );
if ( load_db_record( out, "SELECT * FROM members_jobs_contract WHERE status = %lu AND id=%lu AND client_id =%lu",CONTRACT_NOTIFY_COMPLETE,in["job_id"].Long(),in["member_id"].Long() ) )
{
project_email(CONTRACT_NOTIFY_COMPLETE, in, out);
out["result"] = "We have notify the task owner of your completion. Expect a response soon";
}
}
break;
case CONTRACT_REQUEST_CANCEL:
ret = load_db_record( out, "SELECT * FROM members_jobs_contract WHERE status IN (1,2) AND contract='%s' AND id=%lu AND client_id =%lu",in["job_contract"].c_str(),in["job_id"].Long(),in["member_id"].Long() );
logfmt( logINFO, "~~~~ ~~~~~ WrenchContractStatus() ret 1 = %lu",ret );
if (ret)
{
pgsql_exec("UPDATE members_jobs_contract SET status = %lu,updated=now() WHERE id = %lu",CONTRACT_REQUEST_CANCEL, in["job_id"].Long() );
if ( load_db_record( out, "SELECT * FROM members_jobs_contract WHERE status = %lu AND id=%lu AND client_id =%lu",CONTRACT_REQUEST_CANCEL,in["job_id"].Long(),in["member_id"].Long() ) )
{
project_email(CONTRACT_REQUEST_CANCEL, in, out);
out["result"] = "We have notify the task owner of your request for cancellation.";
}
}
break;
case CONTRACT_ACCEPT_COMPLETE:
ret = load_db_record( out, "SELECT * FROM members_jobs_contract WHERE status = %lu AND contract='%s' AND id=%lu AND member_id =%lu",CONTRACT_NOTIFY_COMPLETE,in["job_contract"].c_str(),in["job_id"].Long(),in["member_id"].Long() );
logfmt( logINFO, "~~~~ ~~~~~ WrenchContractStatus() ret 1 = %lu",ret );
if (ret)
{
pgsql_exec("UPDATE members_jobs_contract SET status = %lu,updated=now() WHERE id = %lu",CONTRACT_ACCEPT_COMPLETE, in["job_id"].Long() );
// make sure the update was done
if ( load_db_record( out, "SELECT * FROM members_jobs_contract WHERE status = %lu AND id=%lu AND member_id =%lu",CONTRACT_ACCEPT_COMPLETE,in["job_id"].Long(),in["member_id"].Long() ) )
{
//let us do the accounting parts here now
CVars y;
y["member_id"] = in["member_id"]; // note we are actually paying the client_id
y["contract_id"] = in["job_id"];
y["code"] = "COPAY";
y["dir"] = DIR_TARGET;
if ( WrenchContractPayment(y,out) == PHP_CREATED_OK )
{ // if you reserve pauments
//char offer_code[15] = "";
//GetOfferCode(offer_id, offer_code, sizeof (offer_code)); // this stamp the offer code directly in that call
pgsql_exec("UPDATE members_jobs_contract SET updated = now(),payment_date=now() WHERE id = %lu",out["job_id"].Long());
}
else
{
}
//----------------------------------------
project_email(CONTRACT_ACCEPT_COMPLETE, in, out); //USES in["contract_id"]
out["result"] = "This task is now complete. We have notified all parties accordingly";
}
}
break;
case CONTRACT_REJECT_COMPLETE:
ret = load_db_record( out, "SELECT * FROM members_jobs_contract WHERE status = %lu AND contract='%s' AND id=%lu AND member_id =%lu",CONTRACT_NOTIFY_COMPLETE,in["job_contract"].c_str(),in["job_id"].Long(),in["member_id"].Long() );
logfmt( logINFO, "~~~~ ~~~~~ WrenchContractStatus() ret 1 = %lu",ret );
if (ret)
{
pgsql_exec("UPDATE members_jobs_contract SET status = %lu,updated=now() WHERE id = %lu",CONTRACT_REJECT_COMPLETE, in["job_id"].Long() );
// make sure the update was done
if ( load_db_record( out, "SELECT * FROM members_jobs_contract WHERE status = %lu AND id=%lu AND member_id =%lu",CONTRACT_REJECT_COMPLETE,in["job_id"].Long(),in["member_id"].Long() ) )
{
project_email(CONTRACT_REJECT_COMPLETE, in, out);
out["result"] = "You have rejected that this task is complete. We have notified all parties accordingly";
}
}
break;
case CONTRACT_EXTEND_TIMELINE:
out["result"] = "CONTRACT_EXTEND_TIMELINE";
extension = REQ_LONG( in, "extension", 1, -1 );
ret = load_db_record( out, "SELECT * FROM members_jobs_contract WHERE status IN (1,2) AND contract='%s' AND id=%lu AND member_id =%lu AND delivery_date < now()",in["job_contract"].c_str(),in["job_id"].Long(),in["member_id"].Long() );
logfmt( logINFO, "~~~~ ~~~~~ WrenchContractStatus() ret 1 = %lu",ret );
if (ret)
{
pgsql_exec("UPDATE members_jobs_contract SET due_remind = NULL, delivery_date = now() +'%lu days' WHERE status IN (1,2) AND id = %lu AND contract='%s'",extension, in["job_id"].Long() ,in["job_contract"].c_str());
// make sure the update was done
if ( load_db_record( out, "SELECT * FROM members_jobs_contract WHERE id=%lu AND member_id =%lu AND delivery_date > now()",in["job_id"].Long(),in["member_id"].Long() ) )
{
project_email(CONTRACT_EXTEND_TIMELINE, in, out);
out["result"] = "We have extended the timeline as requested";
}
}
break;
case CONTRACT_CANCEL_CONTRACT:
out["result"] = "CONTRACT_CANCEL_CONTRACT";
ret = load_db_record( out, "SELECT * FROM members_jobs_contract WHERE status IN (1,2) AND delivery_date < now() AND contract='%s' AND id=%lu AND member_id =%lu",in["job_contract"].c_str(),in["job_id"].Long(),in["member_id"].Long() );
if (ret)
{
pgsql_exec("UPDATE members_jobs_contract SET status = %lu,updated=now() WHERE id = %lu",CONTRACT_CANCEL_CONTRACT, in["job_id"].Long() );
// make sure the update was done
if ( load_db_record( out, "SELECT * FROM members_jobs_contract WHERE status = %lu AND id=%lu AND member_id =%lu",CONTRACT_CANCEL_CONTRACT,in["job_id"].Long(),in["member_id"].Long() ) )
{
//let us do the accounting parts here now
CVars y;
y["member_id"] = in["member_id"]; // note we are actually paying the client_id
y["contract_id"] = in["job_id"];
y["code"] = "COCNL";
y["dir"] = DIR_TARGET;
y["job_status"] = CONTRACT_CANCEL_CONTRACT;
if ( WrenchCanceContractPayment(y,out) == PHP_CREATED_OK )
{ // if you reserve pauments
//char offer_code[15] = "";
//GetOfferCode(offer_id, offer_code, sizeof (offer_code)); // this stamp the offer code directly in that call
pgsql_exec("UPDATE members_jobs_contract SET updated = now(),payment_date=now() WHERE id = %lu",out["job_id"].Long());
}
else
{
}
//----------------------------------------
project_email(CONTRACT_CANCEL_CONTRACT, in, out); //USES in["contract_id"]
out["result"] = "This task is now complete. We have notified all parties accordingly";
}
}
break;
}
//$mysql = "SELECT * FROM members_jobs_contract WHERE contract ='" . $data['job_contract'] . "' AND id =" . $data['job_id'];
/*
Array ( [member_id] => 3 [proc] => ACCEPTCMP [job_id] => 13 [job_contract] => 7BW9B9R8BB [job_action] => 5 )
#define CONTRACT_NOTIFY_COMPLETE 4
#define CONTRACT_REQUEST_CANCEL 3
#define CONTRACT_ACCEPT_COMPLETE 5
#define CONTRACT_REJECT_COMPLETE 1
*/
logfmt( logINFO, "/WrenchContractStatus()" );
return 0;
}
long WrenchContractMessage( CVars in, CVars &out )
{
out["message_sent"] = "0";
/*
--- // note thet we did not refrenece members table - this is to ensure that the system can insert items too into the disucssion
CREATE TABLE jobs_contract_message (
id SERIAL,
member_id INT,
contract VARCHAR(25) REFERENCES members_jobs_contract(contract),
msg_type VARCHAR(5) NOT NULL,
message TEXT,
status INT DEFAULT 1,
created timestamp without time zone DEFAULT now()
);
$msgArray = array();
$msgArray['message'] = trim($this->input->post('jobmessage'));
$msgArray['contract'] = $this->input->post('contractId');
$msgArray['msg_type'] = 'TEXT';
$msgArray['member_id'] = $_SESSION['member_id']; // = $ret->email;
*/
long ret = PHP_API_BAD_PARAM;
logfmt( logINFO, "WrenchContractMessage()" );
ULONG message_id = 0;
REQ_LONG( in, "member_id", 1, -1 );
REQ_STRING (in, "contract", 10, 25, "(.*)");
REQ_STRING (in, "msg_type", 1, 5, "(.*)");
REQ_STRING (in, "message", 1, 1299, "(.*)");
const char * loc = getenv("REMOTE_ADDR");
in["loc"] = loc; in["loc"].set_valid(true);
CVars x;
x["member_id"] = in["member_id"]; x["member_id"].set_valid( true );
x["contract"] = in["contract"]; x["contract"].set_valid( true );
x["msg_type"] = in["msg_type"]; x["msg_type"].set_valid( true );
x["message"] = in["message"]; x["message"].set_valid( true );
message_id = insert_db_record( DBS_VALID, "jobs_contract_message", "jobs_contract_message_id_seq", x );
if (message_id) {
ret = PHP_CREATED_OK;
x["message_id"] = message_id; x["message_id"].set_valid( true );
job_email(JOBS_MESSAGE_ADDED,x,out);
load_db_record( out, "SELECT *,id AS message_id FROM jobs_contract_message WHERE id = %lu ", message_id );
out["status"] = "Message Sent";
out["message_sent"] = "200";
} else {
out["status"] = "Unable to send message";
}
logfmt( logINFO, "/WrenchContractMessage()" );
return ret;
}
long WrenchEditJobs33( CVars in, CVars &out )
{
long ret = PHP_API_BAD_PARAM;
logfmt( logINFO, "LoginWrenchBoardAccount()" );
REQ_STRING (in, "username", 5, 49, "(.*)");
REQ_STRING (in, "password", 5, 49, "(.*)");
REQ_STRING (in, "sessionid", 4, 40, "(.*)");
OPTIONAL( in, "loc" ) REQ_STRING (in, "loc", 3, 15, "(.*)");
const char * loc = getenv("REMOTE_ADDR");
in["loc"] = loc; in["loc"].set_valid(true);
ret = load_db_record( out, "SELECT *,id AS member_id FROM members WHERE status=1 AND LOWER(username)=LOWER('%s') AND password= md5('%s')", in["username"].c_str(), in["password"].c_str() );
if (ret) {
} else {
out["status"] = "Invalid username and/or password";
}
logfmt( logINFO, "/LoginWrenchBoardAccount()" );
return ret;
}
//******************************************************************************
@@ -0,0 +1,76 @@
// Topup management toosl
#include "clog.h"
#include "cgi.h"
#include "input.h"
#include "wrenchboard_api.h"
#include "safestring.h"
#include <string>
#include "pgsql.h"
#include "pgsql_wrapper.h"
#include <curl/curl.h>
/* -- */
//#include "function_members.h"
#include "creditcards.h"
#include "stripe_charge.h"
/*****************************************************************************/
long save_creditcard(CVars in, CVars &out) {
logfmt(FLOG_MAX, "long save_creditcard(CVars in, CVars &out)" );
long card_id = 0;
try {
CVars v;
REQ_LONG(in, "member_id", 1, -1); // Does not make any sence without member persitence
REQ_STRING(in, "cardnumber", 12, 16, "(.*)"); //4111111111111111"
REQ_STRING(in, "cvc", 3, 4, "(.*)"); //234"
REQ_LONG(in, "paymenttype", 0, -1);
REQ_STRING(in, "exp_month", 2, 2, "(.*)");
REQ_STRING(in, "exp_year", 4, 4, "(.*)");
if ( load_db_record( v, "SELECT a.id AS member_id,a.firstname,a.lastname,'' AS street1,'' AS street2,a.city,'' AS postal,a.state,a.country FROM members a WHERE a.id=%lu", in["member_id"].Long()) > 0) {
logfmt(logDEBUG, "Loaded member %s %s", v["firstname"].c_str(), v["lastname"].c_str());
v["member_id"].set_valid(true);
v["firstname"].set_valid(true);
v["lastname"].set_valid(true);
v["street1"].set_valid(true);
v["street2"].set_valid(true);
v["city"].set_valid(true);
v["state"].set_valid(true);
v["postal"].set_valid(true);
v["country"].set_valid(true);
v["type"] = in["paymenttype"];
v["type"].set_valid(true);
v["card"] = in["cardnumber"]; /* could be dirty */
v["cvv2"] = in["cvc"]; /* we are not saving it */
v["digits"] = in["cardnumber"].substr(in["cardnumber"].length() - 4, 4);
v["digits"].set_valid(true);
v["description"] = in["description"];
v["description"].set_valid(true);
v["expiration_month"] = in["exp_month"];
v["expiration_month"].set_valid(true);
v["expiration_year"] = in["exp_year"];
v["expiration_year"].set_valid(true);
logfmt(logDEBUG, "About to call stripe: ");
card_id = stripe_save_card(v, out);
logfmt(logDEBUG, "...stripe call complete!");
} else {
logfmt(FLOG_MAX, "No member data loaded!" );
throw bad_parameter( in, "member_id" );
}
} catch (bad_parameter) {
card_id = PHP_API_BAD_PARAM;
}
logfmt(FLOG_MAX, "/long save_creditcard(CVars in, CVars &out)" );
return card_id;
}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+130
View File
@@ -0,0 +1,130 @@
// Account management toosl
#include "clog.h"
#include "cgi.h"
#include "input.h"
#include "wrenchboard_api.h"
#include "groups.h"
#include "email.h"
#include "safestring.h"
#include <string>
#include "pgsql.h"
#include "pgsql_wrapper.h"
#include "cfg.h"
#include <curl/curl.h>
long groups_calls(CVars in, CVars &out)
{
logfmt( logINFO, "groups_calls()" );
out["result"] = "YES I GET TO BACK END";
long action = REQ_LONG( in, "action", 0, -1);
switch( action )
{
case WRENCHBOARD_GROUP_ACCEPTGROUP:
//return LoginWrenchBoardAccount( in, out);
break;
case WRENCHBOARD_GROUP_INVITEGROUP:
//return CreateWrenchBoardAccountPending(in, out);
break;
case WRENCHBOARD_GROUP_CREATEGROUP:
return CreateWrenchBoardGroup( in, out);
break;
}
logfmt( logINFO, "/groups_calls()" );
return 0;
}
long CreateWrenchBoardGroup(CVars in, CVars &out)
{
long ret = PHP_API_BAD_PARAM;
out =in;
REQ_STRING (in, "group_name", 5, 99, "(.*)");
OPTIONAL( in, "description" ) REQ_STRING (in, "description", 1, 249, "(.*)");
REQ_LONG( in, "contribute", 1, -1 );
REQ_LONG( in, "member_id", 1, -1 );
OPTIONAL( in, "loc" ) REQ_STRING (in, "loc", 3, 15, "(.*)");
CVars x;
x["group_name"] = in["group_name"]; x["group_name"].set_valid( true );
x["description"] = in["description"]; x["description"].set_valid( true );
x["invite"] = "1"; x["invite"].set_valid( true );
x["member_id"] = in["member_id"]; x["member_id"].set_valid( true );
x["loc"] = in["loc"]; x["loc"].set_valid( true );
ret = insert_db_record( DBS_VALID, "members_groups", "members_groups_id_seq", x );
if ( ret > 0 )
{
if ( in["contribute"].Long() > 0 )
{
pgsql_exec("UPDATE members_groups SET contribute=NOW() WHERE id=%lu ", ret);
}
out["group_id"] = ret; out["group_id"].set_valid( true );
x["group_id"] = ret; x["group_id"].set_valid( true );
CVars y;
y["member_id"] = in["member_id"]; y["member_id"].set_valid( true );
y["admin_status"] = in["member_id"]; y["admin_status"].set_valid( true );
y["group_id"] = out["group_id"]; y["group_id"].set_valid( true );
y["loc"] = in["loc"]; y["loc"].set_valid( true );
//ALTER TABLE group_members ADD admin_status INT REFERENCES members(id);
WrenchBoardGroupCreateMember(y,out);
CreateWrenchBoardGroupMail(y);
}
return ret;
}
long WrenchBoardGroupCreateMember(CVars in, CVars &out)
{
long ret = PHP_API_BAD_PARAM;
out =in;
REQ_LONG( in, "member_id", 1, -1 );
REQ_LONG( in, "group_id", 1, -1 );
OPTIONAL( in, "loc" ) REQ_STRING (in, "loc", 3, 15, "(.*)");
CVars x;
x["group_id"] = in["group_id"]; x["group_id"].set_valid( true );
x["member_id"] = in["member_id"]; x["member_id"].set_valid( true );
x["loc"] = in["loc"]; x["loc"].set_valid( true );
if (in["admin_status"].Long() > 0)
{
x["admin_status"] = in["admin_status"]; x["admin_status"].set_valid( true );
}
ret = insert_db_record( DBS_VALID, "group_members", "group_members_id_seq", x );
if ( ret > 0 )
{ out["group_member_id"] = ret; out["group_member_id"].set_valid( true );
x["group_member_id"] = ret; x["group_member_id"].set_valid( true );
GroupCreateMemberMail(x);
pgsql_exec("UPDATE members_groups SET accepted = (SELECT count(*) FROM group_members WHERE group_id = %lu ) WHERE id=%lu",x["group_id"].Long(),x["group_id"].Long() );
}
return ret;
}
//******************************************************************************
/*
CREATE TABLE group_members (
id SERIAL,
member_id INT REFERENCES members(id),
group_name VARCHAR(100) UNIQUE NOT NULL,
description VARCHAR(250),
added timestamp without time zone DEFAULT now(),
balance integer DEFAULT 0,
contribute timestamp without time zone,
alert integer DEFAULT 0,
status integer DEFAULT 1,
invite integer DEFAULT 0,
accepted integer DEFAULT 0,
rejected integer DEFAULT 0,
loc INET
);
ALTER TABLE ONLY members_groups
ADD CONSTRAINT members_groups_id_key UNIQUE (id);
*/
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+211
View File
@@ -0,0 +1,211 @@
// Topup management toosl
#include "clog.h"
#include "cgi.h"
#include "input.h"
#include "wrenchboard_api.h"
#include "login.h"
#include "account.h"
#include "email.h"
#include "safestring.h"
#include <string>
#include "pgsql.h"
#include "pgsql_wrapper.h"
#include <curl/curl.h>
#include "account.h"
long LoginAdmin(CVars in, CVars &out)
{
long ret = PHP_API_BAD_PARAM;
logfmt( logINFO, "LoginWrenchBoardAccount()" );
REQ_STRING (in, "username", 5, 49, "(.*)");
REQ_STRING (in, "password", 5, 49, "(.*)");
REQ_STRING (in, "sessionid", 4, 40, "(.*)");
OPTIONAL( in, "loc" ) REQ_STRING (in, "loc", 3, 15, "(.*)");
ret = load_db_record( out, "SELECT *,id AS member_id FROM members WHERE status=1 AND LOWER(username)=LOWER('%s') AND password= md5('%s')", in["username"].c_str(), in["password"].c_str() );
if (ret) {
if (CommonSessionCheck(out["id"].Long(),0,0, in["sessionid"].c_str(), 1)>0) {
out["stauts"] = "OK";
ret = PHP_API_OK;
} else {
out["status"] = "Session check failed";
}
} else {
out["status"] = "Invalid username and/or password";
}
logfmt( logINFO, "/LoginWrenchBoardAccount()" );
return ret;
}
long LoginManager(CVars in, CVars &out)
{
long ret = PHP_API_BAD_PARAM;
logfmt( logINFO, "LoginManager()" );
REQ_STRING (in, "username", 5, 49, "(.*)");
REQ_STRING (in, "password", 5, 49, "(.*)");
REQ_STRING (in, "sessionid", 4, 50, "(.*)");
OPTIONAL( in, "loc" ) REQ_STRING (in, "loc", 3, 15, "(.*)");
ret = load_db_record( out, "SELECT *,id AS member_id FROM managers_account WHERE status=1 AND LOWER(username)=LOWER('%s') AND password= md5('%s')", in["username"].c_str(), in["password"].c_str() );
if (ret) {
if (CommonSessionCheck(out["managers_id"].Long(),0,out["member_id"].Long(), in["sessionid"].c_str(), 1)>0) {
out["login_status"] = "OK";
out["sessionid"] = in["sessionid"]; out["sessionid"].set_valid(true);
out["manager_session"] = in["sessionid"]; out["manager_session"].set_valid(true);
load_db_record( out, "SELECT product_name FROM managers WHERE id = %lu ", out["managers_id"].Long() );
char log_msg[149];
sprintf( log_msg, "Admin Access By %s %s", out["firstname"].c_str(),out["lastname"].c_str() );
in["managers_id"] = out["managers_id"];
in["log_msg"] = log_msg;
// in["loc"] = ALredy in the IN
LogManagerAction(in, out);
ret = PHP_API_OK;
} else {
out["status"] = "Session check failed";
}
} else {
out["status"] = "Invalid username and/or password";
}
logfmt( logINFO, "/LoginManager()" );
return ret;
}
long LoginShop(CVars in, CVars &out)
{
long ret = PHP_API_BAD_PARAM;
logfmt( logINFO, "LoginShop()" );
REQ_STRING (in, "username", 5, 49, "(.*)");
REQ_STRING (in, "password", 5, 49, "(.*)");
REQ_STRING (in, "sessionid", 4, 40, "(.*)");
OPTIONAL( in, "loc" ) REQ_STRING (in, "loc", 3, 15, "(.*)");
ret = load_db_record( out, "SELECT *,id AS managers_shop_id FROM managers_shops WHERE status=1 AND LOWER(username)=LOWER('%s') AND password= md5('%s')", in["username"].c_str(), in["password"].c_str() );
if (ret) {
if (CommonSessionCheck(out["managers_id"].Long(),out["managers_shop_id"].Long(),0, in["sessionid"].c_str(), 1)>0) {
out["login_status"] = "OK";
out["sessionid"] = in["sessionid"]; out["sessionid"].set_valid(true);
/*
wrenchboard_test=> select * from managers_survey;
id | managers_id | survey | added | start_date | end_date | status | loc
----+-------------+---------------------------------------------+---------------------------+---------------------------+---------------------------+--------+-----
1 | 1 | Are you satisfied with your service today? | 2015-06-24 20:49:48.36751 | 2015-06-24 20:49:48.36751 | 2015-09-22 20:49:48.36751 | 1 |
(1 row)
*/
load_db_record( out, "SELECT id AS survey_id,survey,template FROM managers_survey WHERE managers_id = %lu ORDER BY id DESC LIMIT 1", out["managers_id"].Long() );
/*
wrenchboard_test=> select * from managers;
id | csr_id | product_name | firstname | lastname | email | status | added | loc
----+--------+------------------+-------------+------------+----------------------------+--------+----------------------------+----------------
1 | 1 | Sample Test bank | MyFirstName | MyLastName | ses66181+wrenchboard@gmail.com | 1 | 2015-06-23 14:19:18.882625 | 38.101.241.140
(1 row)
*/
load_db_record( out, "SELECT product_name FROM managers WHERE id = %lu ", out["managers_id"].Long() );
char log_msg[149];
sprintf( log_msg, "Location Access at %s By %s", out["shop_id"].c_str(), out["username"].c_str());
in["managers_id"] = out["managers_id"];
in["log_msg"] = log_msg;
// in["loc"] = ALredy in the IN
LogManagerAction(in, out);
ret = PHP_API_OK;
} else {
out["status"] = "Session check failed";
}
} else {
out["status"] = "Invalid username and/or password";
}
out["ret"] = ret;
logfmt( logINFO, "/LoginShop()" );
return ret;
}
long CommonSessionCheck(long managers_id,long shop,long acc, const char *sessionid, int create )
{
logfmt( logINFO, "long CommonSessionCheck(long managers_id,long shop, const char *sessionid, int create )" );
// Sanity check
if (managers_id<1 || sessionid==NULL || strlen(sessionid)<4) {
return -1L; // Invalif parameters
}
char ptid[30];
if ( shop > 0 )
{
sprintf( ptid, " AND shop=%lu ", shop );
}
else
{
sprintf( ptid, " " ); // just empty space
}
// Clean old sessions
if (create>0)
{ if ( shop > 0 ) pgsql_exec("DELETE FROM managers_session WHERE managers_id=%ld %s ", managers_id,ptid); }
else
{ pgsql_exec("DELETE FROM managers_session WHERE managers_id=%ld %s AND updated < (now() - interval '15 minutes')", managers_id,ptid); }
if (create==0 && pgsql_exec("UPDATE managers_session SET updated=NOW() WHERE managers_id=%ld %s AND sessionid='%s'", managers_id,ptid, sessionid)>0) {
return 1L; // Session updated
}
if (create>0) {
// Check session i?
/*
const PGresult *res = pgsql_query("SELECT * FROM managers_session WHERE managers_id=%ld %s AND sessionid<>'%s'", managers_id,ptid, sessionid);
if (res!=NULL && pgsql_num_rows(res)>0) {
return -2L; // Active sessions found
}
*/
CVars sess; // Do we have the same session already?
if (load_db_record( sess, "SELECT * FROM managers_session WHERE managers_id=%lu %s AND sessionid='%s'", managers_id,ptid, sessionid)>0) {
pgsql_exec("UPDATE managers_session SET updated=NOW() WHERE managers_id=%ld %s AND sessionid='%s'", managers_id,ptid, sessionid);
return sess["id"].Long();
}
// Create a new session
sess["managers_id"] = managers_id; sess["managers_id"].set_valid(true);
sess["sessionid"] = sessionid; sess["sessionid"].set_valid(true);
if ( shop > 0 )
{
sess["shop"] = shop; sess["shop"].set_valid(true);
}
if ( acc > 0 )
{
sess["account"] = acc; sess["account"].set_valid(true);
}
long sid = insert_db_record( DBS_VALID, "managers_session", "managers_session_id_seq", sess );
if (sid>0) {
return sid; // New session created
}
return -3L; // Failed to create new session
}
logfmt( logINFO, "/long CommonSessionCheck(long managers_id,long shop, const char *sessionid, int create )" );
return 0L; // No route
}
/*
CREATE TABLE managers_session (
id SERIAL,
managers_id INT REFERENCES managers(id),
shop INT DEFAULT 0,
sessionid varchar(100) NOT NULL,
added timestamp without time zone DEFAULT now(),
updated timestamp without time zone DEFAULT now(),
status integer DEFAULT 1,
loc INET
);
*/
+265
View File
@@ -0,0 +1,265 @@
// Mobile management toosl
#include "clog.h"
#include "cgi.h"
#include "input.h"
#include "wrenchboard_api.h"
#include "mobile.h"
#include "email.h"
#include "safestring.h"
#include <string>
#include "pgsql.h"
#include "pgsql_wrapper.h"
#include <curl/curl.h>
#include "account.h"
#include "account_mngt.h"
#include "contract.h"
long WrenchReturnTaskMessage(CVars in, CVars &out);
long mobile_calls(CVars in, CVars &out) {
logfmt(logINFO, "mobile_calls()");
out["result"] = "~~Backend Reached~~";
long action = REQ_LONG(in, "action", 0, -1);
switch (action) {
case WRENCHBOARD_MOBILE_ACTIVEJOB:
return WrenchReturnActiveJobsList(in, out);
break;
case WRENCHBOARD_MOBILE_OFFERSLIST:
return WrenchReturnJobOffersList(in, out);
break;
case WRENCHBOARD_MOBILE_LOADPROFILE:
return WrenchReturnUserProfile(in, out);
break;
case WRENCHBOARD_MOBILE_ACCOUNT:
return WrenchReturnUserAccount(in, out);
break;
case WRENCHBOARD_MOBILE_MESSAGE:
return WrenchReturnMemberMessages(in, out);
break;
case WRENCHBOARD_MOBILE_PAYMENTHX:
return WrenchReturnMemberPaymentHx( in, out);
break;
case WRENCHBOARD_MOBILE_TASKMESSAGE:
return WrenchReturnTaskMessage( in, out);
break;
case WRENCHBOARD_MOBILE_SENDTASKMESSAGE:
return WrenchContractMessage( in, out);
break;
}
logfmt(logINFO, "/mobile_calls()");
return 0;
}
/*
#define WRENCHBOARD_MOBILE_OFFERSLIST 15010
#define WRENCHBOARD_MOBILE_ACTIVEJOB 15020
#define WRENCHBOARD_MOBILE_LOADPROFILE 15030
#define WRENCHBOARD_MOBILE_ACCOUNT 15040
long WrenchReturnActiveJobsList(CVars in, CVars &out)
long WrenchReturnJobOffersList(CVars in, CVars &out)
long WrenchReturnUserProfile(CVars in, CVars &out)
long WrenchReturnUserAccount(CVars in, CVars &out)
*/
/* This task message */
long WrenchReturnTaskMessage(CVars in, CVars &out) {
logfmt(logINFO, "WrenchReturnTaskMessage()");
long ret = PHP_API_BAD_PARAM;
char vname[30];
// msg_id | date1 | title | msg
// -----------------------------
try {
long member_id = REQ_LONG(in, "member_id", 1, -1);
long limit = REQ_LONG(in, "limit", 1, -1);
REQ_STRING(in, "sessionid", 2, 100, "(.*)");
REQ_STRING(in, "contract", 2, 15, "(.*)");
out["total_record"] = "0";
const PGresult *res;
res = pgsql_query("SELECT jc.id AS msg_id,to_char(jc.created, 'YYYY-MM-DD HH24:MI') AS date1, "
" ''||(CASE WHEN jc.msg_type='FILE' THEN 'FILE' ELSE '' END) ||''||m.firstname AS title,(CASE WHEN jc.msg_type='FILE' THEN ''||jc.message||'' ELSE jc.message END) AS msg "
" FROM jobs_contract_message jc "
" LEFT JOIN members m ON m.id=jc.member_id "
" WHERE jc.contract='%s' "
" ORDER by jc.id DESC LIMIT %lu ", in["contract"].c_str(),in["limit"].Long() );
if (res != NULL && pgsql_num_rows(res) > 0) {
out["total_record"] = pgsql_num_rows(res);
for (int i = 0, n = pgsql_num_rows(res); i < n; i++) {
map<const char*, const char*>f = pgsql_fetch_assoc(res, i);
if (f.empty()) continue;
CVars rec;
map_to_cvars(f, rec);
snprintf(vname, sizeof (vname), "title_%05d", i);
out[vname] = rec["title"];
snprintf(vname, sizeof (vname), "date_%05d", i);
out[vname] = rec["date1"];
snprintf(vname, sizeof (vname), "msg_id_%05d", i);
out[vname] = rec["msg_id"];
snprintf(vname, sizeof (vname), "msg_%05d", i);
out[vname] = rec["msg"];
}
}
} catch (bad_parameter) {
logfmt(logINFO, "ERROR CALL long WrenchReturnTaskMessage(CVars in, CVars &out)");
}
logfmt(logINFO, "/WrenchReturnTaskMessage()");
return ret;
}
/* This account apps*/
long WrenchReturnUserAccount(CVars in, CVars &out) {
logfmt(logINFO, "WrenchReturnUserAccount()");
char vname[30];
long ret = PHP_API_BAD_PARAM;
try {
long member_id = REQ_LONG(in, "member_id", 1, -1);
out["total_record"] = "0";
const PGresult *res;
res = pgsql_query("SELECT * FROM members WHERE id = %lu", member_id );
if (res != NULL && pgsql_num_rows(res) > 0) {
out["total_record"] = pgsql_num_rows(res);
map<const char*, const char*>f = pgsql_fetch_assoc(res, 0);
map_to_cvars(f, out);
ret = PHP_API_OK;
out["status"] = "OK";
}
} catch (bad_parameter) {
logfmt(logINFO, "ERROR CALL long WrenchReturnUserAccount(CVars in, CVars &out)");
}
logfmt(logINFO, "/WrenchReturnUserAccount()");
return ret;
}
/* This profile apps*/
long WrenchReturnUserProfile(CVars in, CVars &out) {
logfmt(logINFO, "WrenchReturnUserProfile()");
long ret = PHP_API_BAD_PARAM;
try {
long member_id = REQ_LONG(in, "member_id", 1, -1);
out["total_record"] = "0";
const PGresult *res;
res = pgsql_query("SELECT * FROM members WHERE id = %lu", member_id );
if (res != NULL && pgsql_num_rows(res) > 0) {
out["total_record"] = pgsql_num_rows(res);
map<const char*, const char*>f = pgsql_fetch_assoc(res, 0);
map_to_cvars(f, out);
ret = PHP_API_OK;
out["status"] = "OK";
}
} catch (bad_parameter) {
logfmt(logINFO, "ERROR CALL long WrenchReturnUserProfile(CVars in, CVars &out)");
}
logfmt(logINFO, "/WrenchReturnUserProfile()");
return ret;
}
/* This return the list of jobs on the home page of the apps*/
long WrenchReturnJobOffersList(CVars in, CVars &out) {
logfmt(logINFO, "WrenchReturnJobOffersList()");
char vname[30];
long ret = PHP_API_BAD_PARAM;
try {
long limit = REQ_LONG(in, "limit", 1, -1);
long member_id = REQ_LONG(in, "member_id", 1, -1);
REQ_LONG(in, "page", 1, -1);
out["total_record"] = "0";
const PGresult *res;
res = pgsql_query("SELECT mj.id AS job_id, jo.id AS contract_id, jo.added::date,mj.title, jo.offer_code, "
" mj.description AS description, jo.job_description,mj.price, mj.timeline_days "
"FROM members_jobs_offer jo LEFT JOIN members_jobs mj ON mj.id = jo.job_id "
"WHERE jo.expire > now() AND jo.status = 1 "
"AND jo.client_id = %lu LIMIT %lu ", in["member_id"].Long(), in["limit"].Long());
if (res != NULL && pgsql_num_rows(res) > 0) {
out["total_record"] = pgsql_num_rows(res);
for (int i = 0, n = pgsql_num_rows(res); i < n; i++) {
map<const char*, const char*>f = pgsql_fetch_assoc(res, i);
if (f.empty()) continue;
CVars rec;
map_to_cvars(f, rec);
snprintf(vname, sizeof (vname), "title_%05d", i);
out[vname] = rec["title"];
snprintf(vname, sizeof (vname), "project_%05d", i);
out[vname] = rec["offer_code"];
snprintf(vname, sizeof (vname), "description_%05d", i);
out[vname] = rec["description"];
snprintf(vname, sizeof (vname), "status_description_%05d", i);
out[vname] = "Offer";
snprintf(vname, sizeof (vname), "delivery_date_%05d", i);
out[vname] = rec["delivery_date"];
snprintf(vname, sizeof (vname), "status_description_%05d", i);
out[vname] = rec["status_description"];
snprintf(vname, sizeof (vname), "timeline_days_%05d", i);
out[vname] = rec["timeline_days"];
snprintf(vname, sizeof (vname), "contract_%05d", i);
out[vname] = rec["offer_code"];
snprintf(vname, sizeof (vname), "job_description_%05d", i);
out[vname] = rec["job_description"];
snprintf(vname, sizeof (vname), "price_%05d", i);
out[vname] = rec["price"];
snprintf(vname, sizeof (vname), "job_id_%05d", i);
out[vname] = rec["job_id"];
snprintf(vname, sizeof (vname), "contract_id_%05d", i);
out[vname] = rec["contract_id"];
}
}
ret = PHP_API_OK;
out["status"] = "OK";
} catch (bad_parameter) {
logfmt(logINFO, "ERROR CALL long WrenchReturnJobOffersList(CVars in, CVars &out)");
}
logfmt(logINFO, "/WrenchReturnJobOffersList()");
return ret;
}
/* This return the list of jobs on the home page of the apps*/
long WrenchReturnActiveJobsList(CVars in, CVars &out) {
return WrenchMemberActiveJobs(in, out);
}
@@ -0,0 +1,4 @@
#include <stdsoap2.h>
extern "C" {
SOAP_NMAC struct Namespace namespaces[] = { { NULL, NULL} };
}
+585
View File
@@ -0,0 +1,585 @@
// Account management toosl
#include "clog.h"
#include "cgi.h"
#include "input.h"
#include "wrenchboard_api.h"
#include "payments.h"
#include "common_tool.h"
#include "email.h"
#include "safestring.h"
#include <string>
#include "pgsql.h"
#include "pgsql_wrapper.h"
#include "cfg.h"
#include <curl/curl.h>
#include "stripe_charge.h"
/*
CREATE TABLE payment_types (
id SERIAL,
type_code varchar(25) UNIQUE NOT NULL,
code varchar(5) UNIQUE NOT NULL,
dir INT DEFAULT 0
)
ALTER TABLE ONLY payment_types
ADD CONSTRAINT payment_types_id_key UNIQUE (id);
INSERT INTO payment_types(type_code,code,dir) VALUES('OFFER_PYM_DEPOSIT','OFDPS',0);
INSERT INTO payment_types(type_code,code,dir) VALUES('OFFER_PYM_REFUND','OFRFD',1); -- // refund if offer was rejected or not accepted
*/
long WrenchCanceContractPayment( CVars in, CVars &out )
{
/*
y["member_id"] = in["member_id"]; // note we are actually paying the client_id
y["contract_id"] = in["job_id"];
y["code"] = "COPAY";
y["dir"] = DIR_TARGET;
*/
long ret = PHP_API_BAD_PARAM;
//ULONG payment_id = 0;
const char * loc = getenv("REMOTE_ADDR");
in["loc"] = loc; in["loc"].set_valid(true);
long member_id = REQ_LONG( in, "member_id", 1, -1 );
long contract_id = REQ_LONG( in, "contract_id", 1, -1 );
REQ_LONG( in, "dir", 1, -1 );
REQ_STRING (in, "code", 4, 5, "(.*)");
//long offer_id = REQ_LONG( in, "offer_id", 1, -1 );
long payment_id = 0; //
//long client_id = 0;
long offer_id = 0;
long amount = 0;
//IS THIS JOB COMPLETED AND ACCEPTED YET
if ( load_db_record( out, "SELECT * FROM members_jobs_contract WHERE status =%lu AND id=%lu AND member_id =%lu",in["job_status"].Long(),contract_id,in["member_id"].Long() ) )
{
member_id = out["member_id"].Long(); // NOTE THAT WE ARE REFUNDING SO CLIENT IS SAME AS MEMBER FOR THIS REFUND
}
else{
out["status_message"] = "Task is not in complete mode";
return PHP_API_BAD_PARAM;
}
CVars y;
if ( load_db_record( y, "SELECT * FROM members_payments WHERE code ='OFDPS' AND confirmation IS NOT NULL AND status=1 AND flags=4 AND what_contract= %lu AND member_id =%lu",contract_id,in["member_id"].Long() ) )
{
payment_id = y["id"].Long();
offer_id = y["what_offer"].Long();
amount = y["amount"].Long();
}
else{
out["status_message"] = "Task payment not found";
return PHP_API_BAD_PARAM;
}
if (member_id <=0 || payment_id<=0)
{
out["status_message"] = "Client or Payment not properly determined";
return PHP_API_BAD_PARAM;
}
// TEST FOR DUPLICATE
long retDb = load_db_record( out, "SELECT balance AS curr_balance FROM members WHERE id = %lu", member_id);
if (retDb)
{ in["curr_balance"] =out["curr_balance"]; in["curr_balance"].set_valid( true ); // get this one LIVE
}
else
{ out["status"] = "Unable to get client balance";
out["status_message"] = out["status"];
return PHP_API_BAD_PARAM; }
/*
// TEST FOR DUPLICATE
long retDb = load_db_record( out, "SELECT balance AS curr_balance FROM members WHERE id = %lu", in["member_id"].Long());
if (retDb)
{ in["curr_balance"] =out["curr_balance"]; in["curr_balance"].set_valid( true ); // get this one LIVE
}
else
{ out["status"] = "Duplicate payment detetected";
return PHP_API_BAD_PARAM; }
*/
long retDb2 = load_db_record( out, "SELECT * FROM members_payments WHERE id =%lu AND what_offer = %lu AND member_id=%lu AND code = 'OFDPS' AND status = 1 AND flags = 4 AND confirmation IS NOT NULL",payment_id,offer_id,member_id);
if (retDb2)
{
CVars x;
x["member_id"] = member_id; x["member_id"].set_valid( true );
x["code"] = in["code"]; x["code"].set_valid( true );
x["dir"] = in["dir"]; x["dir"].set_valid( true );
x["loc"] = in["loc"]; x["loc"].set_valid( true );
x["curr_balance"] = in["curr_balance"]; x["curr_balance"].set_valid( true );
x["amount"] = amount; x["amount"].set_valid( true );
x["fee"] = "0"; x["fee"].set_valid( true );
x["what_offer"] = offer_id; x["what_offer"].set_valid( true );
x["what_contract"] = contract_id; x["what_contract"].set_valid( true );
x["flags"] = FLAG_INIT; x["flags"].set_valid( true ); // starting the pprocess
payment_id = insert_db_record( DBS_VALID, "members_payments", "members_payments_id_seq", x );
if (payment_id) {
ret = PHP_CREATED_OK;
x["flags"] = FLAG_START; x["flags"].set_valid( true ); // done not completed yet
// now generate the confirmation
pgsql_exec("UPDATE members SET balance=balance + %lu WHERE id = %lu",x["amount"].Long(),x["member_id"].Long() ); // pay attention to who you pay here
char confirmation[15] = "";
Confirmation(payment_id, confirmation, sizeof (confirmation)); // this stamp the offer code directly in that call
x["flags"] = FLAG_OK; x["flags"].set_valid( true );
x["payment_id"] = payment_id; x["payment_id"].set_valid( true );
pgsql_exec("UPDATE members_payments SET flags = %lu WHERE id = %lu",x["flags"].Long(),payment_id );
//pgsql_exec("UPDATE members_jobs_offer SET payment_id = %lu WHERE id = %lu",x["payment_id"].Long(),x["what_offer"].Long() );
load_db_record( out, "SELECT * FROM members_payments WHERE id = %lu ", payment_id );
} else {
out["status"] = "Unable to create payment";
}
}
return ret;
}
long WrenchOfferPayment( CVars in, CVars &out )
{
/*
wrenchboard=> \d members_payments;
Table "public.members_payments"
Column | Type | Modifiers
----------------+-----------------------------+---------------------------------------------------------------
id | integer | not null default nextval('members_payments_id_seq'::regclass)
member_id | integer |
code | character varying(5) |
dir | integer | not null
curr_balance | integer | default 0
amount | integer | default 0
fee | integer | default 0
confirmation | character varying(15) |
status | integer | default 1
flags | integer | default 1
added | timestamp without time zone | default now()
updated | timestamp without time zone | default now()
loc | inet |
what_offer | integer |
what_contract | integer |
what_sendmoney | integer |
Indexes:
"members_payments_confirmation_key" UNIQUE CONSTRAINT, btree (confirmation)
"members_payments_id_key" UNIQUE CONSTRAINT, btree (id)
Foreign-key constraints:
"members_payments_code_fkey" FOREIGN KEY (code) REFERENCES payment_types(code)
"members_payments_member_id_fkey" FOREIGN KEY (member_id) REFERENCES members(id)
"members_payments_what_contract_fkey" FOREIGN KEY (what_contract) REFERENCES members_jobs_contract(id)
"members_payments_what_offer_fkey" FOREIGN KEY (what_offer) REFERENCES members_jobs_offer(id)
"members_payments_what_sendmoney_fkey" FOREIGN KEY (what_sendmoney) REFERENCES money_transfer(id)
*/
long ret = PHP_API_BAD_PARAM;
logfmt( logINFO, "WrenchOfferPayment()" );
ULONG payment_id = 0;
const char * loc = getenv("REMOTE_ADDR");
in["loc"] = loc; in["loc"].set_valid(true);
REQ_LONG( in, "member_id", 1, -1 );
REQ_STRING (in, "code", 4, 5, "(.*)");
REQ_LONG( in, "dir", 1, -1 );
REQ_LONG( in, "offer_id", 1, -1 );
long retDb = load_db_record( out, "SELECT balance AS curr_balance FROM members WHERE id = %lu", in["member_id"].Long());
if (retDb)
{ in["curr_balance"] =out["curr_balance"]; in["curr_balance"].set_valid( true ); // get this one LIVE
}
else
{ out["status"] = "Invalid user";
return PHP_API_BAD_PARAM; }
long retDb2 = load_db_record( out, "SELECT jj.price,0 as fee FROM members_jobs_offer j LEFT JOIN members_jobs jj ON jj.id=j.job_id WHERE j.id =%lu ",in["offer_id"].Long());
if (retDb2)
{ in["amount"] =out["price"]; in["amount"].set_valid( true ); // get this one LIVE
in["fee"] =out["fee"]; in["fee"].set_valid( true ); // get this one LIVE
}
else
{ out["status"] = "Invalid offer";
return PHP_API_BAD_PARAM;
}
long totalAmount = in["amount"].Long() + in["fee"].Long();
if ( in["curr_balance"] < in["amount"].Long() + in["fee"].Long())
{
out["status"] = "Insufficient balance for this offer";
return PHP_API_BAD_PARAM;
}
// if you have enough money for this offer
// flags //
CVars x;
x["member_id"] = in["member_id"]; x["member_id"].set_valid( true );
x["code"] = in["code"]; x["code"].set_valid( true );
x["dir"] = in["dir"]; x["dir"].set_valid( true );
x["loc"] = in["loc"]; x["loc"].set_valid( true );
x["curr_balance"] = in["curr_balance"]; x["curr_balance"].set_valid( true );
x["amount"] = in["amount"]; x["amount"].set_valid( true );
x["fee"] = in["fee"]; x["fee"].set_valid( true );
x["what_offer"] = in["offer_id"]; x["what_offer"].set_valid( true );
x["flags"] = FLAG_INIT; x["flags"].set_valid( true ); // starting the pprocess
payment_id = insert_db_record( DBS_VALID, "members_payments", "members_payments_id_seq", x );
out["payment_id"] = payment_id; out["payment_id"].set_valid( true );
if (payment_id) {
ret = PHP_CREATED_OK;
x["flags"] = FLAG_START; x["flags"].set_valid( true ); // done not completed yet
// now generate the confirmation
pgsql_exec("UPDATE members SET balance=balance - %lu WHERE id = %lu",in["amount"].Long() + in["fee"].Long(),in["member_id"].Long() );
char confirmation[15] = "";
Confirmation(payment_id, confirmation, sizeof (confirmation)); // this stamp the offer code directly in that call
x["flags"] = FLAG_OK; x["flags"].set_valid( true );
x["payment_id"] = payment_id; x["payment_id"].set_valid( true );
pgsql_exec("UPDATE members_payments SET flags = %lu WHERE id = %lu",x["flags"].Long(),payment_id );
pgsql_exec("UPDATE members_jobs_offer SET payment_id = %lu WHERE id = %lu",x["payment_id"].Long(),x["what_offer"].Long() );
load_db_record( out, "SELECT * FROM members_payments WHERE id = %lu ", payment_id );
} else {
out["status"] = "Uanble to create payment";
}
logfmt( logINFO, "/WrenchOfferPayment()" );
return ret;
}
long WrenchRefundoffer( CVars in, CVars &out )
{
long ret = PHP_API_BAD_PARAM;
//ULONG payment_id = 0;
const char * loc = getenv("REMOTE_ADDR");
in["loc"] = loc; in["loc"].set_valid(true);
long member_id = REQ_LONG( in, "member_id", 1, -1 );
REQ_STRING (in, "code", 4, 5, "(.*)");
REQ_LONG( in, "dir", 1, -1 );
long offer_id = REQ_LONG( in, "offer_id", 1, -1 );
long payment_id = REQ_LONG( in, "payment_id", 1, -1 );
long retDb = load_db_record( out, "SELECT balance AS curr_balance FROM members WHERE id = %lu", in["member_id"].Long());
if (retDb)
{ in["curr_balance"] =out["curr_balance"]; in["curr_balance"].set_valid( true ); // get this one LIVE
}
else
{ out["status"] = "Invalid user";
return PHP_API_BAD_PARAM; }
long retDb2 = load_db_record( out, "SELECT * FROM members_payments WHERE id =%lu AND what_offer = %lu AND member_id=%lu AND code = 'OFDPS' AND status = 1 AND flags = 4 AND confirmation IS NOT NULL",payment_id,offer_id,member_id);
if (retDb2)
{
CVars x;
x["member_id"] = in["member_id"]; x["member_id"].set_valid( true );
x["code"] = in["code"]; x["code"].set_valid( true );
x["dir"] = in["dir"]; x["dir"].set_valid( true );
x["loc"] = in["loc"]; x["loc"].set_valid( true );
x["curr_balance"] = in["curr_balance"]; x["curr_balance"].set_valid( true );
x["amount"] = out["amount"]; x["amount"].set_valid( true );
x["fee"] = out["fee"]; x["fee"].set_valid( true );
x["what_offer"] = out["what_offer"]; x["what_offer"].set_valid( true );
x["flags"] = FLAG_INIT; x["flags"].set_valid( true ); // starting the pprocess
payment_id = insert_db_record( DBS_VALID, "members_payments", "members_payments_id_seq", x );
if (payment_id) {
ret = PHP_CREATED_OK;
x["flags"] = FLAG_START; x["flags"].set_valid( true ); // done not completed yet
// now generate the confirmation
pgsql_exec("UPDATE members SET balance=balance + %lu WHERE id = %lu",x["amount"].Long() + x["fee"].Long(),in["member_id"].Long() );
char confirmation[15] = "";
Confirmation(payment_id, confirmation, sizeof (confirmation)); // this stamp the offer code directly in that call
x["flags"] = FLAG_OK; x["flags"].set_valid( true );
x["payment_id"] = payment_id; x["payment_id"].set_valid( true );
pgsql_exec("UPDATE members_payments SET flags = %lu WHERE id = %lu",x["flags"].Long(),payment_id );
//pgsql_exec("UPDATE members_jobs_offer SET payment_id = %lu WHERE id = %lu",x["payment_id"].Long(),x["what_offer"].Long() );
load_db_record( out, "SELECT * FROM members_payments WHERE id = %lu ", payment_id );
} else {
out["status"] = "Unable to create payment";
}
}
return ret;
}
long WrenchContractPayment( CVars in, CVars &out )
{
/*
y["member_id"] = in["member_id"]; // note we are actually paying the client_id
y["contract_id"] = in["job_id"];
y["code"] = "COPAY";
y["dir"] = DIR_TARGET;
*/
long ret = PHP_API_BAD_PARAM;
//ULONG payment_id = 0;
const char * loc = getenv("REMOTE_ADDR");
in["loc"] = loc; in["loc"].set_valid(true);
long member_id = REQ_LONG( in, "member_id", 1, -1 );
long contract_id = REQ_LONG( in, "contract_id", 1, -1 );
REQ_LONG( in, "dir", 1, -1 );
REQ_STRING (in, "code", 4, 5, "(.*)");
//long offer_id = REQ_LONG( in, "offer_id", 1, -1 );
long payment_id = 0; //
long client_id = 0;
long offer_id = 0;
long amount = 0;
//IS THIS JOB COMPLETED AND ACCEPTED YET
if ( load_db_record( out, "SELECT * FROM members_jobs_contract WHERE status = %lu AND id=%lu AND member_id =%lu",CONTRACT_ACCEPT_COMPLETE,contract_id,in["member_id"].Long() ) )
{
client_id = out["client_id"].Long();
}
else{
out["status_message"] = "Task is not in complete mode";
return PHP_API_BAD_PARAM;
}
CVars y;
if ( load_db_record( y, "SELECT * FROM members_payments WHERE code ='OFDPS' AND confirmation IS NOT NULL AND status=1 AND flags=4 AND what_contract= %lu AND member_id =%lu",contract_id,in["member_id"].Long() ) )
{
payment_id = y["id"].Long();
offer_id = y["what_offer"].Long();
amount = y["amount"].Long();
}
else{
out["status_message"] = "Task is not in complete mode";
return PHP_API_BAD_PARAM;
}
if (client_id <=0 || payment_id<=0)
{
out["status_message"] = "Client or Payment not properly determined";
return PHP_API_BAD_PARAM;
}
// TEST FOR DUPLICATE
long retDb = load_db_record( out, "SELECT balance AS curr_balance FROM members WHERE id = %lu", client_id);
if (retDb)
{ in["curr_balance"] =out["curr_balance"]; in["curr_balance"].set_valid( true ); // get this one LIVE
}
else
{ out["status"] = "Unable to get client balance";
return PHP_API_BAD_PARAM; }
/*
// TEST FOR DUPLICATE
long retDb = load_db_record( out, "SELECT balance AS curr_balance FROM members WHERE id = %lu", in["member_id"].Long());
if (retDb)
{ in["curr_balance"] =out["curr_balance"]; in["curr_balance"].set_valid( true ); // get this one LIVE
}
else
{ out["status"] = "Duplicate payment detetected";
return PHP_API_BAD_PARAM; }
*/
long retDb2 = load_db_record( out, "SELECT * FROM members_payments WHERE id =%lu AND what_offer = %lu AND member_id=%lu AND code = 'OFDPS' AND status = 1 AND flags = 4 AND confirmation IS NOT NULL",payment_id,offer_id,member_id);
if (retDb2)
{
CVars x;
x["member_id"] = client_id; x["member_id"].set_valid( true );
x["code"] = in["code"]; x["code"].set_valid( true );
x["dir"] = in["dir"]; x["dir"].set_valid( true );
x["loc"] = in["loc"]; x["loc"].set_valid( true );
x["curr_balance"] = in["curr_balance"]; x["curr_balance"].set_valid( true );
x["amount"] = amount; x["amount"].set_valid( true );
x["fee"] = "0"; x["fee"].set_valid( true );
x["what_offer"] = offer_id; x["what_offer"].set_valid( true );
x["what_contract"] = contract_id; x["what_contract"].set_valid( true );
x["flags"] = FLAG_INIT; x["flags"].set_valid( true ); // starting the pprocess
payment_id = insert_db_record( DBS_VALID, "members_payments", "members_payments_id_seq", x );
if (payment_id) {
ret = PHP_CREATED_OK;
x["flags"] = FLAG_START; x["flags"].set_valid( true ); // done not completed yet
// now generate the confirmation
pgsql_exec("UPDATE members SET balance=balance + %lu WHERE id = %lu",x["amount"].Long(),x["member_id"].Long() ); // pay attention to who you pay here
char confirmation[15] = "";
Confirmation(payment_id, confirmation, sizeof (confirmation)); // this stamp the offer code directly in that call
x["flags"] = FLAG_OK; x["flags"].set_valid( true );
x["payment_id"] = payment_id; x["payment_id"].set_valid( true );
pgsql_exec("UPDATE members_payments SET flags = %lu WHERE id = %lu",x["flags"].Long(),payment_id );
//pgsql_exec("UPDATE members_jobs_offer SET payment_id = %lu WHERE id = %lu",x["payment_id"].Long(),x["what_offer"].Long() );
load_db_record( out, "SELECT * FROM members_payments WHERE id = %lu ", payment_id );
} else {
out["status"] = "Unable to create payment";
}
}
return ret;
}
long WrenchSendMoneyPayment( CVars in, CVars &out )
{
/*
wrenchboard=> \d members_payments;
Table "public.members_payments"
Column | Type | Modifiers
----------------+-----------------------------+---------------------------------------------------------------
id | integer | not null default nextval('members_payments_id_seq'::regclass)
member_id | integer |
code | character varying(5) |
dir | integer | not null
curr_balance | integer | default 0
amount | integer | default 0
fee | integer | default 0
confirmation | character varying(15) |
status | integer | default 1
flags | integer | default 1
added | timestamp without time zone | default now()
updated | timestamp without time zone | default now()
loc | inet |
what_offer | integer |
what_contract | integer |
what_sendmoney | integer |
Indexes:
"members_payments_confirmation_key" UNIQUE CONSTRAINT, btree (confirmation)
"members_payments_id_key" UNIQUE CONSTRAINT, btree (id)
Foreign-key constraints:
"members_payments_code_fkey" FOREIGN KEY (code) REFERENCES payment_types(code)
"members_payments_member_id_fkey" FOREIGN KEY (member_id) REFERENCES members(id)
"members_payments_what_contract_fkey" FOREIGN KEY (what_contract) REFERENCES members_jobs_contract(id)
"members_payments_what_offer_fkey" FOREIGN KEY (what_offer) REFERENCES members_jobs_offer(id)
"members_payments_what_sendmoney_fkey" FOREIGN KEY (what_sendmoney) REFERENCES money_transfer(id)
*/
long ret = PHP_API_BAD_PARAM;
logfmt( logINFO, "WrenchSendMoneyPayment()" );
ULONG payment_id = 0;
const char * loc = getenv("REMOTE_ADDR");
in["loc"] = loc; in["loc"].set_valid(true);
REQ_LONG( in, "member_id", 1, -1 );
REQ_STRING (in, "code", 4, 5, "(.*)");
REQ_LONG( in, "dir", 1, -1 );
REQ_LONG( in, "sendmoney_id", 1, -1 );
long retDb = load_db_record( out, "SELECT balance AS curr_balance FROM members WHERE id = %lu", in["member_id"].Long());
if (retDb)
{ in["curr_balance"] =out["curr_balance"]; in["curr_balance"].set_valid( true ); // get this one LIVE
}
else
{ out["status"] = "Invalid user";
return PHP_API_BAD_PARAM; }
long retDb2 = load_db_record( out, "SELECT id,initiatingamount AS amount,fee from money_transfer WHERE member_id= %lu AND id = %lu",in["member_id"].Long(), in["sendmoney_id"].Long());
if (retDb2)
{ in["amount"] =out["amount"]; in["amount"].set_valid( true ); // get this one LIVE
in["fee"] =out["fee"]; in["fee"].set_valid( true ); // get this one LIVE
}
else
{ out["status"] = "Invalid offer";
return PHP_API_BAD_PARAM;
}
long totalAmount = in["amount"].Long() + in["fee"].Long();
if ( in["curr_balance"] < in["amount"].Long() + in["fee"].Long())
{
out["status"] = "Insufficient balance for this offer";
return PHP_API_BAD_PARAM;
}
// if you have enough money for this offer
// flags //
CVars x;
x["member_id"] = in["member_id"]; x["member_id"].set_valid( true );
x["code"] = in["code"]; x["code"].set_valid( true );
x["dir"] = in["dir"]; x["dir"].set_valid( true );
x["loc"] = in["loc"]; x["loc"].set_valid( true );
x["curr_balance"] = in["curr_balance"]; x["curr_balance"].set_valid( true );
x["amount"] = in["amount"]; x["amount"].set_valid( true );
x["fee"] = in["fee"]; x["fee"].set_valid( true );
x["what_sendmoney"] = in["sendmoney_id"]; x["what_sendmoney"].set_valid( true );
x["flags"] = FLAG_INIT; x["flags"].set_valid( true ); // starting the pprocess
payment_id = insert_db_record( DBS_VALID, "members_payments", "members_payments_id_seq", x );
// return if not good
const PGresult *res = pgsql_query("SELECT * FROM members_payments WHERE id=%lu AND member_id = %lu",payment_id, x["member_id"].Long() );
if (res!=NULL && pgsql_num_rows(res)>0)
{
}
else
{
out["status"] = "Failure to create";
return PHP_API_BAD_PARAM;
}
out["payment_id"] = payment_id; out["payment_id"].set_valid( true );
if (payment_id) {
ret = PHP_CREATED_OK;
x["flags"] = FLAG_START; x["flags"].set_valid( true ); // done not completed yet
// now generate the confirmation
pgsql_exec("UPDATE members SET balance=balance - %lu WHERE id = %lu",in["amount"].Long() + in["fee"].Long(),in["member_id"].Long() );
char confirmation[15] = "";
Confirmation(payment_id, confirmation, sizeof (confirmation)); // this stamp the offer code directly in that call
x["flags"] = FLAG_OK; x["flags"].set_valid( true );
x["payment_id"] = payment_id; x["payment_id"].set_valid( true );
pgsql_exec("UPDATE members_payments SET flags = %lu WHERE id = %lu",x["flags"].Long(),payment_id );
load_db_record( out, "SELECT * FROM members_payments WHERE id = %lu ", payment_id );
} else {
out["status"] = "Uanble to create payment";
}
logfmt( logINFO, "/WrenchSendMoneyPayment()" );
return ret;
}
//******************************************************************************
+156
View File
@@ -0,0 +1,156 @@
// Site Crons Management Tools
#include "clog.h"
#include "cgi.h"
#include "input.h"
#include "wrenchboard_api.h"
#include "site_crons.h"
#include "email.h"
#include "safestring.h"
#include <string>
#include "pgsql.h"
#include "pgsql_wrapper.h"
#include "cfg.h"
#include <curl/curl.h>
long ReviewReminder(CVars in, CVars &out);
long OfferPending(CVars in, CVars &out);
long InterestPending(CVars in, CVars &out);
long PaymentPending(CVars in, CVars &out);
long DeadlineLineApprachClient(CVars in, CVars &out);
long SignUpPendingReminder(CVars in, CVars &out);
long SignUpStats(CVars in, CVars &out);
long PastDueWarings(CVars in, CVars &out);
long sitecrons_calls(CVars in, CVars &out) {
logfmt(logINFO, "sitecrons_calls()");
//out["result"] = "YES I GET TO BACK END";
long call_action = REQ_LONG(in, "call_action", 0, -1);
CVars x;
long ret = 0;
const char * loc = getenv("REMOTE_ADDR");
switch (call_action) {
case WRB_CRONJOB_JOBDUE_REMINDER:
return DeadlineLineApprachClient(in, out);
break;
case WRB_CRONJOB_JOBDUE_PAYMENTS:
return PaymentPending(in, out);
break;
case WRB_CRONJOB_SIGNUP_ALERT:
return SignUpStats(in, out);
break;
case WRB_CRONJOB_PASTDUE_ALERT:
return PastDueWarings(in, out);
break;
}
logfmt(logINFO, "/sitecrons_calls()");
return ret;
}
long ReviewReminder(CVars in, CVars &out) {
}
long OfferPending(CVars in, CVars &out) {
}
long InterestPending(CVars in, CVars &out) {
}
long PastDueWarings(CVars in, CVars &out) {
logfmt(logINFO, "ENTER PastDueWarings()");
const PGresult *res = pgsql_query("SELECT mc.member_id "
" FROM members_jobs_contract mc "
" LEFT JOIN members m ON m.id=mc.client_id "
" WHERE mc.status IN (1,2) "
"AND delivery_date < now() GROUP BY mc.member_id");
if (res != NULL && pgsql_num_rows(res) > 0) {
for (int i = 0, n = pgsql_num_rows(res); i < n; i++) {
map<const char*, const char*>f = pgsql_fetch_assoc(res, i);
if (f.empty()) continue;
CVars rec;
map_to_cvars(f, rec);
cron_email(WRB_CRONJOB_PASTDUE_ALERT, rec, out); // send the cron email
}
}
logfmt(logINFO, "/PastDueWarings()");
return 0;
}
long SignUpStats(CVars in, CVars &out) {
logfmt(logINFO, "SignUpStats()");
load_db_record(out, "SELECT count(id) AS today_signup FROM members WHERE added::date = now()::date");
load_db_record(out, "SELECT count(id) AS today_pending_signup FROM members_pending WHERE added::date = now()::date");
load_db_record(out, "SELECT TO_CHAR(NOW() :: DATE, 'Day Mon dd, yyyy') AS report_date");
in = out;
alert_email(WRB_CRONJOB_SIGNUP_ALERT, in, out);
logfmt(logINFO, "/SignUpStats()");
return 0;
}
long PaymentPending(CVars in, CVars &out) {
logfmt(logINFO, "PaymentPending()");
const PGresult *res = pgsql_query("SELECT count(id) AS preview_count,member_id FROM members_jobs_contract "\
" WHERE status = 4 AND pay_remind IS NULL AND delivery_date < now() +'-1 day(s)' "\
" GROUP BY member_id LIMIT 1");
if (res != NULL && pgsql_num_rows(res) > 0) {
for (int i = 0, n = pgsql_num_rows(res); i < n; i++) {
map<const char*, const char*>f = pgsql_fetch_assoc(res, i);
if (f.empty()) continue;
CVars rec;
map_to_cvars(f, rec);
job_email(JOBS_PAYMENT_DUE_MAIL, rec, out); // send the reminder email
pgsql_exec("UPDATE members_jobs_contract SET pay_remind=now() "\
"WHERE member_id=%lu AND status = 4 AND pay_remind IS NULL AND delivery_date < now() +'-1 day(s)' ", rec["member_id"].Long());
}
}
logfmt(logINFO, "/PaymentPending()");
return 0;
}
long DeadlineLineApprachClient(CVars in, CVars &out) // called
{
logfmt(logINFO, "DeadlineLineApprachClient()");
const PGresult *res = pgsql_query("SELECT j.client_id,j.id AS contract_id FROM members_jobs_contract j "\
"WHERE j.due_remind IS NULL AND j.status IN (1,2) "\
"AND j.delivery_date > now() AND j.delivery_date < now() + '1 day' "\
"AND j.client_id IS NOT NULL AND j.client_id > 0 limit %lu", in["one_limit"].Long());
if (res != NULL && pgsql_num_rows(res) > 0) {
for (int i = 0, n = pgsql_num_rows(res); i < n; i++) {
map<const char*, const char*>f = pgsql_fetch_assoc(res, i);
if (f.empty()) continue;
CVars rec;
map_to_cvars(f, rec);
job_email(JOBS_DUE_APPROACH_MAIL, rec, out); // send the reminder email
pgsql_exec("UPDATE members_jobs_contract SET due_remind=now() WHERE id=%lu", rec["contract_id"].Long());
}
}
logfmt(logINFO, "/DeadlineLineApprachClient()");
return 0;
}
long SignUpPendingReminder(CVars in, CVars &out) {
}
+233
View File
@@ -0,0 +1,233 @@
#include "smoney.h"
#include "clog.h"
#include "cgi.h"
#include "input.h"
#include "wrenchboard_api.h"
#include "interswitch_sendmoney.h"
#include "safestring.h"
#include "cfg.h"
#include <string>
#include "pgsql.h"
#include "pgsql_wrapper.h"
#include <curl/curl.h>
long smoney_calls(CVars in, CVars &out) {
logfmt(logINFO, "smoney_calls()");
out["result"] = "YES I GET TO BACK END";
long action = REQ_LONG(in, "action", 0, -1);
switch (action) {
case WRENCHBOARD_SMONEY_ADDRECIPIENT:
return member_addrecipient(in, out);
break;
case WRENCHBOARD_SMONEY_MEMBER:
return member_sendmoney(in, out);
break;
case WRENCHBOARD_SMONEY_PROCFEE:
return member_sendmoney_fee(in, out);
break;
case WRENCHBOARD_SMONEY_BKOPROC:
REQ_LONG(in, "action_mode", 0, -1);
return bko_process_sendmoney(in, out);
break;
// case WRENCHBOARD_GROUP_CREATEGROUP:
// return CreateWrenchBoardGroup( in, out);
// break;
}
logfmt(logINFO, "/smoney_calls()");
return 0;
}
long bko_process_sendmoney(CVars in, CVars &out) {
long ret = PHP_API_BAD_PARAM;
const PGresult *res1;
logfmt(logINFO, "long bko_process_sendmoney(CVars in, CVars out)");
try {
REQ_LONG(in, "sendmoney_id", 1, -1);
long action_mode = REQ_LONG(in, "action_mode", 1, -1); // receive the amount in cents
REQ_STRING(in, "trans_tref", 2, 49, "(.*)");
REQ_STRING(in, "trans_code", 2, 49, "(.*)");
const PGresult *res = pgsql_query("SELECT * FROM money_transfer WHERE status = 1 AND completed IS NULL AND id = %lu", in["sendmoney_id"].Long());
if (res != NULL && pgsql_num_rows(res) > 0) {
switch (action_mode) {
case SMONEY_PROCC_MANUAL:
res1 = pgsql_query("SELECT * FROM money_transfer_transaction WHERE transfer_code IS NULL AND responsecode IS NULL AND detail_id = %lu", in["sendmoney_id"].Long());
if (res1 != NULL && pgsql_num_rows(res1) > 0) {
map<const char*, const char*>f = pgsql_fetch_assoc(res1, 0);
logfmt(logINFO, "HERE - 1");
if (!f.empty()) {
logfmt(logINFO, "HERE - 2");
CVars rec;
map_to_cvars(f, rec);
out = rec;
logfmt(logINFO, "HERE - 3");
// out["status"] = "You have sent or completed a request for this task already.";
pgsql_exec("UPDATE money_transfer_transaction SET transfer_code='SID:%09lu',responsecode='%s',transactionref='%s' WHERE id=%lu", in["sendmoney_id"].Long(), in["trans_code"].c_str(), in["trans_tref"].c_str(), out["id"].Long());
pgsql_exec("UPDATE money_transfer SET status=5,completed=now() WHERE status = 1 AND completed IS NULL AND id=%lu", in["sendmoney_id"].Long());
out["status"] = "Completed";
// send email
}
}
break;
case SMONEY_PROCC_INTERSWITCH:
logfmt(logINFO, "***** INTERSWITCH CALL long bko_process_sendmoney(CVars in, CVars out)");
return INTW_doCompleteSavedTransfer(in, out);
break;
}
return ret;
} else {
out["status"] = "Invalid Status";
}
} catch (bad_parameter) {
out["log_status"] = "Invalid Log Action";
}
logfmt(logINFO, "/long bko_process_sendmoney(CVars in, CVars out)");
return ret;
}
long member_sendmoney_fee(CVars in, CVars &out) {
logfmt(logINFO, "long member_sendmoney_rate(CVars in, CVars out)");
out["processing_fee"] = "0";
try {
REQ_LONG(in, "member_id", 1, -1);
REQ_LONG(in, "amount", 1, -1); // receive the amount in cents
// this will use database and policy in full design
out["processing_fee"] = in["amount"].Long()*0.01 + 12000; // note we have to work in cents
out["total_amount"] = out["processing_fee"].Long() + in["amount"].Long();
} catch (bad_parameter) {
out["log_status"] = "Invalid Log Action";
}
logfmt(logINFO, "/long member_sendmoney_rate(CVars in, CVars out)");
return out["processing_fee"].Long();
}
long member_sendmoney(CVars in, CVars &out) {
//plog->SetFileName( PREFIX"/logs/member_sendmoney.log" );
return INTW_doServiceTransfer(in, out);
//return 0;
}
long member_addrecipient(CVars in, CVars &out) {
logfmt(logINFO, "long member_addrecipient(CVars in, CVars out)");
long ret = PHP_API_BAD_PARAM;
const char * loc = getenv("REMOTE_ADDR");
try {
REQ_LONG(in, "member_id", 1, -1);
REQ_STRING(in, "bank_code", 2, 3, "(.*)");
REQ_STRING(in, "firstname", 2, 49, "(.*)");
REQ_STRING(in, "lastname", 2, 49, "(.*)");
REQ_STRING(in, "account_no", 2, 15, "(.*)");
REQ_LONG(in, "account_type", 1, -1);
REQ_STRING(in, "country", 2, 3, "(.*)");
REQ_STRING(in, "state", 2, 49, "(.*)");
REQ_STRING(in, "city", 2, 49, "(.*)");
CVars x, xx;
if (load_db_record(x, "SELECT count(id) AS count_duplicate FROM sendmoney_recipient WHERE member_id = %lu AND account_no='%s' AND status = 1 ", in["member_id"].Long(), in["account_no"].c_str())) {
if (x["count_duplicate"].Long() > 0) {
out["error"] = "Duplicate Account Detected";
return ret;
}
}
if (load_db_record(x, "SELECT count(id) AS count_duplicate FROM sendmoney_recipient WHERE account_no='%s' AND status IN ( 1, 7 ) ", in["account_no"].c_str())) {
if (x["count_duplicate"].Long() > 2) {
out["error"] = "Account used too many times";
return ret;
}
}
xx["member_id"] = in["member_id"];
xx["member_id"].set_valid(true);
xx["bank_code"] = in["bank_code"];
xx["bank_code"].set_valid(true);
xx["loc"] = loc;
xx["loc"].set_valid(true);
xx["firstname"] = in["firstname"];
xx["firstname"].set_valid(true);
xx["lastname"] = in["lastname"];
xx["lastname"].set_valid(true);
xx["account_no"] = in["account_no"];
xx["account_no"].set_valid(true);
xx["account_type"] = in["account_type"];
xx["account_type"].set_valid(true);
xx["country"] = in["country"];
xx["country"].set_valid(true);
xx["state"] = in["state"];
xx["state"].set_valid(true);
out["recipient_id"] = insert_db_record(DBS_VALID, "sendmoney_recipient", "sendmoney_recipient_id_seq", xx);
if (out["recipient_id"].Long() > 0) {
ret = out["recipient_id"].Long(); //PHP_API_OK;
}
} catch (bad_parameter) {
out["log_status"] = "Invalid Log Action";
}
logfmt(logINFO, "/long member_addrecipient(CVars in, CVars out)");
return ret;
}
/*
Column | Type | Modifiers
--------------+-----------------------------+------------------------------------------------------------------
id | integer | not null default nextval('sendmoney_recipient_id_seq'::regclass)
member_id | integer |
bank_code | character varying(3) |
firstname | character varying(50) | not null
lastname | character varying(50) | not null
account_no | character varying(20) | not null
added | timestamp without time zone | default now()
updated | timestamp without time zone | default now()
status | integer | default 1
account_type | integer | default 20
Indexes:
"sendmoney_recipient_id_key" UNIQUE CONSTRAINT, btree (id)
Foreign-key constraints:
"sendmoney_recipient_member_id_fkey" FOREIGN KEY (member_id) REFERENCES members(id)
Referenced by:
TABLE "money_transfer" CONSTRAINT "money_transfer_recipientid_fkey" FOREIGN KEY (recipientid) REFERENCES sendmoney_recipient(id)
*/
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:interswitch="http://services.interswitchng.com/quicktellerservice/">
<SOAP-ENV:Body>
<interswitch:ActivateUser>
<interswitch:xmlParams></interswitch:xmlParams>
</interswitch:ActivateUser>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:interswitch="http://services.interswitchng.com/quicktellerservice/">
<SOAP-ENV:Body>
<interswitch:ActivateUserResponse>
<interswitch:ActivateUserResult></interswitch:ActivateUserResult>
</interswitch:ActivateUserResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:interswitch="http://services.interswitchng.com/quicktellerservice/">
<SOAP-ENV:Body>
<interswitch:AddBillerCustomer>
<interswitch:xmlParams></interswitch:xmlParams>
</interswitch:AddBillerCustomer>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:interswitch="http://services.interswitchng.com/quicktellerservice/">
<SOAP-ENV:Body>
<interswitch:AddBillerCustomerResponse>
<interswitch:AddBillerCustomerResult></interswitch:AddBillerCustomerResult>
</interswitch:AddBillerCustomerResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:interswitch="http://services.interswitchng.com/quicktellerservice/">
<SOAP-ENV:Body>
<interswitch:AddCustomerBillerAccount>
<interswitch:xmlParams></interswitch:xmlParams>
</interswitch:AddCustomerBillerAccount>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:interswitch="http://services.interswitchng.com/quicktellerservice/">
<SOAP-ENV:Body>
<interswitch:AddCustomerBillerAccountResponse>
<interswitch:AddCustomerBillerAccountResult></interswitch:AddCustomerBillerAccountResult>
</interswitch:AddCustomerBillerAccountResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:interswitch="http://services.interswitchng.com/quicktellerservice/">
<SOAP-ENV:Body>
<interswitch:AuthenticateCustomer>
<interswitch:xmlParams></interswitch:xmlParams>
</interswitch:AuthenticateCustomer>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:interswitch="http://services.interswitchng.com/quicktellerservice/">
<SOAP-ENV:Body>
<interswitch:AuthenticateCustomerResponse>
<interswitch:AuthenticateCustomerResult></interswitch:AuthenticateCustomerResult>
</interswitch:AuthenticateCustomerResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:interswitch="http://services.interswitchng.com/quicktellerservice/">
<SOAP-ENV:Body>
<interswitch:AuthenticateUser>
<interswitch:xmlParams></interswitch:xmlParams>
</interswitch:AuthenticateUser>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:interswitch="http://services.interswitchng.com/quicktellerservice/">
<SOAP-ENV:Body>
<interswitch:AuthenticateUserResponse>
<interswitch:AuthenticateUserResult></interswitch:AuthenticateUserResult>
</interswitch:AuthenticateUserResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:interswitch="http://services.interswitchng.com/quicktellerservice/">
<SOAP-ENV:Body>
<interswitch:AuthenticateUserSecurityToken>
<interswitch:xmlParams></interswitch:xmlParams>
</interswitch:AuthenticateUserSecurityToken>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:interswitch="http://services.interswitchng.com/quicktellerservice/">
<SOAP-ENV:Body>
<interswitch:AuthenticateUserSecurityTokenResponse>
<interswitch:AuthenticateUserSecurityTokenResult></interswitch:AuthenticateUserSecurityTokenResult>
</interswitch:AuthenticateUserSecurityTokenResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:interswitch="http://services.interswitchng.com/quicktellerservice/">
<SOAP-ENV:Body>
<interswitch:AuthoriseAccountCashOut>
<interswitch:xmlParams></interswitch:xmlParams>
</interswitch:AuthoriseAccountCashOut>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:interswitch="http://services.interswitchng.com/quicktellerservice/">
<SOAP-ENV:Body>
<interswitch:AuthoriseAccountCashOutResponse>
<interswitch:AuthoriseAccountCashOutResult></interswitch:AuthoriseAccountCashOutResult>
</interswitch:AuthoriseAccountCashOutResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:interswitch="http://services.interswitchng.com/quicktellerservice/">
<SOAP-ENV:Body>
<interswitch:AuthoriseCashOut>
<interswitch:xmlParams></interswitch:xmlParams>
</interswitch:AuthoriseCashOut>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:interswitch="http://services.interswitchng.com/quicktellerservice/">
<SOAP-ENV:Body>
<interswitch:AuthoriseCashOutResponse>
<interswitch:AuthoriseCashOutResult></interswitch:AuthoriseCashOutResult>
</interswitch:AuthoriseCashOutResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:interswitch="http://services.interswitchng.com/quicktellerservice/">
<SOAP-ENV:Body>
<interswitch:CancelTransfer>
<interswitch:xmlParams></interswitch:xmlParams>
</interswitch:CancelTransfer>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:interswitch="http://services.interswitchng.com/quicktellerservice/">
<SOAP-ENV:Body>
<interswitch:CancelTransferResponse>
<interswitch:CancelTransferResult></interswitch:CancelTransferResult>
</interswitch:CancelTransferResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:interswitch="http://services.interswitchng.com/quicktellerservice/">
<SOAP-ENV:Body>
<interswitch:ChangePassword>
<interswitch:xmlParams></interswitch:xmlParams>
</interswitch:ChangePassword>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:interswitch="http://services.interswitchng.com/quicktellerservice/">
<SOAP-ENV:Body>
<interswitch:ChangePasswordResponse>
<interswitch:ChangePasswordResult></interswitch:ChangePasswordResult>
</interswitch:ChangePasswordResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:interswitch="http://services.interswitchng.com/quicktellerservice/">
<SOAP-ENV:Body>
<interswitch:CreateBiller>
<interswitch:xmlParams></interswitch:xmlParams>
</interswitch:CreateBiller>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:interswitch="http://services.interswitchng.com/quicktellerservice/">
<SOAP-ENV:Body>
<interswitch:CreateBillerResponse>
<interswitch:CreateBillerResult></interswitch:CreateBillerResult>
</interswitch:CreateBillerResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:interswitch="http://services.interswitchng.com/quicktellerservice/">
<SOAP-ENV:Body>
<interswitch:CreateUser>
<interswitch:xmlParams></interswitch:xmlParams>
</interswitch:CreateUser>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:interswitch="http://services.interswitchng.com/quicktellerservice/">
<SOAP-ENV:Body>
<interswitch:CreateUserResponse>
<interswitch:CreateUserResult></interswitch:CreateUserResult>
</interswitch:CreateUserResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:interswitch="http://services.interswitchng.com/quicktellerservice/">
<SOAP-ENV:Body>
<interswitch:DoBillPaymentInquiry>
<interswitch:xmlParams></interswitch:xmlParams>
</interswitch:DoBillPaymentInquiry>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:interswitch="http://services.interswitchng.com/quicktellerservice/">
<SOAP-ENV:Body>
<interswitch:DoBillPaymentInquiryResponse>
<interswitch:DoBillPaymentInquiryResult></interswitch:DoBillPaymentInquiryResult>
</interswitch:DoBillPaymentInquiryResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:interswitch="http://services.interswitchng.com/quicktellerservice/">
<SOAP-ENV:Body>
<interswitch:DoCustomProcessing>
<interswitch:xmlParams></interswitch:xmlParams>
</interswitch:DoCustomProcessing>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:interswitch="http://services.interswitchng.com/quicktellerservice/">
<SOAP-ENV:Body>
<interswitch:DoCustomProcessingResponse>
<interswitch:DoCustomProcessingResult></interswitch:DoCustomProcessingResult>
</interswitch:DoCustomProcessingResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:interswitch="http://services.interswitchng.com/quicktellerservice/">
<SOAP-ENV:Body>
<interswitch:DoTransfer>
<interswitch:xmlParams></interswitch:xmlParams>
</interswitch:DoTransfer>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:interswitch="http://services.interswitchng.com/quicktellerservice/">
<SOAP-ENV:Body>
<interswitch:DoTransferResponse>
<interswitch:DoTransferResult></interswitch:DoTransferResult>
</interswitch:DoTransferResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:interswitch="http://services.interswitchng.com/quicktellerservice/">
<SOAP-ENV:Body>
<interswitch:EditCustomerBillerAccount>
<interswitch:xmlParams></interswitch:xmlParams>
</interswitch:EditCustomerBillerAccount>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:interswitch="http://services.interswitchng.com/quicktellerservice/">
<SOAP-ENV:Body>
<interswitch:EditCustomerBillerAccountResponse>
<interswitch:EditCustomerBillerAccountResult></interswitch:EditCustomerBillerAccountResult>
</interswitch:EditCustomerBillerAccountResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:interswitch="http://services.interswitchng.com/quicktellerservice/">
<SOAP-ENV:Body>
<interswitch:GetBillerCategories>
</interswitch:GetBillerCategories>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:interswitch="http://services.interswitchng.com/quicktellerservice/">
<SOAP-ENV:Body>
<interswitch:GetBillerCategoriesResponse>
<interswitch:GetBillerCategoriesResult></interswitch:GetBillerCategoriesResult>
</interswitch:GetBillerCategoriesResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:interswitch="http://services.interswitchng.com/quicktellerservice/">
<SOAP-ENV:Body>
<interswitch:GetBillerPaymentItems>
<interswitch:xmlParams></interswitch:xmlParams>
</interswitch:GetBillerPaymentItems>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:interswitch="http://services.interswitchng.com/quicktellerservice/">
<SOAP-ENV:Body>
<interswitch:GetBillerPaymentItemsResponse>
<interswitch:GetBillerPaymentItemsResult></interswitch:GetBillerPaymentItemsResult>
</interswitch:GetBillerPaymentItemsResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:interswitch="http://services.interswitchng.com/quicktellerservice/">
<SOAP-ENV:Body>
<interswitch:GetBillers>
<interswitch:xmlParams></interswitch:xmlParams>
</interswitch:GetBillers>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:interswitch="http://services.interswitchng.com/quicktellerservice/">
<SOAP-ENV:Body>
<interswitch:GetBillersResponse>
<interswitch:GetBillersResult></interswitch:GetBillersResult>
</interswitch:GetBillersResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:interswitch="http://services.interswitchng.com/quicktellerservice/">
<SOAP-ENV:Body>
<interswitch:GetBillersCollectionsAccount>
<interswitch:xmlParams></interswitch:xmlParams>
</interswitch:GetBillersCollectionsAccount>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:interswitch="http://services.interswitchng.com/quicktellerservice/">
<SOAP-ENV:Body>
<interswitch:GetBillersCollectionsAccountResponse>
<interswitch:GetBillersCollectionsAccountResult></interswitch:GetBillersCollectionsAccountResult>
</interswitch:GetBillersCollectionsAccountResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:interswitch="http://services.interswitchng.com/quicktellerservice/">
<SOAP-ENV:Body>
<interswitch:GetCollectionsAccount>
<interswitch:xmlParams></interswitch:xmlParams>
</interswitch:GetCollectionsAccount>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:interswitch="http://services.interswitchng.com/quicktellerservice/">
<SOAP-ENV:Body>
<interswitch:GetCollectionsAccountResponse>
<interswitch:GetCollectionsAccountResult></interswitch:GetCollectionsAccountResult>
</interswitch:GetCollectionsAccountResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:interswitch="http://services.interswitchng.com/quicktellerservice/">
<SOAP-ENV:Body>
<interswitch:GetCustomerBillerAccounts>
<interswitch:xmlParams></interswitch:xmlParams>
</interswitch:GetCustomerBillerAccounts>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:interswitch="http://services.interswitchng.com/quicktellerservice/">
<SOAP-ENV:Body>
<interswitch:GetCustomerBillerAccountsResponse>
<interswitch:GetCustomerBillerAccountsResult></interswitch:GetCustomerBillerAccountsResult>
</interswitch:GetCustomerBillerAccountsResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:interswitch="http://services.interswitchng.com/quicktellerservice/">
<SOAP-ENV:Body>
<interswitch:GetCustomerPayments>
<interswitch:xmlParams></interswitch:xmlParams>
</interswitch:GetCustomerPayments>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:interswitch="http://services.interswitchng.com/quicktellerservice/">
<SOAP-ENV:Body>
<interswitch:GetCustomerPaymentsResponse>
<interswitch:GetCustomerPaymentsResult></interswitch:GetCustomerPaymentsResult>
</interswitch:GetCustomerPaymentsResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:interswitch="http://services.interswitchng.com/quicktellerservice/">
<SOAP-ENV:Body>
<interswitch:GetFeaturedBillers>
<interswitch:xmlParams></interswitch:xmlParams>
</interswitch:GetFeaturedBillers>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:interswitch="http://services.interswitchng.com/quicktellerservice/">
<SOAP-ENV:Body>
<interswitch:GetFeaturedBillersResponse>
<interswitch:GetFeaturedBillersResult></interswitch:GetFeaturedBillersResult>
</interswitch:GetFeaturedBillersResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:interswitch="http://services.interswitchng.com/quicktellerservice/">
<SOAP-ENV:Body>
<interswitch:GetLatestBillers>
</interswitch:GetLatestBillers>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:interswitch="http://services.interswitchng.com/quicktellerservice/">
<SOAP-ENV:Body>
<interswitch:GetLatestBillersResponse>
<interswitch:GetLatestBillersResult></interswitch:GetLatestBillersResult>
</interswitch:GetLatestBillersResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:interswitch="http://services.interswitchng.com/quicktellerservice/">
<SOAP-ENV:Body>
<interswitch:GetSystemSettings>
<interswitch:xmlParams></interswitch:xmlParams>
</interswitch:GetSystemSettings>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:interswitch="http://services.interswitchng.com/quicktellerservice/">
<SOAP-ENV:Body>
<interswitch:GetSystemSettingsResponse>
<interswitch:GetSystemSettingsResult></interswitch:GetSystemSettingsResult>
</interswitch:GetSystemSettingsResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:interswitch="http://services.interswitchng.com/quicktellerservice/">
<SOAP-ENV:Body>
<interswitch:GetUser>
<interswitch:xmlParams></interswitch:xmlParams>
</interswitch:GetUser>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:interswitch="http://services.interswitchng.com/quicktellerservice/">
<SOAP-ENV:Body>
<interswitch:GetUserResponse>
<interswitch:GetUserResult></interswitch:GetUserResult>
</interswitch:GetUserResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:interswitch="http://services.interswitchng.com/quicktellerservice/">
<SOAP-ENV:Body>
<interswitch:QueryTransaction>
<interswitch:xmlParams></interswitch:xmlParams>
</interswitch:QueryTransaction>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:interswitch="http://services.interswitchng.com/quicktellerservice/">
<SOAP-ENV:Body>
<interswitch:QueryTransactionResponse>
<interswitch:QueryTransactionResult></interswitch:QueryTransactionResult>
</interswitch:QueryTransactionResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:interswitch="http://services.interswitchng.com/quicktellerservice/">
<SOAP-ENV:Body>
<interswitch:QueryTransfer>
<interswitch:xmlParams></interswitch:xmlParams>
</interswitch:QueryTransfer>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:interswitch="http://services.interswitchng.com/quicktellerservice/">
<SOAP-ENV:Body>
<interswitch:QueryTransferResponse>
<interswitch:QueryTransferResult></interswitch:QueryTransferResult>
</interswitch:QueryTransferResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:interswitch="http://services.interswitchng.com/quicktellerservice/">
<SOAP-ENV:Body>
<interswitch:ResendActivationToken>
<interswitch:xmlParams></interswitch:xmlParams>
</interswitch:ResendActivationToken>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:interswitch="http://services.interswitchng.com/quicktellerservice/">
<SOAP-ENV:Body>
<interswitch:ResendActivationTokenResponse>
<interswitch:ResendActivationTokenResult></interswitch:ResendActivationTokenResult>
</interswitch:ResendActivationTokenResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:interswitch="http://services.interswitchng.com/quicktellerservice/">
<SOAP-ENV:Body>
<interswitch:ResetPassword>
<interswitch:xmlParams></interswitch:xmlParams>
</interswitch:ResetPassword>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:interswitch="http://services.interswitchng.com/quicktellerservice/">
<SOAP-ENV:Body>
<interswitch:ResetPasswordResponse>
<interswitch:ResetPasswordResult></interswitch:ResetPasswordResult>
</interswitch:ResetPasswordResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:interswitch="http://services.interswitchng.com/quicktellerservice/">
<SOAP-ENV:Body>
<interswitch:ReverseCashOut>
<interswitch:xmlParams></interswitch:xmlParams>
</interswitch:ReverseCashOut>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:interswitch="http://services.interswitchng.com/quicktellerservice/">
<SOAP-ENV:Body>
<interswitch:ReverseCashOutResponse>
<interswitch:ReverseCashOutResult></interswitch:ReverseCashOutResult>
</interswitch:ReverseCashOutResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:interswitch="http://services.interswitchng.com/quicktellerservice/">
<SOAP-ENV:Body>
<interswitch:SendBillPaymentAdvice>
<interswitch:xmlParams></interswitch:xmlParams>
</interswitch:SendBillPaymentAdvice>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:interswitch="http://services.interswitchng.com/quicktellerservice/">
<SOAP-ENV:Body>
<interswitch:SendBillPaymentAdviceResponse>
<interswitch:SendBillPaymentAdviceResult></interswitch:SendBillPaymentAdviceResult>
</interswitch:SendBillPaymentAdviceResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:interswitch="http://services.interswitchng.com/quicktellerservice/">
<SOAP-ENV:Body>
<interswitch:SendPayments>
<interswitch:xmlParams></interswitch:xmlParams>
</interswitch:SendPayments>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:interswitch="http://services.interswitchng.com/quicktellerservice/">
<SOAP-ENV:Body>
<interswitch:SendPaymentsResponse>
<interswitch:SendPaymentsResult></interswitch:SendPaymentsResult>
</interswitch:SendPaymentsResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:interswitch="http://services.interswitchng.com/quicktellerservice/">
<SOAP-ENV:Body>
<interswitch:SendSessionKey>
<interswitch:xmlParams></interswitch:xmlParams>
</interswitch:SendSessionKey>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:interswitch="http://services.interswitchng.com/quicktellerservice/">
<SOAP-ENV:Body>
<interswitch:SendSessionKeyResponse>
<interswitch:SendSessionKeyResult></interswitch:SendSessionKeyResult>
</interswitch:SendSessionKeyResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:interswitch="http://services.interswitchng.com/quicktellerservice/">
<SOAP-ENV:Body>
<interswitch:StatusCheck>
</interswitch:StatusCheck>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:interswitch="http://services.interswitchng.com/quicktellerservice/">
<SOAP-ENV:Body>
<interswitch:StatusCheckResponse>
<interswitch:StatusCheckResult></interswitch:StatusCheckResult>
</interswitch:StatusCheckResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:interswitch="http://services.interswitchng.com/quicktellerservice/">
<SOAP-ENV:Body>
<interswitch:UpdateUser>
<interswitch:xmlParams></interswitch:xmlParams>
</interswitch:UpdateUser>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:interswitch="http://services.interswitchng.com/quicktellerservice/">
<SOAP-ENV:Body>
<interswitch:UpdateUserResponse>
<interswitch:UpdateUserResult></interswitch:UpdateUserResult>
</interswitch:UpdateUserResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:interswitch="http://services.interswitchng.com/quicktellerservice/">
<SOAP-ENV:Body>
<interswitch:ValidateCustomer>
<interswitch:xmlParams></interswitch:xmlParams>
</interswitch:ValidateCustomer>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:interswitch="http://services.interswitchng.com/quicktellerservice/">
<SOAP-ENV:Body>
<interswitch:ValidateCustomerResponse>
<interswitch:ValidateCustomerResult></interswitch:ValidateCustomerResult>
</interswitch:ValidateCustomerResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:interswitch="http://services.interswitchng.com/quicktellerservice/">
<SOAP-ENV:Body>
<interswitch:VerifyBiller>
<interswitch:xmlParams></interswitch:xmlParams>
</interswitch:VerifyBiller>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:interswitch="http://services.interswitchng.com/quicktellerservice/">
<SOAP-ENV:Body>
<interswitch:VerifyBillerResponse>
<interswitch:VerifyBillerResult></interswitch:VerifyBillerResult>
</interswitch:VerifyBillerResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,11 @@
#include "interswitchH.h"
SOAP_NMAC struct Namespace interswitch_namespaces[] =
{
{"SOAP-ENV", "http://schemas.xmlsoap.org/soap/envelope/", "http://schemas.xmlsoap.org/soap/envelope/", NULL},
{"SOAP-ENC", "http://schemas.xmlsoap.org/soap/encoding/", "http://schemas.xmlsoap.org/soap/encoding/", NULL},
{"xsi", "http://www.w3.org/2001/XMLSchema-instance", "http://www.w3.org/*/XMLSchema-instance", NULL},
{"xsd", "http://www.w3.org/2001/XMLSchema", "http://www.w3.org/*/XMLSchema", NULL},
{"interswitch", "http://services.interswitchng.com/quicktellerservice/", NULL, NULL},
{NULL, NULL, NULL, NULL}
};

Some files were not shown because too many files have changed in this diff Show More