saleor-dashboard icon indicating copy to clipboard operation
saleor-dashboard copied to clipboard

[Enhancement]: Use `orderMarkAsPaid` instead of `transactionCreate`

Open korycins opened this issue 1 year ago • 0 comments

Description of the enhancement

When I have order created from draft, the payment sections looks like below: image

I have mark-as-paid button and manual transaction button. mark-as-paid triggers orderMarkAsPaid mutation which is a dedicated mutation to cover the draft order - (same as for Payment plugins) - result object created by orderMarkAsPaid is controlled by https://docs.saleor.io/docs/3.x/api-reference/miscellaneous/objects/payment-settings#code-style-fontweight-normal-paymentsettingsbdefaulttransactionflowstrategybcodetransactionflowstrategyenum--. manual transaction triggers transactionCreate, which creates a transaction with chargedAmount received as an input.

The view should be cleaned up, to always show single button. Currently having two buttons could cause, that the staff users would not know which one should be picked (both of them create the transactionItem). I might be wrong, but I would expect something like:

  • Show order-mark-as-paid when order is from draft (https://docs.saleor.io/docs/3.x/api-reference/orders/objects/order#code-style-fontweight-normal-orderboriginbcodeorderoriginenum--) and not paid.
  • Show Manual transactions when order is not from draft.
    • Show Manual transactions when order is from draft but already has a transaction.

Additional information

No response

korycins avatar Nov 13 '23 10:11 korycins