fix: export payment client types for production build
Some checks failed
Check / delivery-static (push) Has been cancelled
Check / api (push) Has been cancelled
Check / web (push) Has been cancelled

Co-Authored-By: Craft Agent <agents-noreply@craft.do>
This commit is contained in:
2026-10-15 09:39:26 +08:00
parent dc2efcde08
commit 68a2b4d892
7 changed files with 97 additions and 14 deletions

View File

@@ -1,6 +1,9 @@
import { api, type License } from './api'
export type Order = { id:number; order_no:string; customer_id:number; customer_name:string; product_id:number; product_name:string; amount_cents:number; currency:string; status:string; payment_reference:string|null; paid_at:string|null; license_id:number|null; created_at:string; updated_at:string }
export type Order = { id:number; order_no:string; customer_id:number; customer_name:string; product_id:number; product_name:string; amount_cents:number; currency:string; payment_channel?:string|null; payment_status?:string; status:string; payment_reference:string|null; paid_at:string|null; license_id:number|null; created_at:string; updated_at:string }
export type PaymentChannel = 'alipay' | 'wechat'
export type OrderPayment = { merchant_order_no:string; checkout_token:string; checkout_url:string; code_url:string; status:string }
export const createOrderPayment = (id:number,body:{channel:PaymentChannel;license_days:number},key:string) => api.post<{data:OrderPayment}>(`/orders/${id}/payment`,body,{headers:{'Idempotency-Key':key}})
export type NewOrder = { customer_id:number; product_id:number; amount_cents:number; currency:string }
export const listOrders = (page:number) => api.get<{data:Order[];meta:{total:number}}>('/orders',{params:{page,page_size:20}})
export const getOrder = (id:number) => api.get<{data:Order}>(`/orders/${id}`)