📁 File Manager Pro
v10.0.3 | PHP: 8.2.31
Server: LiteSpeed
2026-06-29 10:13:16
📂
/ (Root)
/
home
/
orkouolp
/
node_js
/
orkofarms.com
/
api
📍 /home/orkouolp/node_js/orkofarms.com/api
🔄 Refresh
✏️
Editing: getPaymentMethod.js
Writable
const stripeAPI = require('../stripe'); const getCustomer = require('../helpers/getCustomer'); async function getCards(req, res) { console.log('GET /get-payment-methods'); const { currentUser } = req, customer = await getCustomer(currentUser.uid); if(customer) { let cards; console.log("getCards:: customer:", customer); try { cards = await stripeAPI.paymentMethods.list({ customer: customer.id, type: 'card' }); console.log("getCards:: cards:", cards); return res.status(200).json(cards.data); } catch(error) { console.log(error); return res.status(200).json({ error: 'an error occured, unable to get cards' }); //400 } } res.status(200).json(null); //404 } module.exports = getCards;
💾 Save Changes
❌ Cancel