{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["admonition"]},"type":"markdown"},"seo":{"title":"Zdarzenie: transaction_refund:status_changed","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-transaction_refundstatus_changed","__idx":0},"children":["Zdarzenie: transaction_refund:status_changed"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Zdarzenie ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["transaction_refund:status_changed"]}," służy do informowania Twojej aplikacji o zmianach na ścieżce procesowania"," ","zwrotu środków dla klienta (tzw. refund)."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Ponieważ zwroty w systemach bankowych realizowane są asynchronicznie, nie otrzymujesz potwierdzenia o udanym zwrocie"," ","natychmiast w odpowiedzi na żądanie z API. Zamiast tego, Twój system dowiaduje się o ostatecznym wyniku operacji właśnie"," ","z tego powiadomienia IPN."]},{"$$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 jest wyzwalane za każdym razem, gdy zlecenie zwrotu zmienia swój status w systemie SimPay. Otrzymasz je"," ","w szczególności, gdy:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Zwrot zostanie pomyślnie przetworzony i środki zostaną wysłane do klienta (zmiana na status ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["refund_completed"]},")."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Zlecenie zwrotu zostanie odrzucone, np. z powodu niewystarczającego salda na Twoim koncie w SimPay lub zbyt starej"," ","transakcji (zmiana na ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["refund_rejected"]}," lub ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["refund_failed"]},")."]}]},{"$$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":["transaction_refund:status_changed"]},", obiekt ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data"]}," będzie"," ","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":["id"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["UUID"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["ID zwrotu w systemie SimPay"]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["0194837c-69df-71dd-adff-4b3058f3fb58"]}]}]},{"$$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"]},{"$$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":["status"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["RefundStatusEnum"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["Aktualny ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/payment/statuses#statusGroup=Statusy+zwrot%C3%B3w"},"children":["status zwrotu"]}," (np. ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["refund_completed"]},")"]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["refund_completed"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["amount"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["object"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["Obiekt informacji o kwocie"]},{"$$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":["amount.currency"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ISO 4217"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["Waluta, w której zlecono zwrot"]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PLN"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["amount.value"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["string"]}," (%.2f)"]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["Kwota, zlecona w zwrocie"]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["8.47"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["amount.wallet_currency"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ISO 4217"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["Waluta portfela, z którego pobrano środki na poczet zwrotu"]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["EUR"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["amount.wallet_value"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["string"]}," (%.2f)"]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["Kwota, którą ostatecznie pobrano z portfela (salda)"]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["2.00"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["transaction"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["object"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["Pole z informacjami o transakcji, której dotyczy ten zwrot"]},{"$$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":["transaction.id"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["UUID"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["ID pierwotnej transakcji SimPay"]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["00554475-7ebb-4f16-b30b-0ce21da1a03b"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["transaction.payment_channel"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["string"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["Kanał płatności, którym zapłacił płacący"]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["blik"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["transaction.payment_type"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["string"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["Typ/grupa metody płatności"]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["blik"]}]}]}]}]}]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info","name":"Wskazówka"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Gdy otrzymasz to powiadomienie, sprawdź pole ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["status"]},". Jeśli ma ono wartość ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["refund_completed"]}]},", oznacza to, że"," ","pieniądze zostały wysłane do klienta – w tym momencie powinieneś oznaczyć zwrot w swoim systemie księgowym /"," ","e-commerce jako zrealizowany i ewentualnie wysłać klientowi maila z powiadomieniem."]}]},{"$$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":["transaction_refund:status_changed"]},"."]},{"$$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\": \"transaction_refund:status_changed\",\n  \"notification_id\": \"0196ff00-376d-7399-a457-d166c9adf073\",\n  \"date\": \"2025-05-23T23:15:26+02:00\",\n  \"data\": {\n    \"id\": \"0194837c-69df-71dd-adff-4b3058f3fb58\",\n    \"service_id\": \"e65c7519\",\n    \"status\": \"refund_completed\",\n    \"amount\": {\n      \"currency\": \"PLN\",\n      \"value\": \"1.00\",\n      \"wallet_currency\": \"PLN\",\n      \"wallet_value\": \"1.00\"\n    },\n    \"transaction\": {\n      \"id\": \"e568d9ba-a85a-444c-87c4-3b1e431428d1\",\n      \"payment_channel\": \"paysafecard\",\n      \"payment_type\": \"paysafe\"\n    }\n  },\n  \"signature\": \"835819c5720c74f01b8d10a58b2dc43185f05379ea26f25a15158061f3bce10c\"\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":"transaction_refund:status_changed|0196ff00-376d-7399-a457-d166c9adf073|2025-05-23T23:15:26+02:00|0194837c-69df-71dd-adff-4b3058f3fb58|e65c7519|refund_completed|PLN|1.00|PLN|1.00|e568d9ba-a85a-444c-87c4-3b1e431428d1|paysafecard|paysafe\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', 'transaction_refund:status_changed|0196ff00-376d-7399-a457-d166c9adf073|2025-05-23T23:15:26+02:00|0194837c-69df-71dd-adff-4b3058f3fb58|e65c7519|refund_completed|PLN|1.00|PLN|1.00|e568d9ba-a85a-444c-87c4-3b1e431428d1|paysafecard|paysafe|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":["835819c5720c74f01b8d10a58b2dc43185f05379ea26f25a15158061f3bce10c"]},"."]}]}]}]},"headings":[{"value":"Zdarzenie: transaction_refund:status_changed","id":"zdarzenie-transaction_refundstatus_changed","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: transaction_refund:status_changed"}},"lastModified":"2026-04-22T16:24:29.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/notifications/payment/events/transaction_refund_status_changed","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}