No refund reversals
This commit is contained in:
@@ -30,6 +30,8 @@ enum { PARTNER_STRIPE };
|
||||
#define OFFER_REJECT 333
|
||||
#define OFFER_CANCEL 222
|
||||
#define OFFER_EXPIRE 444
|
||||
#define OFFER_NOREFU 445
|
||||
|
||||
#define OFFER_EXTEND 555
|
||||
|
||||
#define OFFER_SENDTOME 777
|
||||
|
||||
@@ -1193,6 +1193,8 @@ long WrenchConcludeJobsOffer(CVars in, CVars &out) {
|
||||
break;
|
||||
|
||||
case OFFER_EXPIRE: // note status 4
|
||||
case OFFER_NOREFU:
|
||||
|
||||
logfmt(logINFO, "WrenchConcludeJobsOffer() rc=OFFER_EXPIRE");
|
||||
if (load_db_record(out, "SELECT id AS offer_id,* FROM members_jobs_offer WHERE offer_code ='%s' AND status = 1", in["offer_code"].c_str())) {
|
||||
// valid load of offer needed
|
||||
@@ -1207,11 +1209,25 @@ long WrenchConcludeJobsOffer(CVars in, CVars &out) {
|
||||
y["dir"].set_valid(true);
|
||||
y["payment_id"] = out["payment_id"];
|
||||
y["payment_id"].set_valid(true);
|
||||
|
||||
if ( offer_result == OFFER_EXPIRE){
|
||||
if (WrenchRefundoffer(y, out) == PHP_CREATED_OK) {
|
||||
pgsql_exec("UPDATE members_jobs_offer SET status = 4 WHERE id = %lu AND offer_code='%s' ", offer_id, in["offer_code"].c_str());
|
||||
// REFUND THE MONEY
|
||||
//job_email(JOBS_OFFER_CANCEL_MAIL, in, out); // the email will come from offer table
|
||||
}
|
||||
}
|
||||
if ( offer_result == OFFER_NOREFU){
|
||||
pgsql_exec("UPDATE members_jobs_offer SET status = 4 WHERE id = %lu AND offer_code='%s' ", offer_id, in["offer_code"].c_str());
|
||||
}
|
||||
|
||||
|
||||
if (WrenchRefundoffer(y, out) == PHP_CREATED_OK) {
|
||||
pgsql_exec("UPDATE members_jobs_offer SET status = 4 WHERE id = %lu AND offer_code='%s' ", offer_id, in["offer_code"].c_str());
|
||||
// REFUND THE MONEY
|
||||
//job_email(JOBS_OFFER_CANCEL_MAIL, in, out); // the email will come from offer table
|
||||
}
|
||||
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user