Fix data
This commit is contained in:
@@ -1,8 +1 @@
|
|||||||
PORT = 6320
|
PORT = 9088
|
||||||
MONGO_URL = "mongodb://digifi:digifi@10.10.10.48:27017"
|
|
||||||
|
|
||||||
VERIFY_ME_ENDPOINT = "https://vapi.verifyme.ng/v1/verifications/identities/bvn"
|
|
||||||
VERIFY_ME_PUBLIC_KEY = "pk_live_9f4c2642862cb0190d3b72ca94579b2670fd797a124"
|
|
||||||
VERIFY_ME_PUBLIC_TEST_SECRET = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOjE1MjgzNywiZW52IjoidGVzdCIsImlhdCI6MTY1ODgyMzY0OH0.PszalhCuvCv6Y7kK41o3LuJh_R9kIlodbtWSi8HoFnI"
|
|
||||||
VERIFY_ME_PUBLIC_LIVE_SECRET = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOjE1MjgzNywiZW52IjoibGl2ZSIsImlhdCI6MTY1ODgyMzY0OH0.jGwa1S6BKr14-QC_0isfVdmhjo_geC1EgyqIh65fhY4"
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,15 +1,38 @@
|
|||||||
import User from "../model/cardModel.js";
|
import User from "../model/cardModel.js";
|
||||||
|
// Set your secret key. Remember to switch to your live secret key in production.
|
||||||
|
// See your keys here: https://dashboard.stripe.com/apikeys
|
||||||
|
const stripe = require('stripe')('sk_test_4eC39HqLyjWDarjtT1zdp7dc');
|
||||||
|
|
||||||
|
|
||||||
export const createCard = async (req,res)=>{
|
export const createCard = async (req,res)=>{
|
||||||
try {
|
try {
|
||||||
const userData = new User(req.body);
|
const userData = new User(req.body);
|
||||||
const { email } = userData;
|
const { email } = userData;
|
||||||
|
|
||||||
const userExist = await User.findOne({email});
|
|
||||||
if (userExist) {
|
const cardholder = await stripe.issuing.cardholders.create({
|
||||||
return res.status(400).json({message: "User already exixt"});
|
name: 'Jenny Rosen',
|
||||||
}
|
email: 'jenny.rosen@example.com',
|
||||||
const saveUser = await userData.save();
|
phone_number: '+18008675309',
|
||||||
|
status: 'active',
|
||||||
|
type: 'individual',
|
||||||
|
individual: {
|
||||||
|
first_name: 'Jenny',
|
||||||
|
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',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
res.status(200).json(saveUser);
|
res.status(200).json(saveUser);
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
Reference in New Issue
Block a user