feat: add OAuth, Point and Invoice clients (v3.2.0)#114
Open
danielalfarourrea wants to merge 12 commits into
Open
feat: add OAuth, Point and Invoice clients (v3.2.0)#114danielalfarourrea wants to merge 12 commits into
danielalfarourrea wants to merge 12 commits into
Conversation
…change and refresh Enables marketplace and platform integrations to operate on behalf of other sellers via the OAuth 2.0 authorization code flow. Operations: - get_authorization_url(): builds https://auth.mercadopago.com/authorization?... - create(): POST /oauth/token (exchange authorization code for access token) - refresh(): POST /oauth/token (refresh expired token) Ref: sdk-php/src/MercadoPago/Client/OAuth/OAuthClient.php
- test_oauth: validates URL builder output and ValueError on non-dict input - test_point: validates HTTP response range and ValueError on non-dict input - test_invoice: validates HTTP response range for search operation
- examples/oauth/create_token.py: authorization URL + token exchange flow - examples/point/create_payment_intent.py: list devices, create and get payment intent - examples/invoice/get_invoice.py: search invoices by preapproval_id and get by ID
- resources/__init__.py: add Invoice, OAuth, Point imports and __all__ entries - sdk.py: add Invoice, OAuth, Point imports and factory methods (sdk.invoice(), sdk.oauth(), sdk.point())
New features in this release: - OAuth: authorization URL, token exchange and refresh (POST /oauth/token) - Point: payment intents and device management (/point/integration-api/...) - Invoice: get and search subscription invoices (GET /authorized_payments) Note: version bump in pyproject.toml and config.py requires approval before merge.
New features in this release: - OAuth: authorization URL, token exchange and refresh (POST /oauth/token) - Point: payment intents and device management (/point/integration-api/...) - Invoice: get and search subscription invoices (GET /authorized_payments)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
POST /oauth/token). Enables marketplace integrations via OAuth 2.0 authorization code flow.GET/POST/DELETE /point/integration-api/...). Enables card-present transactions via MercadoPago Point devices.GET /authorized_payments). Enables monitoring of PreApproval billing cycles.All changes are additive only — no existing code was modified or deleted.
Test plan
ACCESS_TOKEN=<token> python -m pytest tests/test_oauth.py tests/test_point.py tests/test_invoice.py -vexamples/oauth/,examples/point/,examples/invoice/run without errorsFiles changed
mercadopago/resources/oauth.py— newmercadopago/resources/point.py— newmercadopago/resources/invoice.py— newmercadopago/resources/__init__.py— added imports (additive)mercadopago/sdk.py— added factory methods (additive)mercadopago/config/config.py— version bump 3.1.1 → 3.2.0pyproject.toml— version bumpCHANGELOG.md— new file🤖 Generated with Claude Code