chore(types,utils): fixes to TSDocs for HTTP types and payment provider (#12102)

This commit is contained in:
Shahed Nasser
2025-04-07 16:08:39 +03:00
committed by GitHub
parent 1377eaadcd
commit 2be03d0d39
2 changed files with 10 additions and 0 deletions

View File

@@ -170,6 +170,11 @@ export interface BaseProductVariant {
manage_inventory: boolean | null
/**
* The variant's inventory quantity if `manage_inventory` is enabled.
* This field is only retrieved in the [Get Product](https://docs.medusajs.com/api/store#products_getproductsid)
* and [List Products](https://docs.medusajs.com/api/store#products_getproducts) API routes if you
* pass `+variants.inventory_quantity` in the `fields` query parameter.
*
* Learn more in the [Retrieve Product Variant's Inventory](https://docs.medusajs.com/resources/storefront-development/products/inventory) storefront guide.
*/
inventory_quantity?: number
/**

View File

@@ -486,6 +486,11 @@ export abstract class AbstractPaymentProvider<TConfig = Record<string, unknown>>
* ): Promise<UpdatePaymentOutput> {
* const { amount, currency_code, context } = input
* const externalId = input.data?.id
*
* // Validate context.customer
* if (!context || !context.customer) {
* throw new Error("Context must include a valid customer.");
* }
*
* // assuming you have a client that updates the payment
* const response = await this.client.update(