Skip to content

auto-gen: SDK changes (426fd930) - #20

Draft
luismeli10 wants to merge 2 commits into
masterfrom
auto-gen/426fd930-generic
Draft

luismeli10 wants to merge 2 commits into
masterfrom
auto-gen/426fd930-generic

Conversation

@luismeli10

Copy link
Copy Markdown
Owner

Automated SDK code generation.

generation_id: 426fd930-d471-4ad5-b5f6-a868161cedf4

Review required before merge.

@luismeli10 luismeli10 added php Flow tag propagated by spec-agent-generator. readme Flow tag propagated by spec-agent-generator. sdk Flow tag propagated by spec-agent-generator. labels Sep 29, 2026
@luismeli10

Copy link
Copy Markdown
Owner Author

Automated reviewer warnings

This pull request was created with the following advisory findings. Review them before merging:

  • src/MercadoPago/Client/Order/OrderClient.php: duplicate generated declaration or statement in one scope: ): Order
  • src/MercadoPago/Client/Order/OrderClient.php: duplicate generated declaration or statement in one scope: null,
  • tests/MercadoPago/Client/Unit/Order/OrderTransactionClientUnitTest.php: unused PHP import: MercadoPago\Net\HttpMethod
  • tests/MercadoPago/Client/Unit/Order/OrderTransactionClientUnitTest.php: unused PHP import: MercadoPago\Net\MPRequest
  • tests/MercadoPago/Client/Unit/Order/OrderTransactionClientUnitTest.php: unused PHP import: MercadoPago\Resources\Order\Transaction\UpdateTransaction
  • required targets were not modified: src/MercadoPago/Resources/Order/Payment.php, src/MercadoPago/Resources/Order/Transaction/UpdateTransaction.php
  • The approved resource-contract work is absent from the final diff: src/MercadoPago/Resources/Order.php, src/MercadoPago/Resources/OrderSearch.php, src/MercadoPago/Resources/Order/Config.php, src/MercadoPago/Resources/Order/IntegrationData.php, src/MercadoPago/Resources/Order/Items.php, src/MercadoPago/Resources/Order/OnlineConfig.php, src/MercadoPago/Resources/Order/Payer.php, src/MercadoPago/Resources/Order/Payment.php, src/MercadoPago/Resources/Order/PaymentMethod.php, src/MercadoPago/Resources/Order/Shipment.php, src/MercadoPago/Resources/Order/Transactions.php, src/MercadoPago/Resources/Order/TransactionSecurity.php, and src/MercadoPago/Resources/Order/Transaction/UpdateTransaction.php have no changes. Complete the planned mappings for the directly referenced Orders schemas, including country_code, client_token, transactions.payments, the response-only transactions.payments[].payment_method.transaction_security, and the OrderSearchResult.data/`pa
  • The approved mock and example updates are largely absent. In particular, none of the planned tests/MercadoPago/Resources/Mocks/Response/Order/*.json files is changed, and examples/Order/Transaction/Update.php and examples/Order/Transaction/Delete.php are unchanged. Update the affected fixtures/examples so they exercise the OpenAPI request and response shapes and required idempotency headers; do not limit the transaction example change to comments in examples/Order/Transaction/Create.php.
  • tests/MercadoPago/Client/Unit/Order/OrderClientUnitTest.php and tests/MercadoPago/Client/Integration/Order/OrderClientITTest.php only gain imports in the shown diff. Add bounded assertions for the changed Orders contract: /v1/orders search with begin_date and end_date, lifecycle paths and request bodies, required X-Idempotency-Key usage, country_code, client_token, transactions.payments, and nested response payment_method.transaction_security.
  • src/MercadoPago/Client/Order/OrderClient.php breaks PHP 8 named-argument compatibility by renaming public parameters: __construct(?MPHttpClient $MPHttpClient = null) became $http_client, get(string $order_id, ...) became $id, and search(MPSearchRequest $request, ...) became $search_request. Restore the established parameter names while retaining the new implementation.
  • src/MercadoPago/Client/Order/OrderClient.php removed rawurlencode() from order IDs and directly concatenates IDs in get() and executeAction(); the newly added updateTransaction() also directly concatenates both IDs. Restore encoding for every dynamic path segment to preserve prior behavior and safely construct /v1/orders/{...} URLs.
  • src/MercadoPago/Client/Order/OrderClient.php::updateTransaction() is an unplanned duplicate of OrderTransactionClient::update(), returns Order even though PUT /v1/orders/{order_id}/transactions/{transaction_id} returns an OrderTransactionPayment, and conflicts with the approved separation of transaction operations. Remove this method from OrderClient; keep and validate the operation in OrderTransactionClient, returning the existing UpdateTransaction/transaction-payment resource.
  • README.md places request transaction_security under transactions.payments[].payment_method and uses the unsupported payload {"type":"none"}. The attached contract places request configuration at config.online.transaction_security with validation and, when applicable, liability_shift; only the response security result is nested under payment_method.transaction_security. Correct the create example and keep the request/response distinction explicit.
  • README.md shows a partial refund as $client->refund("<ORDER_ID>", ["amount" => "25.00"], ...), but OrderRefundRequest requires a transactions array whose entries identify the transaction and amount. Replace it with a shape such as ["transactions" => [["id" => "<TRANSACTION_ID>", "amount" => "25.00"]]].
  • tests/MercadoPago/Client/Integration/Order/OrderTransactionClientITTest.php still calls $order_client->create($create_order_request) without RequestOptions in both shown transaction scenarios, although POST /v1/orders requires X-Idempotency-Key. Supply a distinct idempotency key to each order-creation call, not only to the subsequent transaction create/update calls.
  • README.md leaves the legacy heading ## 🌟 Getting started with payment via Checkout Pro immediately after adding ## 🌟 Getting started with Checkout Pro via Orders. Review that retained section and remove or revise any legacy Checkout Pro flow that contradicts the requested Orders-based flow; the changed documentation must not present two competing Checkout Pro implementations without an explicit compatibility distinction.
  • Live Order integration validation requires MercadoPago credentials and external API access unavailable to this review harness; this does not replace repository-level test corrections.

@luismeli10

Copy link
Copy Markdown
Owner Author

Automated reviewer warnings

This pull request was created with the following advisory findings. Review them before merging:

  • obsolete reference remains: $http_client (OrderClient::__construct)
  • required replacement is missing: get(string $order_id, (OrderClient::get)
  • required replacement is missing: ## 🌟 Legacy Checkout Pro via Preferences
  • required replacement is missing: ["transactions" => [["id" => "<TRANSACTION_ID>", "amount" => "25.00"]]]
  • required replacement is missing: {}
  • forbidden symbol remains in generated files: $http_client
  • replacement coverage incomplete for $http_client: remaining in tests/MercadoPago/Client/Unit/Order/OrderTransactionClientUnitTest.php
  • Faltan cambios en los targets obligatorios del contrato de respuestas de Orders: tests/MercadoPago/Resources/Mocks/Response/Order/order_cancel.json, order_capture.json, order_process.json, order_refund_partial.json, order_refund_total.json y order_search.json. Actualice esos fixtures para representar el contrato aprobado, incluidos config.online.transaction_security, integration_data cuando corresponda y transactions.refunds en las respuestas de reembolso.
  • Falta modificar el target obligatorio tests/MercadoPago/Resources/Mocks/Response/Payment/payment_base.json del contrato order-client-public-contract; aplique allí la actualización de fixture prevista o, si no corresponde al contrato, elimínelo explícitamente del siguiente plan en vez de dejar el target aprobado sin ejecutar.
  • tests/MercadoPago/Client/Unit/Order/OrderClientUnitTest.php no añade pruebas acotadas para los cambios públicos: solo renombra variables locales. Añada verificaciones de la ruta exacta con un order_id que necesite escape, de modo que get() y las acciones demuestren el uso de rawurlencode($order_id), y cubra la construcción mediante el argumento nombrado MPHttpClient:.
  • No hay aserciones mostradas que validen el mapeo nuevo de Order::$config, Order::$integration_data, OnlineConfig::$transaction_security ni transactions.refunds. Añada pruebas de recursos/cliente que deserialicen los fixtures actualizados y comprueben esos símbolos y rutas del contrato, no solo Order::class e id.
  • src/MercadoPago/Client/Order/OrderTransactionClient.php::update() todavía usa HttpMethod::PUT después de eliminar use MercadoPago\Net\HttpMethod;. Esto resuelve a la clase inexistente MercadoPago\Client\Order\HttpMethod y rompe la actualización en ejecución. Use \MercadoPago\Net\HttpMethod::PUT de forma consistente con create() o restaure una importación que realmente sea utilizada.
  • composer.json contiene únicamente eliminación y adición de líneas en blanco, sin implementar ningún requisito del contrato aprobado. Revierta este diff sin efecto para evitar cambios ajenos a la migración.
  • La validación de integración en vivo de Orders requiere credenciales de MercadoPago y acceso a la API externa, no disponibles en este entorno.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

php Flow tag propagated by spec-agent-generator. readme Flow tag propagated by spec-agent-generator. sdk Flow tag propagated by spec-agent-generator.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant