Skip to content

feat: add OAuth, Point and Invoice clients (v3.2.0)#114

Open
danielalfarourrea wants to merge 12 commits into
masterfrom
feature/python-standardization
Open

feat: add OAuth, Point and Invoice clients (v3.2.0)#114
danielalfarourrea wants to merge 12 commits into
masterfrom
feature/python-standardization

Conversation

@danielalfarourrea
Copy link
Copy Markdown
Contributor

Summary

  • OAuth: authorization URL builder, token exchange and refresh (POST /oauth/token). Enables marketplace integrations via OAuth 2.0 authorization code flow.
  • Point: in-person payment intent management (GET/POST/DELETE /point/integration-api/...). Enables card-present transactions via MercadoPago Point devices.
  • Invoice: retrieval and search of subscription billing invoices (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 -v
  • All 6 new tests pass (3 OAuth, 2 Point, 1 Invoice)
  • No regressions in existing test suite
  • Examples in examples/oauth/, examples/point/, examples/invoice/ run without errors

Files changed

  • mercadopago/resources/oauth.py — new
  • mercadopago/resources/point.py — new
  • mercadopago/resources/invoice.py — new
  • mercadopago/resources/__init__.py — added imports (additive)
  • mercadopago/sdk.py — added factory methods (additive)
  • mercadopago/config/config.py — version bump 3.1.1 → 3.2.0
  • pyproject.toml — version bump
  • CHANGELOG.md — new file

🤖 Generated with Claude Code

…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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant