feat: Implement medusa payments provider (#13772)

* feat: Implement medusa payments provider

* chore: Improvements after testing

* chore: Add typings to medusa payments

* fix: Final changes to complete medusa payment provider

* update package

* fix: Final changes to complete medusa payment provider

---------

Co-authored-by: adrien2p <adrien.deperetti@gmail.com>
Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
This commit is contained in:
Stevche Radevski
2025-10-29 15:07:33 +01:00
committed by GitHub
co-authored by adrien2p Oli Juhl
parent 1defb3c29b
commit ef7b9b9375
19 changed files with 1182 additions and 23 deletions
@@ -5,6 +5,8 @@ import {
CancelPaymentOutput,
CapturePaymentInput,
CapturePaymentOutput,
RetrieveAccountHolderInput,
RetrieveAccountHolderOutput,
CreateAccountHolderInput,
CreateAccountHolderOutput,
DAL,
@@ -140,6 +142,21 @@ Please make sure that the provider is registered in the container and it is conf
return await provider.refundPayment(input)
}
async retrieveAccountHolder(
providerId: string,
input: RetrieveAccountHolderInput
): Promise<RetrieveAccountHolderOutput> {
const provider = this.retrieveProvider(providerId)
if (!provider.retrieveAccountHolder) {
this.#logger.warn(
`Provider ${providerId} does not support retrieving account holders`
)
return {} as unknown as RetrieveAccountHolderOutput
}
return await provider.retrieveAccountHolder(input)
}
async createAccountHolder(
providerId: string,
input: CreateAccountHolderInput