recipient add
This commit is contained in:
@@ -781,7 +781,61 @@ long WrenchBoardMobileSendMoney(CVars in, CVars &out){
|
||||
}
|
||||
break;
|
||||
case WRENCH_NEWBANK_ACCOUNT:
|
||||
CVars rp;
|
||||
REQ_STRING(in, "bank_uid", 3, 150, "(.*)");
|
||||
REQ_STRING(in, "account_no", 5, 15, "(.*)");
|
||||
|
||||
REQ_STRING(in, "country", 2, 3, "(.*)");
|
||||
REQ_STRING(in, "state", 2, 49, "(.*)");
|
||||
REQ_STRING(in, "city", 2, 49, "(.*)");
|
||||
|
||||
long account_type = REQ_LONG(in, "account_type", 1, -1);
|
||||
if ( load_db_record(wl, "SELECT firstname,lastname FROM members WHERE uid = '%s' ",in["uid"].c_str())> 0){
|
||||
rp["firstname"] = wl["firstname"]; rp["firstname"].set_valid( true );
|
||||
rp["lastname"] = wl["lastname"]; rp["lastname"].set_valid( true );
|
||||
/*
|
||||
wrenchboard=> SELECT * FROM bank_entity_codes WHERE uid = 'a2c6c1a2-5cf2-4396-8630-50c47da15316';
|
||||
country | channel | name | code | gid | status | bank_codes | uid
|
||||
---------+---------+-------------+------+-----+--------+------------+--------------------------------------
|
||||
NG | INTERSW | Access Bank | 044 | 1 | 1 | ACC044 | a2c6c1a2-5cf2-4396-8630-50c47da15316
|
||||
(1 row)
|
||||
|
||||
/var/www/html/public/wrenchboard/wrenchboard_class.php:208:
|
||||
array (size=12)
|
||||
'member_id' => int 1
|
||||
'sessionid' => string 'F9A1FB1098B7542EA6AFB627DBD5263638171883CA0CC951DC6C4FB184280EB3' (length=64)
|
||||
'uid' => string '3119b744-42ad-4834-bb83-b737588754ca' (length=36)
|
||||
'firstname' => string 'Firstn' (length=6)
|
||||
'lastname' => string 'Lastn' (length=5)
|
||||
'bank_code' => string '033' (length=3)
|
||||
'account_no' => string '1234567890' (length=10)
|
||||
'account_type' => int 1
|
||||
'country' => string 'NG' (length=2)
|
||||
'state' => string 'Lagos' (length=5)
|
||||
'city' => string 'Lagos' (length=5)
|
||||
'accitytion' => int 11176
|
||||
*/
|
||||
// Lets find the bank now
|
||||
if ( load_db_record(wl, "SELECT * FROM bank_entity_codes WHERE uid = '%s' AND country ='%s' ",in["bank_uid"].c_str(),in["TerminatingCountryCode"].c_str())> 0){
|
||||
rp["account_no"] = in["account_no"]; rp["account_no"].set_valid( true );
|
||||
rp["account_type"] = in["lastname"]; rp["account_type"].set_valid( true );
|
||||
rp["bank_code"] = wl["bank_code"]; rp["bank_code"].set_valid( true );
|
||||
rp["country"] = in["TerminatingCountryCode"]; rp["country"].set_valid( true );
|
||||
rp["state"] = in["state"]; rp["state"].set_valid( true );
|
||||
rp["city"] = in["city"]; rp["city"].set_valid( true );
|
||||
|
||||
long recipientid = member_addrecipient(rp, out);
|
||||
if (recipientid > 0 ){
|
||||
in["recipientid"] =recipientid; in["recipientid"].set_valid( true );
|
||||
in["bankid"] =recipientid; in["bankid"].set_valid( true );
|
||||
}
|
||||
else{
|
||||
out["status_message"] = "recipient_add_error";
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -206,6 +206,7 @@ long member_addrecipient(CVars in, CVars &out) {
|
||||
out["recipient_id"] = insert_db_record(DBS_VALID, "sendmoney_recipient", "sendmoney_recipient_id_seq", xx);
|
||||
|
||||
if (out["recipient_id"].Long() > 0) {
|
||||
load_db_record(out, "SELECT * FROM sendmoney_recipient WHERE id = %lu",out["recipient_id"].Long() );
|
||||
ret = out["recipient_id"].Long(); //PHP_API_OK;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user