cards update

This commit is contained in:
CHIEFSOFT\ameye
2024-10-30 18:11:07 -04:00
parent 8fc88042bd
commit dccfe373fd
+13 -37
View File
@@ -41,29 +41,6 @@ var cards = {
logger.info("READY FOR STRIPE CALL ",req_data);
logger.info("READY FOR STRIPE CALL ************************************************************************ AFTER ");
const DummyParam =
{
name: 'Dummy Rosen',
email: 'jenny.rosen@example.com',
phone_number: '+18008675309',
status: 'active',
type: 'individual',
individual: {
first_name: 'Dummy',
last_name: 'Rosen',
dob: {day: 1, month: 11, year: 1981},
},
billing: {
address: {
line1: '123 Main Street',
city: 'San Francisco',
state: 'CA',
postal_code: '94111',
country: 'US',
},
},
};
const ReqParam =
{
name: req_data.name,
@@ -94,11 +71,19 @@ var cards = {
logger.info("REQ=>", ReqParam);
stripe.issuing.cardholders.create(ReqParam).then((cardholder) => {
console.log(cardholder);
let resultItem = {
"result": cardholder,
"total_record": 0
}
next(null, resultItem); // pass control to the next handler
Qstring = " UPDATE members_card_request SET card_issue_id='"+cardholder.id+"' , status = 10, updated = now() " +
" WHERE uid::text = '" + data.request_uid +"'";
db.query(Qstring, async function (err, result) {
console.log(cardholder);
let resultItem = {
"result": cardholder,
"total_record": 0
}
next(null, resultItem); // pass control to the next handler
});
}).catch((error) => {
console.error(error);
let resultItem = {
@@ -108,15 +93,6 @@ var cards = {
next(null, resultItem);
});
// const cardholder = await stripe.issuing.cardholders.create(DummyParam);
// const cardholder = await stripe.issuing.cardholders.create(ReqParam);
// console.log(cardholder);
// let resultItem = {
// "result": cardholder,
// "total_record": 0
// }
// next(null, resultItem); // pass control to the next handler
} catch (e) {
next(e.message, null); // pass control to the next handler
}