Repository navigation
feat: bulk subscription import and Shopify, Stripe, Circle billing adapters - #2331
Merged
github-actions[bot] merged 6 commits intoNov 25, 2026
Conversation
…r types Extends BillingProvider-typed errors and telemetry to cover shopify and circle, adds a cancel operation, and exports withIdempotentRetry for the gateway adapters.
|
@Mrwicks00 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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.
feat: bulk subscription import + Shopify, Stripe and Circle billing adapters
Closes #1960
Closes #1961
Closes #1963
Closes #1965
Summary
backend/src/services/import.ts,bin/subtrackr.js,docs/bulk-import.mdbackend/src/gateways/shopify.tsbackend/src/gateways/stripe.tsbackend/src/gateways/circle.tsDetails
#1960 Bulk import
subtrackr subscriptions import <file.csv> [--dry-run] [--format json].created,would_create,duplicate,error) with the line number and field-level errors. One bad row never blocks the others.#1961 Shopify
createShopifyBillingAdapter: create, cancel and fetch app subscriptions over Admin GraphQL.THROTTLED, 429, 5xx and transport errors are retried with backoff;userErrorsare non-retryable.#1963 Stripe
createStripeSubscriptionAdapter: create, change plan, preview, cancel and fetch.calculateProrationis pure and integer-only (credit for unused old plan, charge for remaining new plan, half-up rounding).changePlansends the sameproration_dateto Stripe, so the preview matches the invoice.#1965 Circle
createCircleAdapter(micro-USDC integers internally, decimal strings on the wire).verifyCircleWebhook: ECDSA-SHA256 signature check against the key named byX-Circle-Key-Id.applyCircleEvent: idempotent by notification id; statuses only move forward; amount mismatches are flagged and never applied.reconcileCirclePayments: polls Circle for stale unsettled payments and reports{ checked, updated, mismatched, errors }; one failed lookup does not abort the sweep.Shared change (kept minimal):
billingAdapter.tsgains an exportedwithIdempotentRetryhelper, aGatewayProvidertype (addsshopifyandcircleto error/telemetry typing) and acanceloperation. Existing behaviour is unchanged.Testing
import.test.ts,importCli.test.ts(runs the real CLI against a local fake API),stripe.test.ts,shopifyBilling.test.ts,circle.test.ts..tsfiles;tsc --noEmitreports no errors in them.Known pre-existing issues (not touched)
Both fail identically on a clean
mainand are unrelated to this PR:billingAdapter.test.ts› "maps HTTP 402 to PROVIDER_REJECTED" expectsPROVIDER_REJECTEDbut the existing classifier returnsUNKNOWN.certificatePinning.test.tsimportsvitestbut runs under the Jest backend config.Checklist
tscerrorsdocs/bulk-import.md,backend/src/gateways/README.md)