Skip to content

eupago Python SDK

PyPI version Python versions License: MIT

The first Python SDK for eupago, the Portuguese payment gateway.

Community SDK

This is an independent open-source project, not affiliated with or endorsed by eupago.

Quickstart

from decimal import Decimal
from eupago import EupagoClient

client = EupagoClient(api_key="your-key", sandbox=True)

payment = client.mbway.create_payment(
    order_id="ORD-001",
    amount=Decimal("49.90"),
    phone_number="912345678",
)

print(payment.transaction_id)  # "txn-abc-123"
print(payment.status)          # PaymentStatus.PENDING

Payment Methods

Method Description Module
MB WAY Mobile payment via push notification (5 min approval) client.mbway
Multibanco ATM / online-banking reference, paid 1–30 days later client.multibanco
Credit Card Hosted card form with 3D-Secure / OTP — supports auth+capture and recurring subscriptions client.credit_card
Apple Pay Apple Wallet token for iOS apps and Safari client.apple_pay
Google Pay Google Pay token for Android apps and Chrome client.google_pay
Pay By Link Single hosted URL — customer picks the method (MB WAY, Multibanco, Card, Apple/Google Pay, Cofidis…) client.pay_by_link
Refunds Total or partial refunds for any paid transaction (OAuth) client.refunds

Webhooks (cleartext and AES-256-CBC encrypted) and v1.0 / v2.0 parsing are covered by client.webhooks.parse(...) — see Webhooks.

Why this SDK?

  • Sync + Async — same client, _async suffix for async methods
  • Fully typedmypy --strict, full IDE autocomplete
  • Decimal — never float for money
  • Bilingual — documentation in Portuguese and English
  • Webhooks — parsing + HMAC-SHA256 verification
  • Safe retries — GET only, POST never retries (duplicate payment risk)

Next steps

  • Installation


    Install and configure in 2 minutes

    Get started

  • Payments


    Which method should you use? Decision guide

    Payments

  • Webhooks


    Receive payment notifications

    Webhooks

  • Recipes


    Complete guides for FastAPI, Django, Flask

    Recipes