Skip to content

feat(stripe): shared infrastructure for the stripe refactor#237

Open
Tarunkumar0601 wants to merge 2 commits into
frappe:developfrom
aerele:feat/stripe-shared-infra
Open

feat(stripe): shared infrastructure for the stripe refactor#237
Tarunkumar0601 wants to merge 2 commits into
frappe:developfrom
aerele:feat/stripe-shared-infra

Conversation

@Tarunkumar0601

Copy link
Copy Markdown

Foundation for the Stripe integration refactor — no behaviour change on its own.

  • Adds stripe_utils.py: shared helpers (client, amount conversion, idempotency keys, customer/subscription resolution)
  • Adds stripe_subscription_sync.py: syncs a Subscription Plan's price to Stripe
  • Adds custom fields (Customer.stripe_customer_id, Subscription / Payment Entry Stripe ids) via patch + make_custom_fields()
  • Adds new Stripe Settings fields (checkout mode, webhook secret, billing model, price-sync toggle)

Backport Needed: V15 & V16

@Tarunkumar0601 Tarunkumar0601 marked this pull request as ready for review July 1, 2026 10:33
@mergify

mergify Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@greptile-apps

greptile-apps Bot commented Jul 1, 2026

Copy link
Copy Markdown

Confidence Score: 4/5

Safe to merge as infrastructure with one outstanding crash path: if a Subscription Plan referenced in a Subscription Plan Detail row is later deleted, the bare tuple unpack in stripe_checkout.py line 51 raises TypeError on the checkout page.

The stripe_checkout.py change unpacks the result of frappe.db.get_value directly into billing_interval, billing_interval_count with no guard against a None return — a deleted or missing plan silently crashes the checkout page with a TypeError. This risk was flagged in a prior review thread but remains unaddressed.

payments/templates/pages/stripe_checkout.py — tuple unpack of frappe.db.get_value on line 51 needs a None guard before unpacking.

Reviews (6): Last reviewed commit: "feat(stripe): shared infrastructure for ..." | Re-trigger Greptile

Comment thread payments/payment_gateways/stripe_utils.py Outdated
Comment thread payments/payment_gateways/stripe_subscription_sync.py
Comment thread payments/templates/pages/stripe_checkout.py
Comment thread payments/payment_gateways/stripe_subscription_sync.py
@Tarunkumar0601 Tarunkumar0601 force-pushed the feat/stripe-shared-infra branch from 64d872a to a0713ef Compare July 1, 2026 12:21
Comment thread payments/payment_gateways/stripe_utils.py Outdated
@Tarunkumar0601 Tarunkumar0601 force-pushed the feat/stripe-shared-infra branch 2 times, most recently from 05f9e99 to 965c6eb Compare July 1, 2026 14:10
Comment thread payments/payment_gateways/stripe_subscription_sync.py
@Tarunkumar0601 Tarunkumar0601 force-pushed the feat/stripe-shared-infra branch from 965c6eb to 9e18445 Compare July 1, 2026 14:51
@greptile-apps

greptile-apps Bot commented Jul 1, 2026

Copy link
Copy Markdown

Want your agent to iterate on Greptile's feedback? Try greploops.

@Tarunkumar0601 Tarunkumar0601 changed the title feat(stripe): shared infrastructure for the Stripe refactor feat(stripe): shared infrastructure for the stripe refactor Jul 8, 2026
Comment on lines +100 to +104
if not gw or gw.gateway_settings != "Stripe Settings":
return None
if not gw.gateway_controller:
# Gateway relies on the naming-convention fallback;
return None

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make it a single if condition

@Tarunkumar0601 Tarunkumar0601 force-pushed the feat/stripe-shared-infra branch from 9e18445 to b67c9de Compare July 8, 2026 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants