feat(core-flows,payment,medusa,types): Refund reasons management API (#8436)
* feat(core-flows,payment,medusa,types): add ability to set and manage refund reasons * fix(payment): validate total amount when refunding payment (#8437) Co-authored-by: Carlos R. L. Rodrigues <37986729+carlos-r-l-rodrigues@users.noreply.github.com> * feature: introduce additional_data to the product endpoints (#8405) * chore(docs): Generated References (#8440) Generated the following references: - `product` * chore: align payment database schema * Update packages/core/core-flows/src/payment-collection/steps/create-refund-reasons.ts Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com> * chore: address review --------- Co-authored-by: Carlos R. L. Rodrigues <37986729+carlos-r-l-rodrigues@users.noreply.github.com> Co-authored-by: Harminder Virk <virk.officials@gmail.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
This commit is contained in:
@@ -22,6 +22,7 @@ import {
|
||||
PaymentSessionDTO,
|
||||
ProviderWebhookPayload,
|
||||
RefundDTO,
|
||||
RefundReasonDTO,
|
||||
UpdatePaymentCollectionDTO,
|
||||
UpdatePaymentDTO,
|
||||
UpdatePaymentSessionDTO,
|
||||
@@ -47,6 +48,7 @@ import {
|
||||
PaymentCollection,
|
||||
PaymentSession,
|
||||
Refund,
|
||||
RefundReason,
|
||||
} from "@models"
|
||||
import { joinerConfig } from "../joiner-config"
|
||||
import PaymentProviderService from "./payment-provider"
|
||||
@@ -67,6 +69,7 @@ const generateMethodForModels = {
|
||||
Payment,
|
||||
Capture,
|
||||
Refund,
|
||||
RefundReason,
|
||||
}
|
||||
|
||||
export default class PaymentModuleService
|
||||
@@ -76,6 +79,7 @@ export default class PaymentModuleService
|
||||
Payment: { dto: PaymentDTO }
|
||||
Capture: { dto: CaptureDTO }
|
||||
Refund: { dto: RefundDTO }
|
||||
RefundReason: { dto: RefundReasonDTO }
|
||||
}>(generateMethodForModels)
|
||||
implements IPaymentModuleService
|
||||
{
|
||||
@@ -784,6 +788,8 @@ export default class PaymentModuleService
|
||||
payment: data.payment_id,
|
||||
amount: data.amount,
|
||||
created_by: data.created_by,
|
||||
note: data.note,
|
||||
refund_reason_id: data.refund_reason_id,
|
||||
},
|
||||
sharedContext
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user