Уведомления о входящих платежах на расчётный счет через Webhooks, приходит сломанный json массив.
Вот такая ерунда приходит от Точки(сломанный json):
eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJTaWRlUGF5ZXIiOiB7ImJhbmtDb2RlIjogIjA0NDUyNTk3NCIsICJiYW5rTmFtZSI6ICJcdTA0MTBcdTA0MWUgXCJcdTA0MjJcdTA0MzhcdTA0M2RcdTA0NGNcdTA0M2FcdTA0M2VcdTA0NDRcdTA0NDQgXHUwNDExXHUwNDMwXHUwNDNkXHUwNDNhXCIiLCAiYmFua0NvcnJlc3BvbmRlbnRBY2NvdW50IjogIjMwMTAxODEwMTQ1MjUwMDAwOTc0IiwgImFjY291bnQiOiAiNDA4MDI4MTAyMDAwMDAxMTU1NTIiLCAibmFtZSI6ICJcdTA0MThcdTA0MWRcdTA0MTRcdTA0MThcdTA0MTJcdTA0MThcdTA0MTRcdTA0MjNcdTA0MTBcdTA0MWJcdTA0MmNcdTA0MWRcdTA0MmJcdTA0MTkgXHUwNDFmXHUwNDIwXHUwNDE1XHUwNDE0XHUwNDFmXHUwNDIwXHUwNDE4XHUwNDFkXHUwNDE4XHUwNDFjXHUwNDEwXHUwNDIyXHUwNDE1XHUwNDFiXHUwNDJjIFx1MDQyMlx1MDQxMFx1MDQyMFx1MDQxMFx1MDQyMVx1MDQxZVx1MDQxMiBcdTA0MTBcdTA0MWRcdTA0MTRcdTA0MjBcdTA0MTVcdTA0MTkgXHUwNDEwXHUwNDFiXHUwNDE1XHUwNDFhXHUwNDIxXHUwNDEwXHUwNDFkXHUwNDE0XHUwNDIwXHUwNDFlXHUwNDEyXHUwNDE4XHUwNDI3IiwgImFtb3VudCI6ICIxMDAwIiwgImN1cnJlbmN5IjogIlJVQiIsICJpbm4iOiAiNjAyNTA5NDE3MTQwIiwgImtwcCI6IG51bGx9LCAiU2lkZVJlY2lwaWVudCI6IHsiYmFua0NvZGUiOiAiMDQ0NTI1OTk5IiwgImJhbmtOYW1lIjogIl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V3tE2iIBu5tTD3FZZUys8oU_Zt9XGOMR9PHSt7ip4iFz0QiLNiva0ePX2gmhOHWDSLnrY0aWBNfvub4MJzggiCTK7S5la2wbZHP60mAn8b_7AkwNKINCu6S2ACU-IVhhgYpvrsL1ws4fAk8oO4Px6-N3Srlk_6kzUDoWmLhgkxvL1c2FHMs8rTRvaLQRKSeHjI5XiWq64VoP7Eo2TfFp_m9YNub7W-UWGSuZOgN9FKGx6-cr7eaVFPprpNs1GQcA7aZnwf-MuAjf0YQbMEACj21p22tyIfbhdf8hc-FOfEaiv6LgrrDivKzRrgg
Заметили, что мусор в начале запроса и в конце разделяется точкой, а середине нормальные данные:
array(3) { [0]=> string(36) "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9" [1]=> string(1806) "eyJTaWRlUGF5ZXIiOiB7ImJhbmtDb2RlIjogIjA0NDUyNTk3NCIsICJiYW5rTmFtZSI6ICJcdTA0MTBcdTA0MWUgXCJcdTA0MjJcdTA0MzhcdTA0M2RcdTA0NGNcdTA0M2FcdTA0M2VcdTA0NDRcdTA0NDQgXHUwNDExXHUwNDMwXHUwNDNkXHUwNDNhXCIiLCAiYmFua0NvcnJlc3BvbmRlbnRBY2NvdW50IjogIjMwMTAxODEwMTQ1MjUwMDAwOTc0IiwgImFjY291bnQiOiAiNDA4MDI4MTAyMDAwMDAxMTU1NTIiLCAibmFtZSI6ICJcdTA0MThcdTA0MWRcdTA0MTRcdTA0MThcdTA0MTJcdTA0MThcdTA0MTRcdTA0MjNcdTA0MTBcdTA0MWJcdTA0MmNcdTA0MWRcdTA0MmJcdTA0MTkgXHUwNDFmXHUwNDIwXHUwNDE1XHUwNDE0XHUwNDFmXHUwNDIwXHUwNDE4XHUwNDFkXHUwNDE4XHUwNDFjXHUwNDEwXHUwNDIyXHUwNDE1XHUwNDFiXHUwNDJjIFx1MDQyMlx1MDQxMFx1MDQyMFx1MDQxMFx1MDQyMVx1MDQxZVx1MDQxMiBcdTA0MTBcdTA0MW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TA0M2JcdTA0MzBcdTA0MzNcdTA0MzBcdTA0MzVcdTA0NDJcdTA0NDFcdTA0NGYuIiwgImRvY3VtZW50TnVtYmVyIjogIjMyNCIsICJkYXRlIjogIjIwMjItMTItMDYifQ" [2]=> string(512) "KInvemakdLViymKuKfn_ENVIETH02u8KYlDLxBVXD-IHcJh64Jq7AZ6dvBkt0RrYO8Cpg3IJNPLjrgvx6VvDQg7gtlo2bqzxMjqHorY0-wqZ_q9jc14ogSCFulGB3cSYJRqgmaavKIVeiBWMLoJQ6FRw3Ry1y2DgML1HARYqErEt171G-W901n93VeBKSJrOeuk7eV3tE2iIBu5tTD3FZZUys8oU_Zt9XGOMR9PHSt7ip4iFz0QiLNiva0ePX2gmhOHWDSLnrY0aWBNfvub4MJzggiCTK7S5la2wbZHP60mAn8b_7AkwNKINCu6S2ACU-IVhhgYpvrsL1ws4fAk8oO4Px6-N3Srlk_6kzUDoWmLhgkxvL1c2FHMs8rTRvaLQRKSeHjI5XiWq64VoP7Eo2TfFp_m9YNub7W-UWGSuZOgN9FKGx6-cr7eaVFPprpNs1GQcA7aZnwf-MuAjf0YQbMEACj21p22tyIfbhdf8hc-FOfEaiv6LgrrDivKzRrgg" }
Декодируем серединку через base64_decode и затем json_decode:
Array ( [SidePayer] => Array ( [bankCode] => 044525974 [bankName] => АО "Тинькофф Банк" [bankCorrespondentAccount] => 30101810145250000974 [account] => 40802810200000115552 [name] => ИНДИВИДУАЛЬНЫЙ ПРЕДПРИНИМАТЕЛЬ ТАРАСОВ АНДРЕЙ АЛЕКСАНДРОВИЧ [amount] => 1000 [currency] => RUB [inn] => 602509417140 [kpp] => ) [SideRecipient] => Array ( [bankCode] => 044525999 [bankName] => ТОЧКА ПАО БАНКА "ФК ОТКРЫТИЕ" [bankCorrespondentAccount] => 30101810845250000999 [account] => 40702810601500084607 [name] => ООО "АЛЕКСПРОМ" [amount] => 1000 [currency] => RUB [inn] => 7708707791 [kpp] => 771801001 ) [purpose] => Монтаж гирлянды, НДС не облагается. [documentNumber] => 324 [date] => 2022-12-06 )
Проверим запрос подробнее с техническими специалистами и вернёмся с обратной связью.