Skip to content

Add StripeAgent for product/price catalog management (Espejo Digital)#125

Open
Copilot wants to merge 3 commits intomainfrom
copilot/add-product-and-price-creation
Open

Add StripeAgent for product/price catalog management (Espejo Digital)#125
Copilot wants to merge 3 commits intomainfrom
copilot/add-product-and-price-creation

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 8, 2026

The codebase lacked a reusable Stripe integration layer for creating products and prices, needed for the Espejo Digital digital-mirror pilot.

Changes

api/stripe_agent.py

  • Introduces StripeAgent class wrapping Stripe's Product and Price APIs
  • create_product_with_price(name, amount, currency) — creates a Product then a linked Price (amount in cents); returns normalized success/error dict
  • list_recent_activity(limit=5) — thin wrapper over stripe.Product.list for sync verification

tests/test_stripe_agent.py

  • 7 unit tests using unittest.mock.patch to cover success path, custom currency, StripeError handling, and list_recent_activity default/explicit limits

Usage

from stripe_agent import StripeAgent

agent = StripeAgent(os.getenv("STRIPE_SECRET_KEY"))

result = agent.create_product_with_price(
    name="Blazer Balmain Colección A/W",
    amount=145000,  # 1 450.00 €
)
# {"status": "success", "product_id": "prod_…", "price_id": "price_…", "name": "…"}

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 8, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
tryonyou-pilot Error Error Apr 8, 2026 1:47pm

Request Review

Copilot AI changed the title [WIP] Add product and price creation to StripeAgent Add StripeAgent for product/price catalog management (Espejo Digital) Apr 8, 2026
Copilot AI requested a review from LVT-ENG April 8, 2026 13:48
@LVT-ENG LVT-ENG marked this pull request as ready for review April 8, 2026 14:12
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.

2 participants