(ctx: RequestContext, input: DeepPartial<Payment>) => Promise<Payment>(ctx: RequestContext, id: ID, relations: string[] = ['order']) => Promise<Payment>Loads a Payment by id with no Channel check. Payment is not ChannelAware, so callers must first
load the parent Order in the current Channel (or use a path which does, such as the private
getPaymentInChannelOrThrow used by the payment mutations). The only core caller is the
Refund.lines field resolver, which is reached from an Order already loaded in the current
Channel.
(ctx: RequestContext, paymentId: ID, state: PaymentState) => Promise<Payment | PaymentStateTransitionError>Transitions a Payment to the given state.
When updating a Payment in the context of an Order, it is
preferable to use the OrderService transitionPaymentToState() method, which will also handle
updating the Order state too.
(payment: Payment) => readonly PaymentState[](ctx: RequestContext, order: Order, amount: number, method: string, metadata: any) => Promise<Payment | IneligiblePaymentMethodError>Creates a new Payment.
When creating a Payment in the context of an Order, it is
preferable to use the OrderService addPaymentToOrder() method, which will also handle
updating the Order state too.
(ctx: RequestContext, paymentId: ID) => Promise<PaymentStateTransitionError | Payment>Settles a Payment.
When settling a Payment in the context of an Order, it is
preferable to use the OrderService settlePayment() method, which will also handle
updating the Order state too.
(ctx: RequestContext, paymentId: ID) => Promise<PaymentStateTransitionError | Payment>(ctx: RequestContext, order: Order, amount: number, input: ManualPaymentInput) => Creates a Payment from the manual payment mutation in the Admin API
When creating a manual Payment in the context of an Order, it is
preferable to use the OrderService addManualPaymentToOrder() method, which will also handle
updating the Order state too.
(ctx: RequestContext, input: RefundOrderInput, order: Order, selectedPayment: Payment) => Promise< Refund | RefundStateTransitionError | RefundAmountError | RefundDestinationError | RefundIncompleteError >Creates one or more Refunds against the Payments of the given Order.
By default the refund is drawn from the specified Payment, and if the amount to be refunded exceeds that Payment's remaining refundable balance (in the case of multiple payments on a single Order), the outstanding amount is refunded against the next available Payment.
Alternatively, input.targets may be used to split the refund explicitly over several
Payments and/or RefundDestinationStrategy destinations. Every target is resolved and
validated before any Refund is created, so an invalid target rejects the whole operation
without any funds having been moved.
When creating a Refund in the context of an Order, it is
preferable to use the OrderService refundOrder() method, which performs additional
validation.
Architecture reviews, custom plugin work, migrations, ongoing support. Get a hand from the team that builds Vendure.
Talk to the team