Skip to content
Last updated

Event: transaction:status_changed

The transaction:status_changed event is the most important element of online payment integration. It informs your system about every change in the state (lifecycle) of a specific transaction initiated by the customer.

It is based on this event that your store should make business decisions – e.g., deliver the purchased goods to the customer (when the status changes to paid) or restore products to inventory (when the payment expires or is rejected).

When Is This Event Sent?

This notification is triggered asynchronously every time a payment transaction moves to a new stage in the SimPay system. You will receive it, among others, when:

  • The bank or operator ultimately confirms receipt of funds (change to transaction_paid status).
  • The payment attempt is rejected by the customer's bank due to insufficient funds (change to transaction_failure).
  • The customer does not pay for the order within the designated time and the payment gateway is closed (change to transaction_expired).

data Object Structure

When the type field in the main notification object has the value transaction:status_changed, the data object will contain the following information:

FieldTypeDescriptionExample Value
idUUIDTransaction ID sent after generating the transaction00554475-7ebb-4f16-b30b-0ce21da1a03b
payer_transaction_idchar(8)Transaction ID shown to the payer on the gateway screen4878R2PN
service_idchar(8)Service identifier (in SimPay Flow - parent service ID)e65c7519
statusTransactionStatusEnumCurrent transaction status (e.g., transaction_paid, transaction_failure)transaction_paid
amountobjectAmount information object
amount.final_currencyISO 4217Currency in which the payer made the paymentPLN
amount.final_valuestring (%.2f)Final amount paid by the payer (e.g., "0.30", "10.00", "12.37")8.47
amount.original_currencyISO 4217Currency declared at payment initiationEUR
amount.original_valuestring (%.2f)Amount declared at payment initiation (e.g., "0.30", "10.00", "12.37")2.00
amount.commission_systemstring (%.2f) or nullCommission amount charged by SimPay (e.g., "0.30", "10.00", "12.37")0.13
amount.commission_partnerstring (%.2f) or nullCommission amount for the Partner (e.g., "0.30", "10.00", "12.37")0.13
amount.commission_currencyISO 4217 or nullCurrency in which the commission was charged (PLN/EUR)PLN
amount.commission_flowstring (%.2f) or absentSimPay Flow commission (submerchant transactions only, when greater than zero)0.25
controlstringField sent only when it was passed during payment initiationSHOP_ORDER_1
paymentobjectPayment method information field
payment.channelstringPayment channel used by the payer (see: Direct Channels)blik
payment.typestringType/group of payment methodblik
customerobjectPayer information object
customer.country_codeISO 3166-1 Alpha-2 or nullBuyer's country (e.g., "PL")PL
paid_atISO 8601 or nullPayment date and time (may not be sent when the transaction is not paid)2025-05-26T15:10:24Z
created_atISO 8601Transaction creation date and time2025-05-26T15:09:59Z
flowobject or absentOnly for SimPay Flow submerchants
flow.submerchant_idstringSubmerchant IDflsm_aaaabbbb
flow.submerchant_custom_idstringSubmerchant customIduser-123
flow.flow_service_idstringFlow service IDflow_aaaabbbb
Tip

To check order payment, always verify the status field. The expected value for a successfully completed process is transaction_paid. You should also absolutely check that amount.original_value and amount.original_currency match the amount stored in your database for the given order.


Example JSON Payload

Below is a complete dump (payload) of the notification sent for the transaction:status_changed event (in this case a rejected transaction – transaction_failure).

(The example signature was generated using the IPN key: UwSkKiIwlxIeOMF8MIq9iDkQWBTtjoJQ. You can use this key and the data below to test your validation algorithm).

{
  "type": "transaction:status_changed",
  "notification_id": "0196fec6-7a61-7219-9458-bcc45237c252",
  "date": "2025-05-23T22:12:22+02:00",
  "data": {
    "id": "dbc87423-b121-4ad4-977f-b63c3d3831e8",
    "payer_transaction_id": "Q68KLAKN",
    "service_id": "e65c7519",
    "status": "transaction_failure",
    "amount": {
      "final_currency": "PLN",
      "final_value": "8.00",
      "original_currency": "PLN",
      "original_value": "8.00",
      "commission_system": "0.06",
      "commission_partner": "7.94",
      "commission_currency": "PLN"
    },
    "control": "3e63e31d-f08d-4942-a223-3bad2dce8096",
    "payment": {
      "channel": "blik",
      "type": "blik"
    },
    "customer": {
      "country_code": null
    },
    "created_at": "2024-08-10T15:41:50+02:00"
  },
  "signature": "095a7be5d77c4bab667dbd0f35d9b1cb0c9cec50d8af42842cc37a95b233925e"
}
See signature calculation
  1. Flatten all elements sequentially + | separation:

Our string will look like this:

transaction:status_changed|0196fec6-7a61-7219-9458-bcc45237c252|2025-05-23T22:12:22+02:00|dbc87423-b121-4ad4-977f-b63c3d3831e8|Q68KLAKN|e65c7519|transaction_failure|PLN|8.00|PLN|8.00|0.06|7.94|PLN|3e63e31d-f08d-4942-a223-3bad2dce8096|blik|blik||2024-08-10T15:41:50+02:00
  1. Append the IPN key at the end of the string: ...|UwSkKiIwlxIeOMF8MIq9iDkQWBTtjoJQ
  2. Calculate SHA256 from the above string and encode it in hex:
<?php

$signature = hash('sha256', 'transaction:status_changed|0196fec6-7a61-7219-9458-bcc45237c252|2025-05-23T22:12:22+02:00|dbc87423-b121-4ad4-977f-b63c3d3831e8|Q68KLAKN|e65c7519|transaction_failure|PLN|8.00|PLN|8.00|0.06|7.94|PLN|3e63e31d-f08d-4942-a223-3bad2dce8096|blik|blik||2024-08-10T15:41:50+02:00|UwSkKiIwlxIeOMF8MIq9iDkQWBTtjoJQ');
  1. Compare using a secure comparison function (e.g., hash_equals in PHP) the calculated signature with the one sent in the signature field of the notification.