saleor icon indicating copy to clipboard operation
saleor copied to clipboard

Prevent performing both transaction and payment checkout process at the same time

Open IKarbowiak opened this issue 9 months ago • 1 comments

Adjust the checkout process to prevent performing both transaction and payment checkout process at the same time.

  • Add validation in transactionInitialize and transactionProcess mutations - raise an error when the checkout is currently during the complete process.
  • Adjust the checkout flow selection:
    • choose the transaction flow if:
      • the checkout is fully authorized (checkout.authorize_status == CheckoutAuthorizeStatus.FULL)
      • OR the checkout is not fully authorized, has transactions and there is no active payment object
      • OR checkout amount is 0 and channel has TRANSACTION_FLOW chosen as marked_as_paid_strategy
    • choose the payment flow
      • there are no transactions
      • OR checkout is not fully authorized and has active payment

Impact

  • [ ] New migrations
  • [ ] New/Updated API fields or mutations
  • [ ] Deprecated API fields or mutations
  • [ ] Removed API types, fields, or mutations

Docs

  • [ ] Link to documentation:

Pull Request Checklist

  • [ ] Privileged queries and mutations are either absent or guarded by proper permission checks
  • [ ] Database queries are optimized and the number of queries is constant
  • [ ] Database migrations are either absent or optimized for zero downtime
  • [ ] The changes are covered by test cases
  • [ ] All new fields/inputs/mutations have proper labels added (ADDED_IN_X, PREVIEW_FEATURE, etc.)
  • [ ] All migrations have proper dependencies
  • [ ] All indexes are added concurrently in migrations
  • [ ] All RunSql and RunPython migrations have revert option defined

IKarbowiak avatar May 13 '24 06:05 IKarbowiak