Postman collection
Payments Write

pixiPaySetAuthorizationStatus

Records the result of a payment authorization for an order, releases or keeps its HAL orderlines and writes a payment transaction log entry.

Used by an external payment provider (logged as pixi Apps Payment Provider) to report the outcome of an authorization for an order.

  1. The order is looked up by OrderNr in OrderHeader. From it the procedure reads the customer reference, billing address reference, currency code (Currency.CodeA) and the CustomerOf (shop) of the customer. It also calculates the sum of qty * price of all orderlines of the order that are currently in status HAL.
  2. Depending on Success:
    • 1 (authorized): orderlines in status HAL are set to ANG; the log entry gets transaction type AU and code AUTHORIZED.
    • 0 (declined, default): orderlines stay in status HAL; the log entry gets type DE and code AUTH DECLINED; the order's fail counter ccpSetFailTries is increased by 1.
  3. The order header is updated: ccpNumOfTries is increased by 1, CCPLastAuthCode = AuthCode, ccpPayID = AuthID, CCPPaymentInfoOK = Y, CCPReauthorizeYN = N, ccpSetFailLastTime and UpdateDate = current time, UpdateEmp = API Call PaySetAuth.
  4. All orderlines of the order with status HAL get the new status (see step 2), with UpdateEmp/UpdateDate set.
  5. A row is inserted into CCPTranLog with vendor AP, the shop (CustomerOf), the order number, Message as note, the calculated HAL amount as total amount, customer and billing address references and the currency code.

The call returns no result set.

Notes

  • All changes run in one transaction (or a savepoint if a transaction is already open). On error the changes are rolled back and log.InsertError (not attached) is called; the code itself does not re-raise the error, so the caller may receive no error indication.
  • If OrderNr does not exist, no order header or orderlines are updated, but a CCPTranLog row is still inserted with empty (NULL) shop, customer, address and currency values. No error is returned.
  • CCPPaymentInfoOK is set to Y and ccpSetFailLastTime is updated even when Success = 0.
  • ccpSetFailTries is incremented without ISNULL; if the column is NULL it stays NULL.
  • The amount is calculated via Order_Id, while the orderlines to update are selected via OrderNr.
  • Lookups use NOLOCK; updates use ROWLOCK.
  • AuthID, AuthCode and Message have no default and must be sent.

Tables used

OrderHeader · Write Orderlines · Write CCPTranLog · Write Customers · Read Currency · Read
SQL object:
dbo.pipiPaySetAuthorizationStatus
Updated at 2026-10-30