fix(payments): show already refunded amount, limit new refund to remaining
This commit is contained in:
@@ -300,6 +300,7 @@ export interface PaymentTransaction {
|
||||
id: string; provider: string; providerPaymentId: string | null;
|
||||
orderId: string | null; amountCents: number; currency: string;
|
||||
status: string; raw: unknown; createdAt: string;
|
||||
refundedAmountCents?: number; // amount already refunded
|
||||
}
|
||||
export const paymentsApi = {
|
||||
list: (params?: { limit?: number; offset?: number; status?: string; q?: string }) => {
|
||||
|
||||
@@ -219,6 +219,7 @@ export async function registerPaymentsRoutes(
|
||||
status: r.status,
|
||||
raw: r.raw,
|
||||
createdAt: r.created_at,
|
||||
refundedAmountCents: r.refunded_amount_cents ?? 0,
|
||||
})),
|
||||
total,
|
||||
});
|
||||
|
||||
4
project/storefront/next-env.d.ts
vendored
4
project/storefront/next-env.d.ts
vendored
@@ -1,7 +1,7 @@
|
||||
/// <reference types="next" />
|
||||
/// <reference types="next/image-types/global" />
|
||||
import "./.next/dev/types/routes.d.ts";
|
||||
import "./.next/dev/types/root-params.d.ts";
|
||||
import "./.next/types/routes.d.ts";
|
||||
import "./.next/types/root-params.d.ts";
|
||||
|
||||
// NOTE: This file should not be edited
|
||||
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
|
||||
|
||||
Reference in New Issue
Block a user