Вот пример кода
Сам json запрос
{"Envelope":{"Body":{"PaymentResponse":{"id":461735984,"attribute":[{"value":"RUB","key":"targetcurrencycode"},{"value":"2020-11-28T03:22:25.000+03:00","key":"yandexperformeddt"},{"value":"410017553711643","key":"yandexaccount"},{"value":"Выплата #161","key":"description"},{"value":"4","key":"typeid"},{"value":"-50","key":"sourceamount"},{"value":"Яндекс.Деньги","key":"targetalias"},{"value":"161","key":"clienttransaction"},{"value":" ","key":"errordescription"},{"value":"-1.5","key":"sourceamountfee"},{"value":"50","key":"targetamount"},{"value":"SUCCEED","key":"statusid"},{"value":"0","key":"haschildren"},{"value":"2020-11-28T03:22:25.000+03:00","key":"modified"},{"value":"13","key":"targetaccountid"},{"value":"services","key":"initby"},{"value":"WITHDRAWAL","key":"category"},{"value":"-51.5","key":"sourceamounttotal"},{"value":"RUB","key":"sourcecurrencycode"},{"value":"-51.5","key":"sourceaccounttotal"},{"value":"15422477","key":"sourceaccountid"}]}}}} { "Envelope": { "Header": { "Security": { "UsernameToken": { "Username": "", "Password": "" } } }, "Body": { "PaymentRequest": { "payer": "15422477", "payee": "13", "amount": "50", "isPayerAmount": true, "paymentPassword": "", "clientTransaction": "161", "description": "Выплата #161", "operationInfo": { "attribute": [ { "key": "YANDEXACCOUNT", "value": "410017553711643" } ] } } } } }
Сам код PHP
<?php
$json = '{"Envelope":{"Body":{"PaymentResponse":{"id":461735984,"attribute":[{"value":"RUB","key":"targetcurrencycode"},{"value":"2020-11-28T03:22:25.000+03:00","key":"yandexperformeddt"},{"value":"410017553711643","key":"yandexaccount"},{"value":"Выплата #161","key":"description"},{"value":"4","key":"typeid"},{"value":"-50","key":"sourceamount"},{"value":"Яндекс.Деньги","key":"targetalias"},{"value":"161","key":"clienttransaction"},{"value":" ","key":"errordescription"},{"value":"-1.5","key":"sourceamountfee"},{"value":"50","key":"targetamount"},{"value":"SUCCEED","key":"statusid"},{"value":"0","key":"haschildren"},{"value":"2020-11-28T03:22:25.000+03:00","key":"modified"},{"value":"13","key":"targetaccountid"},{"value":"services","key":"initby"},{"value":"WITHDRAWAL","key":"category"},{"value":"-51.5","key":"sourceamounttotal"},{"value":"RUB","key":"sourcecurrencycode"},{"value":"-51.5","key":"sourceaccounttotal"},{"value":"15422477","key":"sourceaccountid"}]}}}} { "Envelope": { "Header": { "Security": { "UsernameToken": { "Username": "", "Password": "" } } }, "Body": { "PaymentRequest": { "payer": "15422477", "payee": "13", "amount": "50", "isPayerAmount": true, "paymentPassword": "", "clientTransaction": "161", "description": "Выплата #161", "operationInfo": { "attribute": [ { "key": "YANDEXACCOUNT", "value": "410017553711643" } ] } } } } }';
$decode = json_decode($json);
echo $decode[0]['Envelope'];
выводить ничего