{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["admonition"]},"type":"markdown"},"seo":{"title":"Zdarzenie: ipn:test","description":"Znajdziesz tutaj wszystkie niezbędne informacje dotyczące integracji i obsługi systemu płatności SimPay.pl","siteUrl":"https://docs.simpay.pl","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"zdarzenie-ipntest","__idx":0},"children":["Zdarzenie: ipn:test"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Zdarzenie ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ipn:test"]}," to specjalny, pomocniczy typ powiadomienia. Służy ono wyłącznie do weryfikacji połączenia pomiędzy"," ","systemem SimPay a Twoim serwerem (Endpointem IPN) oraz do sprawdzenia poprawności zaimplementowanego przez Ciebie"," ","algorytmu wyliczania sygnatury kryptograficznej."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Dzięki niemu możesz przetestować odbieranie webhooków bez konieczności inicjowania i opłacania rzeczywistych, testowych"," ","transakcji na bramce płatniczej."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"kiedy-wysyłany-jest-ten-event","__idx":1},"children":["Kiedy wysyłany jest ten event?"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Powiadomienie to nie jest generowane automatycznie przez ruch klientów. Jest wysyłane **tylko na Twoje wyraźne żądanie"," ","**, po kliknięciu odpowiedniego przycisku testowego w Panelu Klienta SimPay (w ustawieniach danej usługi)."]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"struktura-obiektu-data","__idx":2},"children":["Struktura obiektu ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Gdy pole ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["type"]}," w głównym obiekcie powiadomienia ma wartość ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ipn:test"]},", obiekt ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data"]}," jest bardzo uproszczony i zawiera"," ","następujące informacje:"]},{"$$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":"Pole"},"children":["Pole"]},{"$$mdtype":"Tag","name":"th","attributes":{"align":"left","data-label":"Typ"},"children":["Typ"]},{"$$mdtype":"Tag","name":"th","attributes":{"align":"left","data-label":"Opis"},"children":["Opis"]},{"$$mdtype":"Tag","name":"th","attributes":{"align":"left","data-label":"Przykładowa wartość"},"children":["Przykładowa wartość"]}]}]},{"$$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":["service_id"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["char(8)"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["Identyfikator usługi, dla której wyzwolono test"]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["e65c7519"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["nonce"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["string"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["Losowy ciąg znaków gwarantujący unikalność żądania"]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["01JVZCXGZ77DJTM08WMSX34ETQ"]}]}]}]}]}]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info","name":"Wskazówka"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Pole ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["nonce"]}," to losowy ciąg znaków generowany przy każdym kliknięciu testu w panelu. Sprawia on, że mimo niezmiennych"," ","innych parametrów usługi, ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["sygnatura powiadomienia za każdym razem będzie inna"]},". Dzięki temu masz pewność, że Twój"," ","serwer faktycznie liczy hash na żywo, a nie podaje zbuforowanej (zapisanej w cache) poprawnej odpowiedzi z poprzedniego"," ","testu."]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"przykładowy-payload-json","__idx":3},"children":["Przykładowy Payload JSON"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Poniżej znajduje się kompletny zrzut (payload) powiadomienia wysyłanego dla zdarzenia ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ipn:test"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"em","attributes":{},"children":["(Przykładowa sygnatura została wygenerowana przy użyciu klucza IPN: ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["UwSkKiIwlxIeOMF8MIq9iDkQWBTtjoJQ"]}]},". Możesz użyć"," ","tego klucza i poniższych danych do przetestowania swojego algorytmu walidacji)."]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"type\": \"ipn:test\",\n  \"notification_id\": \"0196fece-c3e7-71ba-ac8a-ac64056d7d6b\",\n  \"date\": \"2025-05-23T22:21:25+02:00\",\n  \"data\": {\n    \"service_id\": \"e65c7519\",\n    \"nonce\": \"01JVZCXGZ77DJTM08WMSX34ETQ\"\n  },\n  \"signature\": \"02df1a420def7e5de9b316d2bd1ef70796f50abc461561a85bb1243f0a08984d\"\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"details","attributes":{},"children":[{"$$mdtype":"Tag","name":"summary","attributes":{},"children":["Zobacz wyliczenie sygnatury"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Flatten wszystkich elementów po kolei + separacja ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["|"]},":"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Nasz ciąg będzie wyglądać tak:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"ipn:test|0196fece-c3e7-71ba-ac8a-ac64056d7d6b|2025-05-23T22:21:25+02:00|e65c7519|01JVZCXGZ77DJTM08WMSX34ETQ\n"},"children":[]},{"$$mdtype":"Tag","name":"ol","attributes":{"start":2},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Dodaj klucz IPN na końcu ciągu:"," ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["...|UwSkKiIwlxIeOMF8MIq9iDkQWBTtjoJQ"]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Oblicz SHA256 z powyższego ciągu i zakoduj go w hex:"]}]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"php","header":{"controls":{"copy":{}}},"source":"<?php\n\n$signature = hash('sha256', 'ipn:test|0196fece-c3e7-71ba-ac8a-ac64056d7d6b|2025-05-23T22:21:25+02:00|e65c7519|01JVZCXGZ77DJTM08WMSX34ETQ|UwSkKiIwlxIeOMF8MIq9iDkQWBTtjoJQ');\n","lang":"php"},"children":[]},{"$$mdtype":"Tag","name":"ol","attributes":{"start":4},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Porównaj bezpieczną funkcją porównującą (np. ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["hash_equals"]}," w PHP) obliczoną sygnaturę z tą przesłaną w polu"," ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["signature"]}," powiadomienia. W tym przypadku wynikiem hashowania będzie"," ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["02df1a420def7e5de9b316d2bd1ef70796f50abc461561a85bb1243f0a08984d"]},"."]}]}]}]},"headings":[{"value":"Zdarzenie: ipn:test","id":"zdarzenie-ipntest","depth":1},{"value":"Kiedy wysyłany jest ten event?","id":"kiedy-wysyłany-jest-ten-event","depth":2},{"value":"Struktura obiektu data","id":"struktura-obiektu-data","depth":2},{"value":"Przykładowy Payload JSON","id":"przykładowy-payload-json","depth":2}],"frontmatter":{"seo":{"title":"Zdarzenie: ipn:test"}},"lastModified":"2026-04-22T16:24:29.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/notifications/payment/events/ipn_test","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}