Adjusted the email account
This commit is contained in:
@@ -70,6 +70,16 @@ database:
|
|||||||
};
|
};
|
||||||
|
|
||||||
mailsend:
|
mailsend:
|
||||||
|
{
|
||||||
|
from = "support@wrenchboard.com";
|
||||||
|
server = "smtp.gmail.com";
|
||||||
|
domain = "wrenchboard.com";
|
||||||
|
user = "support@wrenchboard.com";
|
||||||
|
pass = "may12002!";
|
||||||
|
name = "WrenchBoard Demo Support";
|
||||||
|
};
|
||||||
|
|
||||||
|
mailsend_no:
|
||||||
{
|
{
|
||||||
from = "dev-system@wrenchboard.com";
|
from = "dev-system@wrenchboard.com";
|
||||||
server = "smtp.gmail.com";
|
server = "smtp.gmail.com";
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
#ifndef __mx_history_h__
|
||||||
|
#define __mx_history_h__
|
||||||
|
|
||||||
|
#include "vars.h"
|
||||||
|
|
||||||
|
long WrenchPurchaseHx( CVars in, CVars &out );
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,80 @@
|
|||||||
|
|
||||||
|
// Account management toosl
|
||||||
|
#include "clog.h"
|
||||||
|
#include "cgi.h"
|
||||||
|
#include "input.h"
|
||||||
|
#include "wrenchboard_api.h"
|
||||||
|
#include "history.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 WrenchPurchaseHx( CVars in, CVars &out )
|
||||||
|
{
|
||||||
|
char vname[30];
|
||||||
|
long ret = PHP_API_BAD_PARAM;
|
||||||
|
|
||||||
|
logfmt( logINFO, "WrenchContractStatus()" );
|
||||||
|
out["result"] = "Yes i go to this back end";
|
||||||
|
|
||||||
|
try {
|
||||||
|
long member_id = REQ_LONG( in, "member_id", 1, -1 );
|
||||||
|
long limit = REQ_LONG( in, "limit", 1, -1 );
|
||||||
|
REQ_LONG( in, "page", 1, -1 );
|
||||||
|
REQ_STRING (in, "uid", 10, 100, "(.*)");
|
||||||
|
|
||||||
|
out["total_record"] = "0";
|
||||||
|
const PGresult *res;
|
||||||
|
res = pgsql_query("SELECT added::date AS added_date," \
|
||||||
|
" (CASE WHEN code ='MNCCD' THEN 'New Card Payment' " \
|
||||||
|
"WHEN code ='MRCCD' THEN 'Repeat Card Payment' " \
|
||||||
|
"ELSE '' END) AS description,amount*0.01 AS amount,fee*0.01 as fee,confirmation " \
|
||||||
|
"FROM members_payments " \
|
||||||
|
"WHERE member_id = %lu AND status = 1 ORDER BY id DESC LIMIT %lu",member_id,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), "added_date_%05d", i);
|
||||||
|
out[vname] = rec["added_date"];
|
||||||
|
|
||||||
|
snprintf(vname, sizeof (vname), "description_%05d", i);
|
||||||
|
out[vname] = rec["description"];
|
||||||
|
|
||||||
|
// amount | id | code | description | symbol | action_type | lorder | current_balance
|
||||||
|
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), "confirmation_%05d", i);
|
||||||
|
out[vname] = rec["confirmation"];
|
||||||
|
|
||||||
|
snprintf(vname, sizeof (vname), "card_icon_%05d", i);
|
||||||
|
out[vname] = rec["card_icon"];
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ret = PHP_API_OK;
|
||||||
|
out["status"] = "OK";
|
||||||
|
} catch (bad_parameter) {
|
||||||
|
logfmt(logINFO, "ERROR CALL long WrenchPurchaseHx(CVars in, CVars &out)");
|
||||||
|
}
|
||||||
|
|
||||||
|
logfmt( logINFO, "/WrenchPurchaseHx()" );
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
Reference in New Issue
Block a user