diff --git a/packages/core/src/service/services/payment.service.ts b/packages/core/src/service/services/payment.service.ts index c79ebf8013..d9aafbb33f 100644 --- a/packages/core/src/service/services/payment.service.ts +++ b/packages/core/src/service/services/payment.service.ts @@ -188,10 +188,6 @@ export class PaymentService { items: OrderItem[], payment: Payment, ): Promise { - const { paymentMethod, handler } = await this.paymentMethodService.getMethodAndOperations( - ctx, - payment.method, - ); const orderWithRefunds = await this.connection.getEntityOrThrow(ctx, Order, order.id, { relations: ['payments', 'payments.refunds'], }); @@ -224,6 +220,10 @@ export class PaymentService { state: 'Pending', metadata: {}, }); + const { paymentMethod, handler } = await this.paymentMethodService.getMethodAndOperations( + ctx, + paymentToRefund.method, + ); const createRefundResult = await handler.createRefund( ctx, input,