Skip to content

auto-gen: SDK changes (be3055ac) - #21

Draft
luismeli10 wants to merge 1 commit into
masterfrom
auto-gen/be3055ac-generic
Draft

luismeli10 wants to merge 1 commit into
masterfrom
auto-gen/be3055ac-generic

Conversation

@luismeli10

Copy link
Copy Markdown
Owner

Automated SDK code generation.

generation_id: be3055ac-f731-46f0-adb9-571e4ed2744d

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/OrderTransactionClient.php: unused PHP import: MercadoPago\Resources\Order\Transaction\UpdateTransaction
  • required targets were not modified: tests/MercadoPago/Client/Integration/Order/OrderClientITTest.php
  • [REQ-01] Restore the public OrderTransactionClient::update() return type and deserialization target to MercadoPago\Resources\Order\Transaction\UpdateTransaction (which may continue extending Payment for schema coverage), or otherwise add an explicitly compatible bridge. Remove any resulting obsolete import. Do not reference an unimported Payment class from the client namespace. (src/MercadoPago/Client/Order/OrderTransactionClient.php, src/MercadoPago/Resources/Order/Transaction/UpdateTransaction.php): The diff changes update(...): UpdateTransaction to update(...): Payment and deserializes Payment::class, but adds no use MercadoPago\Resources\Order\Payment;; the old UpdateTransaction import remains. In this namespace, the new type resolves to the unsupported/nonexistent MercadoPago\Client\Order\Payment, and the change also breaks the existing public return contract despite retaining the compatibility class.
  • [REQ-02] Represent the OpenAPI OrderTransactionPayment.payment_method.transaction_security.redirect_url field in the resource mapping. Add redirect_url with the appropriate nullable string type while retaining legacy url if it is required for public compatibility, and add fixture/test coverage proving deserialization. (src/MercadoPago/Resources/Order/TransactionSecurity.php, tests/MercadoPago/Resources/Mocks/Response/Order/updated_transaction.json, tests/MercadoPago/Client/Unit/Order/OrderTransactionClientUnitTest.php): The attached contract names the response field redirect_url. The changed TransactionSecurity resource still exposes url; the diff only revises that property's comment and does not add the required contract field.
  • [REQ-02] Do not narrow the existing public $data property type. Preserve array|object|null compatibility (or provide an equivalently backward-compatible API) while documenting/mapping the normal Order[] result shape. (src/MercadoPago/Resources/OrderSearch.php): OrderSearch::$data is changed from array|object|null to ?array. This is a public compatibility regression contrary to the approved requirement to avoid removing compatibility shapes.
  • [REQ-04] Make the Checkout Pro documentation and example describe only behavior evidenced by the attached Orders contract. Remove the unsupported claim/name that a manual Orders request itself is Checkout Pro, or implement the complete documented manual Orders lifecycle (create without transactions, add transactions, then process) without claiming a hosted Checkout Pro redirect. Ensure README wording distinguishes automatic creation from manual mode, which does require a separate transaction- ... custom checkout. For manual Orders it explicitly requires omitting transactions, adding them through /v1/orders/{id}/transactions, and then calling /process. The diff nevertheless labels CreateCheckoutPRO.php as a Checkout Pro flow and the README broadly says no separate transaction-creation step is required before processing. The removed checkout_url fixture field further confirms that the Orders response contract does not provide the hosted Checkout Pro redirect previously implied.
  • [REQ-03] Use valid UUID-formatted, operation-specific idempotency keys in integration tests for every operation whose header schema is format: uuid; do not reuse the order-create key for transaction update. Add/adjust assertions or request inspection where available so the required header contract is covered. (tests/MercadoPago/Client/Integration/Order/OrderTransactionClientITTest.php): OrderTransactionClientITTest generates keys with bin2hex(random_bytes(16)), which produces 32 hexadecimal characters without UUID separators and therefore does not satisfy the OpenAPI uuid format. The update call also reuses the same RequestOptions and key used for order creation rather than supplying a key for that distinct operation.
  • [REQ-03] Update representative Order response fixtures to include the contracted country_code field while retaining site_id only where deliberately testing backward-compatible extra fields. Add assertions for the contract field so the migration is not split between old and new identifiers. (tests/MercadoPago/Resources/Mocks/Response/Order/get_order_response.json, tests/MercadoPago/Resources/Mocks/Response/Order/order_search.json, tests/MercadoPago/Resources/Mocks/Response/Order/order_refu ... oPago/Resources/Mocks/Response/Order/order_refund_total.json, tests/MercadoPago/Client/Unit/Order/OrderClientUnitTest.php): The attached Order schema defines country_code. The diff migrates order.json, order_cancel.json, and order_process.json, but leaves site_id as the sole site field in get_order_response.json, order_search.json, order_refund_partial.json, and order_refund_total.json. This leaves the fixture migration inconsistent across get, search, and refund coverage.
  • REQ-01: The transaction update client currently has an unresolved return/deserialization class and does not preserve the existing public return contract.
  • REQ-02: Direct response-schema coverage and public compatibility are incomplete for transaction security and OrderSearch::$data.
  • REQ-03: Idempotency-header coverage and representative Order fixture migration remain incomplete.
  • REQ-04: CreateCheckoutPRO.php still presents an Orders manual request as Checkout Pro without the contract-defined manual transaction/process lifecycle.
  • REQ-05: README guidance contradicts the attached manual Orders behavior and attributes hosted Checkout Pro behavior to an Orders contract that does not define it.
  • ORD-001: src/MercadoPago/Client/Order/OrderTransactionClient.php references an unimported Payment type and abandons the compatible UpdateTransaction return type.
  • ORD-002: TransactionSecurity lacks the OpenAPI response field redirect_url.
  • ORD-003: OrderSearch::$data was incompatibly narrowed from array|object|null to ?array.
  • ORD-004: README and CreateCheckoutPRO.php still claim unsupported Checkout Pro-via-Orders behavior and contradict manual-mode sequencing.
  • ORD-005: Integration idempotency keys are not UUID-formatted and the update operation reuses the create key.
  • ORD-006: Order fixtures inconsistently retain site_id without the contracted country_code field.
  • Runtime and credential-dependent integration validation was unavailable within the stated review boundary; this does not require a repository change.

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