{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-@l10n/en/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["admonition"]},"type":"markdown"},"seo":{"title":"IPN Notifications - DirectBilling","description":"Znajdziesz tutaj wszystkie niezbędne informacje dotyczące integracji i obsługi systemu płatności SimPay.pl","siteUrl":"https://docs.simpay.pl"},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"ipn-notifications---directbilling","__idx":0},"children":["IPN Notifications - DirectBilling"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The SimPay system allows for asynchronous notification of your application about DirectBilling payment status changes ("," ","payments charged to the mobile carrier's bill). These notifications are sent via HTTP ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST"]}," requests with"," ","a body in ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["application/json"]}," format."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Unlike Online Payments, DirectBilling notifications use a single consistent structure – the notification simply"," ","updates the status for a specific transaction ID."]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"expected-server-response","__idx":1},"children":["Expected Server Response"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["For the notification to be considered successfully delivered, your IPN server must ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["absolutely"]}," return in the body"," ","a plain text response with the word ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["OK"]}," and an ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["HTTP 200"]}," status code."]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"notification-structure-json","__idx":2},"children":["Notification Structure (JSON)"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Each POST notification contains the following information in its body:"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"align":"left","data-label":"Field"},"children":["Field"]},{"$$mdtype":"Tag","name":"th","attributes":{"align":"left","data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"align":"left","data-label":"Description"},"children":["Description"]},{"$$mdtype":"Tag","name":"th","attributes":{"align":"left","data-label":"Example Value"},"children":["Example Value"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["id"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["string"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["Unique transaction ID in the SimPay system"]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["dc261d4f-31ef-4728-bfd6-97bbe2a5ef0a"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["serviceId"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["string"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["Your service identifier"]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["e14f8074"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["status"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["string"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["Current DirectBilling transaction status"]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["transaction_db_payed"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["values"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["object"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["Object with amount values"]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["values.net"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["number"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["Net transaction amount"]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["11.07"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["values.gross"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["number"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["Gross transaction amount"]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["13.61"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["values.partner"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["number"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["Your commission (earnings from the transaction)"]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["5"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["returns"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["object"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["Object with return addresses provided when generating the transaction"]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["returns.complete"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["string"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["Address the customer should be redirected to after success"]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["https://www.simpay.pl/complete"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["returns.failure"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["string"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["Address the customer should be redirected to after failure"]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["https://www.simpay.pl/failure"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["control"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["string"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["Your optional field (sent if it was provided when generating)"]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["order_123"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["number_from"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["string"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["Buyer's phone number from which the account was charged"]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["48123123123"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["provider"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["integer"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["GSM operator identifier"]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["1"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["signature"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["string"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["Cryptographic signature (SHA-256 hash) generated from field values"]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["a3116cf..."]}]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"available-transaction-statuses","__idx":3},"children":["Available Transaction Statuses"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["In IPN notifications for DirectBilling, you may encounter the following values in the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["status"]}," field:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["transaction_db_new"]}]}," – the transaction was successfully created in the system."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["transaction_db_confirmed"]}]}," – the transaction was confirmed by the operator (e.g., the customer entered the correct PIN),"," ","waiting for final funds collection."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["transaction_db_payed"]}]}," – the transaction was successfully paid (final success)."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["transaction_db_rejected"]}]}," – the transaction was ultimately rejected by the operator (e.g., insufficient funds on the"," ","account or an active Premium service block on the customer's number)."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["transaction_db_canceled"]}]}," – the transaction was canceled (e.g., due to PIN entry timeout or"," ","cancellation by the user)."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["transaction_db_generate_error"]}]}," – an error occurred during the attempt to generate the transaction directly at"," ","the GSM operator."]}]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info","name":"Tip"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["When you receive an IPN notification, always verify the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["status"]}," field. The expected value for a successfully completed"," ","DirectBilling process (based on which you deliver goods or services) is ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["transaction_db_payed"]}]},"."]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"example-json-payload","__idx":4},"children":["Example JSON Payload"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Below is a dump of a complete notification sent for a successful transaction (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["transaction_db_payed"]},")."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"id\": \"dc261d4f-31ef-4728-bfd6-97bbe2a5ef0a\",\n  \"serviceId\": \"e14f8074\",\n  \"status\": \"transaction_db_payed\",\n  \"values\": {\n    \"net\": 11.07,\n    \"gross\": 13.61,\n    \"partner\": 5\n  },\n  \"returns\": {\n    \"complete\": \"https://www.simpay.pl/complete\",\n    \"failure\": \"https://www.simpay.pl/failure\"\n  },\n  \"number_from\": \"48123123123\",\n  \"provider\": 1,\n  \"signature\": \"a3116cf4f1e960223c2cc3088bf387278b6675255209bdeaf96a2f316a2fadc1\"\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"calculating-the-signature","__idx":5},"children":["Calculating the Signature"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Verifying the cryptographic signature is an absolute requirement to ensure that the notification actually comes from"," ","SimPay."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The signature is generated by concatenating all received parameters (excluding the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["signature"]}," field) in"," ","exactly the order they appear in the documentation table. Values are separated by the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["|"]}," separator, and"," ","at the very end, your DirectBilling service IPN key (available in the client panel) is appended. If any optional field (e.g.,"," ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["control"]},") was not included in the request – simply skip it."]},{"$$mdtype":"Tag","name":"details","attributes":{},"children":[{"$$mdtype":"Tag","name":"summary","attributes":{},"children":["See signature calculation from the above example"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"em","attributes":{},"children":["(Assuming the test service key is ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["klucz"]},")"]}]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["We create a string, separating values with the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["|"]}," separator:"," ","Our base string will look like this:"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"dc261d4f-31ef-4728-bfd6-97bbe2a5ef0a|e14f8074|transaction_db_payed|11.07|13.61|5|https://www.simpay.pl/complete|https://www.simpay.pl/failure|48123123123|1\n"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"em","attributes":{},"children":["(Note: the optional ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["control"]}," field is missing from the JSON, so we completely skipped it)."]}]},{"$$mdtype":"Tag","name":"ol","attributes":{"start":2},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["We append our IPN key at the end:"," ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["...|klucz"]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["We calculate SHA256 from the above string and encode in hex:"]}]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"php","header":{"controls":{"copy":{}}},"source":"<?php\n\n$signature = hash('sha256', 'dc261d4f-31ef-4728-bfd6-97bbe2a5ef0a|e14f8074|transaction_db_payed|11.07|13.61|5|https://www.simpay.pl/complete|https://www.simpay.pl/failure|48123123123|1|klucz');\n","lang":"php"},"children":[]},{"$$mdtype":"Tag","name":"ol","attributes":{"start":4},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["The resulting hash (in this case ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["a3116cf4f1e960223c2cc3088bf387278b6675255209bdeaf96a2f316a2fadc1"]},") should be"," ","safely compared with the value sent in the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["signature"]}," field."]}]}]}]},"headings":[{"value":"IPN Notifications - DirectBilling","id":"ipn-notifications---directbilling","depth":1},{"value":"Expected Server Response","id":"expected-server-response","depth":2},{"value":"Notification Structure (JSON)","id":"notification-structure-json","depth":2},{"value":"Available Transaction Statuses","id":"available-transaction-statuses","depth":3},{"value":"Example JSON Payload","id":"example-json-payload","depth":2},{"value":"Calculating the Signature","id":"calculating-the-signature","depth":2}],"frontmatter":{"seo":{"title":"IPN Notifications - DirectBilling"}},"lastModified":"2026-05-13T09:55:40.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/en/notifications/directbilling","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}