mirror of
https://github.com/Litlyx/litlyx
synced 2025-12-09 23:48:36 +01:00
rewrite
This commit is contained in:
16
dashboard/server/api/pay/customer_info.ts
Normal file
16
dashboard/server/api/pay/customer_info.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
|
||||
import StripeService from '~/server/services/StripeService';
|
||||
|
||||
export default defineEventHandler(async event => {
|
||||
|
||||
const data = await getRequestData(event, { requireSchema: false, allowLitlyx: false });
|
||||
if (!data) return;
|
||||
|
||||
const { project } = data;
|
||||
|
||||
const customer = await StripeService.getCustomer(project.customer_id);
|
||||
if (customer?.deleted) return;
|
||||
|
||||
return customer?.address;
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user