saleor icon indicating copy to clipboard operation
saleor copied to clipboard

Add a flag to `orderConfirm` to toggle whether payments / transactions should be captured

Open witoszekdev opened this issue 1 year ago • 4 comments

Problem

orderConfirm always captures all payments & transactions[^1]. This might be problematic for stores that want to capture the payment when making the fulfillment (e.g. product is a preorder, charge is made on shipment)


1. General Assumptions

Capture can be skipped when making orderConfirm mutation

Acceptance Criteria

  • Add a flag to orderConfirm that will skip captures on payments and transactions

2. API changes

Mutations

  """
  Confirms an unconfirmed order by changing status to unfulfilled.

  Requires one of the following permissions: MANAGE_ORDERS.
  """
  orderConfirm(
    """
    ID of an order to confirm.
    """
    id: ID!
    """
    By default authorized payments and transactions are automatically captured
    """
    captureFunds: Boolean
  ): OrderConfirm @doc(category: "Orders")

5. To Do list

### Tasks
- [ ] Add a draft title or issue reference here

6. To Test

  • [ ]
  • [ ]

[^1]: Still in progress https://github.com/saleor/saleor/issues/14346

witoszekdev avatar Oct 18 '23 14:10 witoszekdev

@korycins We could also make this a setting in ChannelSettings, rather than a parameter in the mutation

witoszekdev avatar Oct 18 '23 14:10 witoszekdev

@witoszekdev Yes, I agree. I discussed this with Patrys, and we will add new flag to the channel. It will determine if authorized orders should be charged when we have authorization.

korycins avatar Nov 10 '23 07:11 korycins

Also, forgot to mention. We will first extend the channel. The orderConfirm will get its own flag if we really get such a request from someone.

korycins avatar Nov 10 '23 07:11 korycins

The flag for channel is described here: https://github.com/saleor/saleor/issues/15242

korycins avatar Jan 17 '24 11:01 korycins