AND length(stripe_card_id)> 0
This commit is contained in:
@@ -39,7 +39,9 @@ long WrenchUsersCCardList(CVars in, CVars &out) {
|
||||
|
||||
out["total_record"] = "0";
|
||||
const PGresult *res;
|
||||
res = pgsql_query("SELECT type,digits,firstname,lastname,description,uid,added_dt::date,status,active FROM creditcard WHERE active = 1 AND member_id = %lu", in["member_id"].Long());
|
||||
res = pgsql_query("SELECT type,digits,firstname,lastname,description,uid,added_dt::date,status,active "
|
||||
" FROM creditcard WHERE active = 1 "
|
||||
" AND length(stripe_card_id)> 0 AND member_id = %lu", in["member_id"].Long());
|
||||
|
||||
if (res != NULL && pgsql_num_rows(res) > 0) {
|
||||
out["total_record"] = pgsql_num_rows(res);
|
||||
|
||||
@@ -322,7 +322,7 @@ long stripe_charge_member_paymentid(CVars in, CVars &out) {
|
||||
|
||||
|
||||
if (load_db_record(out, "SELECT stripe_customer_id FROM members WHERE id=%lu AND stripe_customer_id IS NOT NULL", in["member_id"].Long()) > 0) {
|
||||
if (load_db_record(out, "SELECT stripe_card_id,currency FROM creditcard WHERE id=%lu AND member_id=%lu AND stripe_card_id IS NOT NULL", in["card_id"].Long(), in["member_id"].Long()) > 0) {
|
||||
if (load_db_record(out, "SELECT stripe_card_id,currency FROM creditcard WHERE id=%lu AND member_id=%lu AND stripe_card_id IS NOT NULL AND length(stripe_card_id)> 0 ", in["card_id"].Long(), in["member_id"].Long()) > 0) {
|
||||
// Set card as a default funding source
|
||||
const char *entity = "default_source";
|
||||
snprintf(customer, sizeof (customer), "%s", out["stripe_customer_id"].c_str());
|
||||
|
||||
Reference in New Issue
Block a user