fix: Allow setting the status of a payment session when updating (#12809)
This commit is contained in:
@@ -38,6 +38,11 @@ export interface CreatePaymentSessionStepInput {
|
||||
* Learn more in [this documentation](https://docs.medusajs.com/resources/commerce-modules/payment/payment-session#data-property).
|
||||
*/
|
||||
data?: Record<string, unknown>
|
||||
|
||||
/**
|
||||
* Holds custom data in key-value pairs.
|
||||
*/
|
||||
metadata?: Record<string, unknown>
|
||||
}
|
||||
|
||||
export const createPaymentSessionStepId = "create-payment-session"
|
||||
@@ -57,6 +62,7 @@ export const createPaymentSessionStep = createStep(
|
||||
amount: input.amount,
|
||||
data: input.data ?? {},
|
||||
context: input.context,
|
||||
metadata: input.metadata ?? {},
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
@@ -581,6 +581,11 @@ export interface PaymentSessionDTO {
|
||||
* @expandable
|
||||
*/
|
||||
payment?: PaymentDTO
|
||||
|
||||
/**
|
||||
* Holds custom data in key-value pairs.
|
||||
*/
|
||||
metadata?: Record<string, unknown>
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { BigNumberInput } from "../totals"
|
||||
import { PaymentCollectionStatus } from "./common"
|
||||
import { PaymentCollectionStatus, PaymentSessionStatus } from "./common"
|
||||
import {
|
||||
PaymentAccountHolderDTO,
|
||||
PaymentCustomerDTO,
|
||||
@@ -212,6 +212,11 @@ export interface CreatePaymentSessionDTO {
|
||||
* Necessary context data for the associated payment provider.
|
||||
*/
|
||||
context?: PaymentProviderContext
|
||||
|
||||
/**
|
||||
* Holds custom data in key-value pairs.
|
||||
*/
|
||||
metadata?: Record<string, unknown>
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -238,10 +243,20 @@ export interface UpdatePaymentSessionDTO {
|
||||
*/
|
||||
amount: BigNumberInput
|
||||
|
||||
/**
|
||||
* The status of the payment session.
|
||||
*/
|
||||
status?: PaymentSessionStatus
|
||||
|
||||
/**
|
||||
* Necessary context data for the associated payment provider.
|
||||
*/
|
||||
context?: PaymentProviderContext
|
||||
|
||||
/**
|
||||
* Holds custom data in key-value pairs.
|
||||
*/
|
||||
metadata?: Record<string, unknown>
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -257,7 +257,12 @@ export interface AuthorizePaymentOutput extends PaymentProviderOutput {
|
||||
/**
|
||||
* The result of updating a payment.
|
||||
*/
|
||||
export interface UpdatePaymentOutput extends PaymentProviderOutput {}
|
||||
export interface UpdatePaymentOutput extends PaymentProviderOutput {
|
||||
/**
|
||||
* The status of the payment, which will be stored in the payment session's `status` field.
|
||||
*/
|
||||
status?: PaymentSessionStatus
|
||||
}
|
||||
|
||||
/**
|
||||
* The result of deleting a payment.
|
||||
|
||||
Reference in New Issue
Block a user