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

Add docs for order and checkout to explain how `authorizeStatus` and `chargeStatus` work

Open korycins opened this issue 1 year ago • 1 comments

  • Order & Checkout should have an explanation how authorizeStatus and chargeStatus work
    • What are the possible values for the field.
    • What each specific value means for checkout/order
  • The checkout or Payment chapter should also receive the section that will explain when checkoutComplete can be called (what status values allow to place the order).

korycins avatar Oct 31 '23 10:10 korycins

  • Checkout.authorizeStatus - The status is calculated based on all transactions assigned to the checkout. authorize means, that we have authorized or charged funds (or partially charged and partially authorized). It takes into account fields: authorizedAmount, chargedAmount, authorizePendingAmount, chargePendingAmount: NONE - the funds are not authorized PARTIAL - the cover funds don't cover fully the checkout's total. FULL - the funds cover the checkout's total. checkoutComplete can be called to convert checkout to order. The result for pending amounts (success/failure) will be provided by the payment app later, so it means that we can end up with the created order, that is not paid - as the pending amount has been converted to failure.

  • Checkout.chargeStatus - the status is calculated based on all transaction assigned to the checkout. It takes into account fields: chargedAmount, chargePendingAmount:

    NONE - the funds are not charged. PARTIAL - the funds that are charged don't cover the checkout's total FULL - the funds that are charged fully cover the checkout's total. checkoutComplete can be called to convert checkout to order. The result for pending amounts (success/failure) will be provided by the payment app later, so it means that we can end up with the created order, that is not paid - as the pending amount has been converted to failure. OVERCHARGED - the charged funds are bigger than checkout's total. checkoutComplete can be called to convert checkout to order.


  • Order.authorizeStatus - The status is calculated based on all transactions assigned to the order. authorize means, that we have authorized or charged funds (or partially charged and partially authorized). The status doesn't take into account pending amounts (difference between checkout and order authorize statuses). It takes into account fields: authorizedAmount, chargedAmount. The amount used to calculate the status is reduced by order.totalGrantedRefund: NONE - the funds are not authorized PARTIAL - the funds that are authorized and charged don't cover fully the order.total-order.totalGrantedRefund FULL - the funds that are authorized and charged fully cover the order.total-order.totalGrantedRefund

  • Order.chargeStatus - the status is calculated based on all transaction assigned to the order. It takes into account fields: chargedAmount. The status doesn't take into account pending amounts (difference between checkout and order charge statuses). The amount used to calculate the status is reduced by order.totalGrantedRefund: NONE - the funds are not charged. PARTIAL - the funds that are charged don't cover the order.total-order.totalGrantedRefund FULL - the funds that are charged fully cover the order.total-order.totalGrantedRefund OVERCHARGED - the charged funds are bigger than the order.total-order.totalGrantedRefund

korycins avatar Jan 15 '24 11:01 korycins