Decision on Transaction Success¶
To make a decision regarding the success of an operation (e.g. payment authorization or payment confirmation), the partner should:
- Wait for a notification from QIWI.
- Send a transaction status request to QIWI.
To understand the operation’s status, it is recommended to rely on the value of the status
field in the response to the status request for the corresponding operation. This helps mitigate risks associated with receiving false notifications, risks of data compromise if the «secret» in case the used for notification signature verification is leaked.
The transaction status request is recommended to be performed after receiving the notification.
Please note
If a notification is not received within 10 minutes of the transaction, it is necessary to request the status.
The sequence of actions to make a decision about the success of the operation, using the example of QIWI form payment, is illustrated below. In this example, payment is made using a single-step scenario.
%%{init: {
"sequence" : {
"wrap":true,
"messageFontSize":15,
"noteFontSize":14,
"actorMargin":
110 }}}%%
sequenceDiagram
participant С as Client
participant P as Partner
participant B as QIWI
С->>P: Payment using QIWI form
Note right of С: «Pay»
P->>+B: «QIWI Form Payment using the API» scenario
Note right of P: billId, flags:[SALE]
B->>-P:
Note left of B: Redirect to `successUrl`
rect rgb(255, 238, 223)
B->>+P: «Notification Handling» scenario
P-->>-B:
Note left of B: billId, paymentId, status:SUCCESS
end
rect rgb(230, 230, 230)
P->>+B: Invoice status request
Note right of P: billId
B-->>-P: Invoice status response
Note left of B: billId, status:PAID, paymentsData
end
P->>С: Communication with the client
The QIWI element on the diagram represents a combination of participants engaged in the payment process. The described requests can be found in the API documentation.
The scenarios referred to in the diagram can be found in the following articles: