File tree Expand file tree Collapse file tree 5 files changed +46
-0
lines changed
Expand file tree Collapse file tree 5 files changed +46
-0
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ composer require yourpayments/php-api-client
343419 . [ Запрос отчёта в формате Json] ( src/Examples/getReportGeneral.php )
353520 . [ Запрос отчёта в виде графика] ( src/Examples/getReportChart.php )
363621 . [ Запрос быстрого отчёта по заказам для сверки] ( src/Examples/getReportOrder.php )
37+ 22 . [ Запрос детального отчета по заказу] ( src/Examples/getReportOrderDetails.php )
3738
3839## Ссылки
3940- [ НКО «Твои платежи»] ( https://YPMN.ru/ )
Original file line number Diff line number Diff line change 4949 case 'getReportGeneral ' :
5050 case 'getReportChart ' :
5151 case 'getReportOrder ' :
52+ case 'getReportOrderDetails ' :
5253 case 'getFasterPayment ' :
5354 case 'getBindingFasterPayment ' :
5455 case 'paymentByFasterBinding ' :
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ class ApiRequest implements ApiRequestInterface
2222 const REPORT_CHART_API = '/api/v4/reports/chart ' ;
2323 const REPORT_GENERAL_API = '/api/v4/reports/general ' ;
2424 const REPORT_ORDERS_API_V4 = '/api/v4/reports/orders ' ;
25+ const REPORT_ORDER_DETAILS_API = '/api/v4/reports/order-details ' ;
2526 const PODELI_MERCHANT_REGISTRATION_API = '/api/v4/registration/merchant/podeli ' ;
2627 const HOST = 'https://secure.ypmn.ru ' ;
2728 const SANDBOX_HOST = 'https://sandbox.ypmn.ru ' ;
@@ -461,11 +462,18 @@ public function sendReportGeneralRequest(array $params): array
461462 return $ this ->sendGetRequest (self ::REPORT_GENERAL_API . '/? ' . http_build_query ($ params ));
462463 }
463464
465+ /** @inheritdoc */
464466 public function sendReportOrderRequest (array $ params ): array
465467 {
466468 return $ this ->sendGetRequest (self ::REPORT_ORDERS_API_V4 . '/? ' . http_build_query ($ params ));
467469 }
468470
471+ /** @inheritdoc */
472+ public function sendReportOrderDetailsRequest (array $ params ): array
473+ {
474+ return $ this ->sendGetRequest (self ::REPORT_ORDER_DETAILS_API . '/? ' . http_build_query ($ params ));
475+ }
476+
469477 /**
470478 * Подпись запроса
471479 * @param MerchantInterface $merchant Мерчант
Original file line number Diff line number Diff line change @@ -118,6 +118,18 @@ public function sendReportChartUpdateRequest(array $params);
118118 */
119119 public function sendReportGeneralRequest (array $ params );
120120
121+ /**
122+ * Отправить запрос быстрого отчёта по заказам для сверки
123+ * @param array $params
124+ */
125+ public function sendReportOrderRequest (array $ params );
126+
127+ /**
128+ * Отправить запрос для получения детального отчета по заказу
129+ * @param array $params
130+ */
131+ public function sendReportOrderDetailsRequest (array $ params );
132+
121133 /** @return string Хост для отправки запросов */
122134 public function getHost () : string ;
123135
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ declare (strict_types=1 );
4+
5+ use Ypmn \ApiRequest ;
6+
7+ // Подключим файл, в котором заданы параметры мерчанта
8+ include_once 'start.php ' ;
9+
10+ // Получение отчета в формате JSON
11+
12+ // Создадим HTTP-запрос к API
13+ $ apiRequest = new ApiRequest ($ merchant );
14+ // Включить режим отладки (закомментируйте или удалите в рабочей программе!)
15+ $ apiRequest ->setDebugMode ();
16+ // Переключиться на тестовый сервер (закомментируйте или удалите в рабочей программе!)
17+ $ apiRequest ->setSandboxMode ();
18+
19+ $ data = [
20+ 'merchantPaymentReference ' => '2297597 ' ,
21+ ];
22+
23+ // Отправим запрос
24+ $ responseData = $ apiRequest ->sendReportOrderDetailsRequest ($ data );
You can’t perform that action at this time.
0 commit comments