-
Notifications
You must be signed in to change notification settings - Fork 5.5k
[FEATURE] Upgrade Pipedream Stripe App to Latest Stable API Version #16463
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 3 Skipped Deployments
|
## Walkthrough
This update modifies the Stripe integration by upgrading the Stripe SDK dependency from version 8.x to 18.x, updates the default Stripe API version from "2020-03-02" to "2025-03-31.basil", and adjusts the Stripe client instantiation to use the new SDK import style. Additionally, the version numbers for all Stripe actions and sources are incremented (mostly from "0.1.1" to "0.1.2" or "0.1.3"/"0.1.4" for sources). The "Create Usage Record" action was removed, and a new "Create Billing Meter" action and a utility module with JSON parsing and date conversion functions were added. Several actions were enhanced to parse advanced options as JSON before use, and many list actions were extended with new filtering and pagination props.
## Changes
| File(s) | Change Summary |
|----------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------|
| components/stripe/stripe.app.mjs | Updated Stripe SDK import to named import, changed client instantiation, set API version to "2025-03-31.basil". Added new filtering and pagination props; removed `usage_record_action` prop. |
| components/stripe/package.json | Upgraded Stripe SDK dependency from ^8.168.0 to ^18.0.0. |
| components/stripe/common/utils.mjs | Added utility module with `parseJson` (recursive JSON parsing), `fromDateToInteger` (date string to timestamp), and `parseArray` (JSON array parsing).|
| components/stripe/actions/create-billing-meter/create-billing-meter.mjs | Added new action to create billing meters with configurable aggregation, event name, and optional keys. |
| components/stripe/actions/create-customer/create-customer.mjs | Expanded props extensively; replaced lodash.pick with explicit destructuring and conditional nested objects; imported utils for parsing; bumped version. |
| components/stripe/actions/cancel-payment-intent/cancel-payment-intent.mjs | Renamed props to camelCase; removed lodash.pick; refactored run method to explicit param usage; bumped version. |
| components/stripe/actions/capture-payment-intent/capture-payment-intent.mjs | Renamed props to camelCase; replaced advanced with explicit props; removed lodash.pick; refactored run method; bumped version. |
| components/stripe/actions/confirm-payment-intent/confirm-payment-intent.mjs | Renamed props to camelCase; added many new props; replaced advanced with explicit props parsed via utils; refactored run method; bumped version. |
| components/stripe/actions/create-invoice/create-invoice.mjs | Renamed and restructured props; added automatic tax props; replaced lodash.pick with explicit param construction; bumped version. |
| components/stripe/actions/create-invoice-item/create-invoice-item.mjs | Renamed props; removed advanced; replaced lodash.pick with explicit param passing; bumped version. |
| components/stripe/actions/create-payment-intent/create-payment-intent.mjs | Renamed props to camelCase; removed lodash.pick; replaced advanced with explicit props; refactored run method; bumped version. |
| components/stripe/actions/create-payout/create-payout.mjs | Renamed props to camelCase; removed lodash.pick; explicitly marked required props; refactored run method; bumped version. |
| components/stripe/actions/create-price/create-price.mjs | Version bump only. |
| components/stripe/actions/create-product/create-product.mjs | Renamed and added descriptions to props; conditionally included nested default_price_data; bumped version. |
| components/stripe/actions/create-refund/create-refund.mjs | Renamed props to camelCase; removed lodash.pick; replaced advanced with explicit props; refactored run method; bumped version. |
| components/stripe/actions/create-subscription/create-subscription.mjs | Renamed props to camelCase; added automatic tax and payment behavior props; replaced lodash.pick with explicit param construction; imported utils; bumped version. |
| components/stripe/actions/list-balance-history/list-balance-history.mjs | Added filtering and pagination props; replaced lodash.pick with explicit param construction; enhanced prop definitions; bumped version to 0.1.6. |
| components/stripe/actions/list-customers/list-customers.mjs | Added filtering and pagination props; replaced lodash.pick with explicit param construction; imported utils; bumped version. |
| components/stripe/actions/list-invoices/list-invoices.mjs | Added filtering and pagination props; renamed props; replaced lodash.pick with explicit param construction; imported utils; bumped version. |
| components/stripe/actions/list-payment-intents/list-payment-intents.mjs | Removed advanced prop; simplified run method; removed lodash.pick; bumped version. |
| components/stripe/actions/list-payouts/list-payouts.mjs | Added filtering and pagination props; redefined status prop explicitly; replaced lodash.pick; imported utils; bumped version. |
| components/stripe/actions/list-refunds/list-refunds.mjs | Renamed props to camelCase; removed lodash.pick; replaced advanced with explicit param construction; bumped version. |
| components/stripe/actions/retrieve-balance/retrieve-balance.mjs | Version bump only. |
| components/stripe/actions/retrieve-checkout-session-line-items/retrieve-checkout-session-line-items.mjs | Renamed props to camelCase; updated run method accordingly; bumped version. |
| components/stripe/actions/retrieve-checkout-session/retrieve-checkout-session.mjs | Renamed prop to camelCase; destructured props in run method; bumped version. |
| components/stripe/actions/retrieve-customer/retrieve-customer.mjs | Version bump only. |
| components/stripe/actions/retrieve-invoice-item/retrieve-invoice-item.mjs | Corrected propDefinition key; version bump. |
| components/stripe/actions/retrieve-invoice/retrieve-invoice.mjs | Version bump only. |
| components/stripe/actions/retrieve-payment-intent/retrieve-payment-intent.mjs | Renamed props to camelCase; destructured props in run method; bumped version. |
| components/stripe/actions/retrieve-payout/retrieve-payout.mjs | Version bump only. |
| components/stripe/actions/retrieve-price/retrieve-price.mjs | Version bump only. |
| components/stripe/actions/retrieve-product/retrieve-product.mjs | Renamed prop to camelCase; version bump. |
| components/stripe/actions/retrieve-refund/retrieve-refund.mjs | Version bump only. |
| components/stripe/actions/send-invoice/send-invoice.mjs | Version bump only. |
| components/stripe/actions/update-customer/update-customer.mjs | Added utils import; replaced advanced spread with JSON parsing; renamed address props; bumped version. |
| components/stripe/actions/update-invoice-item/update-invoice-item.mjs | Added utils import; replaced advanced spread with JSON parsing; corrected propDefinition key; bumped version. |
| components/stripe/actions/update-invoice/update-invoice.mjs | Added utils import; replaced advanced spread with JSON parsing; renamed props to camelCase; added new payment method props; bumped version. |
| components/stripe/actions/update-payment-intent/update-payment-intent.mjs | Version bump only; renamed props to camelCase; replaced advanced with explicit props; enhanced shipping and statement descriptor handling. |
| components/stripe/actions/update-payout/update-payout.mjs | Version bump only; reformatted prop definitions; destructured props in run method. |
| components/stripe/actions/update-refund/update-refund.mjs | Version bump only; reformatted prop definitions; destructured props in run method. |
| components/stripe/actions/void-invoice/void-invoice.mjs | Version bump only; destructured props in run method. |
| components/stripe/actions/write-off-invoice/write-off-invoice.mjs | Version bump only; destructured props in run method. |
| components/stripe/sources/abandoned-cart/abandoned-cart.mjs | Version bump only. |
| components/stripe/sources/canceled-subscription/canceled-subscription.mjs | Version bump only. |
| components/stripe/sources/custom-webhook-events/custom-webhook-events.mjs | Version bump only. |
| components/stripe/sources/new-customer/new-customer.mjs | Version bump only. |
| components/stripe/sources/new-dispute/new-dispute.mjs | Version bump only. |
| components/stripe/sources/new-failed-invoice-payment/new-failed-invoice-payment.mjs | Version bump only. |
| components/stripe/sources/new-failed-payment/new-failed-payment.mjs | Version bump only. |
| components/stripe/sources/new-invoice/new-invoice.mjs | Version bump only. |
| components/stripe/sources/new-payment/new-payment.mjs | Version bump only. |
| components/stripe/sources/new-subscription/new-subscription.mjs | Version bump only. |
| components/stripe/sources/subscription-updated/subscription-updated.mjs | Version bump; added new event "customer.subscription.updated" to getEvents method. |
| components/stripe/actions/create-usage-record/create-usage-record.mjs | Removed entire action module. |
| components/stripe/actions/search-customers/search-customers.mjs | Changed email prop to use propDefinition; refactored run method to destructure props; removed explicit API version in SDK call; bumped version. |
| components/stripe/common/constants.mjs | Added new constant `API_VERSION` set to "2025-03-31.basil". |
| components/stripe/sources/common/webhook-base.mjs | Renamed import and prop from `stripe` to `app`; replaced all `this.stripe` references with `this.app`. |
## Sequence Diagram(s)
```mermaid
sequenceDiagram
participant Action as Stripe Action
participant Utils as Utils Module
participant SDK as Stripe SDK
participant API as Stripe API
Action->>Utils: parseJson(advanced options)
Utils-->>Action: parsed options object
Action->>SDK: Call Stripe API with merged params (including parsed advanced options)
SDK->>API: API request with updated params
API-->>SDK: API response
SDK-->>Action: Return responsesequenceDiagram
participant StripeApp as Stripe App
participant StripeSDK as Stripe SDK
StripeApp->>StripeSDK: Import Stripe (v18.x)
StripeApp->>StripeSDK: Instantiate Stripe client (API version "2025-03-31.basil")
StripeApp->>StripeSDK: Make API requests using new client
StripeSDK-->>StripeApp: Return responses
Assessment against linked issues
Suggested labels
Poem
|
b90e329 to
c0ffd52
Compare
GTFalcao
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moving it to QA, but I think the package version number needs to be fixed
b463b99 to
8c41a71
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
components/stripe/common/utils.mjs (1)
24-31: Consider adding explicit return value for invalid datesThe function currently returns
undefinedimplicitly when validation fails. For better clarity, consider adding an explicit return statement.const fromDateToInteger = (date) => { if (typeof date === "string") { const parsedDate = new Date(date); if (!isNaN(parsedDate.getTime())) { return Math.floor(parsedDate.getTime() / 1000); } } + return undefined; };components/stripe/actions/create-billing-meter/create-billing-meter.mjs (1)
69-101: Robust implementation with conditional parametersThe implementation correctly:
- Destructures props from this
- Builds request parameters with conditional inclusion of optional settings
- Returns a clear summary message with the created meter ID
Consider using the utils.parseJson for any advanced options if they're added in the future, to maintain consistency with other Stripe actions.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (59)
components/stripe/actions/cancel-or-reverse-payout/cancel-or-reverse-payout.mjs(1 hunks)components/stripe/actions/cancel-payment-intent/cancel-payment-intent.mjs(1 hunks)components/stripe/actions/capture-payment-intent/capture-payment-intent.mjs(2 hunks)components/stripe/actions/confirm-payment-intent/confirm-payment-intent.mjs(2 hunks)components/stripe/actions/create-billing-meter/create-billing-meter.mjs(1 hunks)components/stripe/actions/create-customer/create-customer.mjs(2 hunks)components/stripe/actions/create-invoice-item/create-invoice-item.mjs(3 hunks)components/stripe/actions/create-invoice/create-invoice.mjs(2 hunks)components/stripe/actions/create-payment-intent/create-payment-intent.mjs(1 hunks)components/stripe/actions/create-payout/create-payout.mjs(1 hunks)components/stripe/actions/create-price/create-price.mjs(1 hunks)components/stripe/actions/create-product/create-product.mjs(1 hunks)components/stripe/actions/create-refund/create-refund.mjs(1 hunks)components/stripe/actions/create-subscription/create-subscription.mjs(3 hunks)components/stripe/actions/create-usage-record/create-usage-record.mjs(0 hunks)components/stripe/actions/delete-customer/delete-customer.mjs(1 hunks)components/stripe/actions/delete-invoice-item/delete-invoice-item.mjs(1 hunks)components/stripe/actions/delete-or-void-invoice/delete-or-void-invoice.mjs(1 hunks)components/stripe/actions/finalize-invoice/finalize-invoice.mjs(1 hunks)components/stripe/actions/list-balance-history/list-balance-history.mjs(3 hunks)components/stripe/actions/list-customers/list-customers.mjs(2 hunks)components/stripe/actions/list-invoices/list-invoices.mjs(2 hunks)components/stripe/actions/list-payment-intents/list-payment-intents.mjs(2 hunks)components/stripe/actions/list-payouts/list-payouts.mjs(2 hunks)components/stripe/actions/list-refunds/list-refunds.mjs(1 hunks)components/stripe/actions/retrieve-balance/retrieve-balance.mjs(1 hunks)components/stripe/actions/retrieve-checkout-session-line-items/retrieve-checkout-session-line-items.mjs(1 hunks)components/stripe/actions/retrieve-checkout-session/retrieve-checkout-session.mjs(1 hunks)components/stripe/actions/retrieve-customer/retrieve-customer.mjs(1 hunks)components/stripe/actions/retrieve-invoice-item/retrieve-invoice-item.mjs(1 hunks)components/stripe/actions/retrieve-invoice/retrieve-invoice.mjs(1 hunks)components/stripe/actions/retrieve-payment-intent/retrieve-payment-intent.mjs(1 hunks)components/stripe/actions/retrieve-payout/retrieve-payout.mjs(1 hunks)components/stripe/actions/retrieve-price/retrieve-price.mjs(1 hunks)components/stripe/actions/retrieve-product/retrieve-product.mjs(1 hunks)components/stripe/actions/retrieve-refund/retrieve-refund.mjs(1 hunks)components/stripe/actions/send-invoice/send-invoice.mjs(1 hunks)components/stripe/actions/update-customer/update-customer.mjs(2 hunks)components/stripe/actions/update-invoice-item/update-invoice-item.mjs(2 hunks)components/stripe/actions/update-invoice/update-invoice.mjs(2 hunks)components/stripe/actions/update-payment-intent/update-payment-intent.mjs(1 hunks)components/stripe/actions/update-payout/update-payout.mjs(1 hunks)components/stripe/actions/update-refund/update-refund.mjs(1 hunks)components/stripe/actions/void-invoice/void-invoice.mjs(1 hunks)components/stripe/actions/write-off-invoice/write-off-invoice.mjs(1 hunks)components/stripe/common/utils.mjs(1 hunks)components/stripe/package.json(1 hunks)components/stripe/sources/abandoned-cart/abandoned-cart.mjs(1 hunks)components/stripe/sources/canceled-subscription/canceled-subscription.mjs(1 hunks)components/stripe/sources/custom-webhook-events/custom-webhook-events.mjs(1 hunks)components/stripe/sources/new-customer/new-customer.mjs(1 hunks)components/stripe/sources/new-dispute/new-dispute.mjs(1 hunks)components/stripe/sources/new-failed-invoice-payment/new-failed-invoice-payment.mjs(1 hunks)components/stripe/sources/new-failed-payment/new-failed-payment.mjs(1 hunks)components/stripe/sources/new-invoice/new-invoice.mjs(1 hunks)components/stripe/sources/new-payment/new-payment.mjs(1 hunks)components/stripe/sources/new-subscription/new-subscription.mjs(1 hunks)components/stripe/sources/subscription-updated/subscription-updated.mjs(1 hunks)components/stripe/stripe.app.mjs(2 hunks)
💤 Files with no reviewable changes (1)
- components/stripe/actions/create-usage-record/create-usage-record.mjs
✅ Files skipped from review due to trivial changes (4)
- components/stripe/actions/create-product/create-product.mjs
- components/stripe/actions/create-payout/create-payout.mjs
- components/stripe/actions/update-payment-intent/update-payment-intent.mjs
- components/stripe/actions/create-price/create-price.mjs
🚧 Files skipped from review as they are similar to previous changes (46)
- components/stripe/actions/retrieve-invoice/retrieve-invoice.mjs
- components/stripe/actions/write-off-invoice/write-off-invoice.mjs
- components/stripe/actions/delete-customer/delete-customer.mjs
- components/stripe/actions/update-refund/update-refund.mjs
- components/stripe/sources/abandoned-cart/abandoned-cart.mjs
- components/stripe/actions/retrieve-invoice-item/retrieve-invoice-item.mjs
- components/stripe/actions/finalize-invoice/finalize-invoice.mjs
- components/stripe/actions/retrieve-balance/retrieve-balance.mjs
- components/stripe/actions/retrieve-payout/retrieve-payout.mjs
- components/stripe/package.json
- components/stripe/sources/canceled-subscription/canceled-subscription.mjs
- components/stripe/sources/new-failed-invoice-payment/new-failed-invoice-payment.mjs
- components/stripe/actions/delete-invoice-item/delete-invoice-item.mjs
- components/stripe/actions/send-invoice/send-invoice.mjs
- components/stripe/sources/new-customer/new-customer.mjs
- components/stripe/actions/create-refund/create-refund.mjs
- components/stripe/actions/retrieve-checkout-session/retrieve-checkout-session.mjs
- components/stripe/actions/void-invoice/void-invoice.mjs
- components/stripe/actions/retrieve-payment-intent/retrieve-payment-intent.mjs
- components/stripe/actions/retrieve-product/retrieve-product.mjs
- components/stripe/sources/new-invoice/new-invoice.mjs
- components/stripe/actions/delete-or-void-invoice/delete-or-void-invoice.mjs
- components/stripe/actions/retrieve-refund/retrieve-refund.mjs
- components/stripe/actions/create-customer/create-customer.mjs
- components/stripe/actions/cancel-or-reverse-payout/cancel-or-reverse-payout.mjs
- components/stripe/sources/new-dispute/new-dispute.mjs
- components/stripe/actions/retrieve-price/retrieve-price.mjs
- components/stripe/actions/update-payout/update-payout.mjs
- components/stripe/actions/cancel-payment-intent/cancel-payment-intent.mjs
- components/stripe/actions/retrieve-checkout-session-line-items/retrieve-checkout-session-line-items.mjs
- components/stripe/actions/update-customer/update-customer.mjs
- components/stripe/sources/subscription-updated/subscription-updated.mjs
- components/stripe/sources/new-subscription/new-subscription.mjs
- components/stripe/actions/list-refunds/list-refunds.mjs
- components/stripe/actions/update-invoice-item/update-invoice-item.mjs
- components/stripe/sources/new-failed-payment/new-failed-payment.mjs
- components/stripe/actions/retrieve-customer/retrieve-customer.mjs
- components/stripe/actions/create-payment-intent/create-payment-intent.mjs
- components/stripe/sources/new-payment/new-payment.mjs
- components/stripe/sources/custom-webhook-events/custom-webhook-events.mjs
- components/stripe/actions/create-invoice/create-invoice.mjs
- components/stripe/actions/confirm-payment-intent/confirm-payment-intent.mjs
- components/stripe/actions/create-subscription/create-subscription.mjs
- components/stripe/actions/capture-payment-intent/capture-payment-intent.mjs
- components/stripe/actions/update-invoice/update-invoice.mjs
- components/stripe/actions/list-payment-intents/list-payment-intents.mjs
🔇 Additional comments (31)
components/stripe/common/utils.mjs (2)
1-22: Well-structured recursive JSON parsing implementationThis is a solid implementation of a recursive JSON parser that handles nested objects and strings. The recursion is implemented correctly with proper error handling.
33-41: Clean utility export with additional validationGood approach wrapping the parseJson function with extra validation to ensure it always returns an object. This provides a consistent interface for consumers of this utility.
components/stripe/actions/create-invoice-item/create-invoice-item.mjs (3)
3-3: Good addition of utility importAdding the utils import enables consistent parsing of JSON options across Stripe actions.
9-9: Version increment reflects API changesAppropriate version increment from 0.1.1 to 0.1.2 to reflect the changes in implementation.
87-113:❓ Verification inconclusive
Updated to use new Stripe SDK structure
The changes correctly adapt to the new Stripe SDK structure by:
- Destructuring props more cleanly
- Using the nested
pricingobject structure for price- Properly parsing the advanced options with utils.parseJson
These changes align with Stripe's latest API version requirements.
One thing to verify:
🏁 Script executed:
#!/bin/bash # Check Stripe API docs to understand the proper structure for invoice item creation curl -s https://api.stripe.com/v1/invoiceitems | grep -A 5 pricingLength of output: 68
Please verify the
pricingparameter structureThe changes correctly adapt to the new Stripe SDK structure by:
- Destructuring props more cleanly
- Using the nested
pricingobject forprice- Properly parsing the advanced options with
utils.parseJsonBefore approving, confirm that
InvoiceItems.create()in the latest Stripe Node.js SDK supports:...(price ? { pricing: { price, }, } : {} ),File: components/stripe/actions/create-invoice-item/create-invoice-item.mjs
Lines: 87–113components/stripe/actions/create-billing-meter/create-billing-meter.mjs (2)
3-9: Well-structured new Billing Meter componentGood implementation of the new Billing Meter component with proper metadata. The description clearly explains the purpose and links to relevant documentation.
9-68: Comprehensive props configurationThe props are well-defined with clear descriptions, appropriate types, and useful options for dropdowns. The optional flags are correctly applied where needed.
components/stripe/actions/list-balance-history/list-balance-history.mjs (5)
2-2: Added utils import for date conversionGood addition of the utils import to leverage the date conversion functionality.
8-8: Significant version incrementThe version has been updated from 0.1.1 to 0.1.6, which is a larger jump than other files. This is appropriate given the number of new filtering and pagination features added.
22-28: Default country addition for currencyAdded a default country of "US" for the currency prop, which improves usability by providing a sensible default.
42-77: Enhanced filtering and pagination capabilitiesThe added props for date-based filtering (createdGt, createdGte, createdLt, createdLte) and pagination (endingBefore, startingAfter) significantly improve the action's flexibility.
79-114: Well-implemented filtering logicThe refactored run method correctly:
- Destructures properties for better readability
- Conditionally includes date filters only when needed
- Properly converts date strings to integer timestamps
- Includes pagination parameters directly
This implementation aligns with Stripe API expectations while providing a clean interface.
components/stripe/actions/list-customers/list-customers.mjs (5)
2-2: Good addition of utility module import.The utils module import is a welcome addition that allows for reusable functionality across different actions.
8-9: Appropriate version bump and description update.The version increment from 0.1.1 to 0.1.2 appropriately reflects the enhancement of the component with additional filtering capabilities. The updated description also provides clearer documentation reference.
25-60: Great enhancement with additional filtering and pagination options.The addition of date range filters and pagination parameters significantly improves the component's flexibility and aligns with Stripe's API capabilities. These props will allow users to create more targeted queries and handle large result sets more efficiently.
63-74: Good refactoring to use direct destructuring.Replacing lodash.pick with direct destructuring makes the code more modern and removes an external dependency, which is a good practice.
75-93: Clean implementation of conditional date filtering.The implementation of date filtering and cursor-based pagination is clean and well-structured. The conditional construction of the created filter object only when needed is an efficient approach. The use of utils.fromDateToInteger ensures proper conversion of ISO date strings to the UNIX timestamps required by Stripe's API.
components/stripe/actions/list-invoices/list-invoices.mjs (5)
2-2: Good addition of utility module import.Consistent with other actions, adding the utils module import enables reuse of common functions.
8-8: Appropriate version bump.The version increment from 0.1.1 to 0.1.2 correctly reflects the enhancement nature of these changes.
49-84: Great enhancement with filtering and pagination options.Adding date range filters and pagination parameters provides users with more control over their queries, especially useful for accounts with many invoices.
87-100: Good refactoring to use direct property destructuring.The refactoring from lodash.pick to direct destructuring improves code readability and removes an external dependency.
102-123: Well-implemented date filtering logic.The conditional construction of the date filtering parameters is clean and efficient, only adding the filter when at least one date parameter is provided. The conversion from ISO dates to UNIX timestamps using the utility function maintains consistency across the codebase.
components/stripe/stripe.app.mjs (3)
1-1: Updated Stripe SDK import style.Changed from default import to named import, which aligns with the newer versions of the Stripe SDK.
642-701: Excellent addition of filtering and pagination prop definitions.The comprehensive set of new prop definitions for date filtering (created and arrival dates) and cursor-based pagination significantly enhances the capabilities of all Stripe actions. The detailed descriptions will help users understand how to use these parameters correctly.
707-709:❌ Incorrect review comment
Updated Stripe SDK instantiation and API version.
The change to use constructor-style instantiation (
new Stripe) and updating the API version are key parts of this upgrade.However, the API version
"2025-03-31.basil"seems unusual with its future date and.basilsuffix.
🌐 Web query:
What is the latest stable Stripe API version? Is "2025-03-31.basil" a valid Stripe API version?💡 Result:
The latest stable Stripe API version is 2025-04-30.basil[1][2]. This is the current version as documented in Stripe's API reference.
Yes, "2025-03-31.basil" is a valid Stripe API version. It was the previous stable version before the latest update[8][10]. Stripe follows a versioning system where they release new API versions monthly with no breaking changes, and "basil" refers to the major release name[5]. Each version is named with the date it was released (in this case, March 31, 2025, for the previous version and April 30, 2025, for the current version).
How Stripe Versioning Works
Stripe's API versioning follows a specific pattern:
- Monthly releases that include only backward-compatible changes
- Major releases (like "basil") twice a year that may include breaking changes[5]
- Each version is named with its release date followed by the major release name
When integrating with Stripe, you can specify which API version to use by:
- Setting it globally in your SDK initialization
- Setting it per request using the
Stripe-Versionheader- Using your account's default version set in Workbench[3]
For example, you can specify the version in a curl request:
curl https://api.stripe.com/v1/charges \ -u : \ -H "Stripe-Version: 2025-04-30.basil"Or when initializing the Node.js library:
const stripe = require('stripe')('', { apiVersion: '2025-04-30.basil', });It's generally recommended to explicitly set your API version in code rather than relying on your account's default version to ensure consistent behavior as you develop and maintain your application[3].
Citations:
- 1: https://docs.stripe.com/api/versioning
- 2: https://docs.stripe.com/api/versioning?lang=node
- 3: https://docs.stripe.com/upgrades
- 4: https://docs.stripe.com/sdks/set-version
- 5: https://docs.stripe.com/sdks/versioning
- 6: https://stripe.com/blog/api-versioning
- 7: https://classic.yarnpkg.com/en/package/stripe
- 8: https://github.com/stripe/stripe-java/releases
- 9: https://stripe.dev/blog/prepare-for-api-upgrades
- 10: https://github.com/stripe/stripe-dotnet/blob/master/CHANGELOG.md
Stripe API version validity
The API version
"2025-03-31.basil"is valid—it corresponds to Stripe’s March 31, 2025 release (Stripe uses YYYY-MM-DD plus a release name). If you’d rather target the very latest stable release, you can bump this to"2025-04-30.basil", but using"2025-03-31.basil"is perfectly acceptable.Likely an incorrect or invalid review comment.
components/stripe/actions/list-payouts/list-payouts.mjs (6)
2-2: Good addition of utility module import.The utils module import enables reuse of date conversion functionality across different actions.
8-8: Appropriate version increment.The version bump from 0.1.1 to 0.1.2 properly reflects the enhancement nature of these changes.
25-90: Comprehensive enhancement with filtering and pagination options.The addition of creation date filters, arrival date filters, destination filtering, and pagination parameters significantly improves the component's flexibility. This is especially useful for accounts with many payouts that need to be filtered by different criteria.
93-108: Good refactoring to use direct property destructuring.The refactoring from lodash.pick to direct destructuring makes the code more readable and maintainable.
110-138: Well-implemented filtering logic with conditional parameters.The implementation of date filtering (for both created and arrival_date) is clean and efficient. The conditional construction of filter objects only when needed reduces unnecessary parameters in the API call. The use of the utility function for date conversion ensures consistency across the codebase.
144-144: Improved summary message with conditional formatting.The updated summary message that conditionally includes the status when available provides more relevant feedback to the user.
8c41a71 to
9ac195a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🔭 Outside diff range comments (1)
components/stripe/actions/search-customers/search-customers.mjs (1)
4-7: 💡 Verification agent🧩 Analysis chain
Consider incrementing the component version.
The component is still at version "0.0.1" despite SDK changes. The PR summary mentions version increments for Stripe actions, so this might have been overlooked.
- version: "0.0.1", + version: "0.1.2",
🏁 Script executed:
#!/bin/bash # Check if other Stripe action components were updated to version 0.1.2 echo "Checking versions of other Stripe actions..." fd -t f "actions/.*/.*\.mjs$" components/stripe/ | xargs grep -l "version:" | xargs grep "version:" | sort | uniq -cLength of output: 213
🏁 Script executed:
#!/bin/bash echo "Listing version strings in all Stripe action .mjs files:" fd -t f -e mjs components/stripe/actions | xargs grep -H 'version:'Length of output: 596
🏁 Script executed:
#!/bin/bash echo "Searching for version declarations in Stripe actions..." grep -R -H "version:" components/stripe/actionsLength of output: 4064
Please bump the Search Customers action version to match the other Stripe actions
The
search-customersaction is still at version"0.0.1", while most other Stripe actions in this PR have been updated to"0.1.2". Update its version to keep consistency:• File:
components/stripe/actions/search-customers/search-customers.mjs- version: "0.0.1", + version: "0.1.2",
🧹 Nitpick comments (1)
components/stripe/actions/confirm-payment-intent/confirm-payment-intent.mjs (1)
261-289: Optional: build theshippingobject more defensivelyCurrently all keys are sent, even when
undefined. While Stripe often ignoresundefined, omitting empty keys keeps requests lean and avoids unexpected validation issues for strict fields (e.g. emptyline1).Consider filtering undefined entries:
- shipping: { - address: { - city: shippingAddressCity, - country: shippingAddressCountry, - line1: shippingAddressLine1, - line2: shippingAddressLine2, - postal_code: shippingAddressPostalCode, - state: shippingAddressState, - }, - name: shippingName, - carrier: shippingCarrier, - phone: shippingPhone, - tracking_number: shippingTrackingNumber, - }, + shipping: app.cleanObject({ + address: app.cleanObject({ + city: shippingAddressCity, + country: shippingAddressCountry, + line1: shippingAddressLine1, + line2: shippingAddressLine2, + postal_code: shippingAddressPostalCode, + state: shippingAddressState, + }), + name: shippingName, + carrier: shippingCarrier, + phone: shippingPhone, + tracking_number: shippingTrackingNumber, + }),Where
cleanObjectis a small helper that stripsundefinedvalues.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (37)
components/stripe/actions/cancel-or-reverse-payout/cancel-or-reverse-payout.mjs(1 hunks)components/stripe/actions/cancel-payment-intent/cancel-payment-intent.mjs(2 hunks)components/stripe/actions/capture-payment-intent/capture-payment-intent.mjs(1 hunks)components/stripe/actions/confirm-payment-intent/confirm-payment-intent.mjs(3 hunks)components/stripe/actions/create-billing-meter/create-billing-meter.mjs(1 hunks)components/stripe/actions/create-customer/create-customer.mjs(1 hunks)components/stripe/actions/create-invoice-item/create-invoice-item.mjs(2 hunks)components/stripe/actions/create-invoice/create-invoice.mjs(1 hunks)components/stripe/actions/create-payment-intent/create-payment-intent.mjs(2 hunks)components/stripe/actions/create-payout/create-payout.mjs(2 hunks)components/stripe/actions/create-price/create-price.mjs(1 hunks)components/stripe/actions/create-product/create-product.mjs(4 hunks)components/stripe/actions/create-refund/create-refund.mjs(4 hunks)components/stripe/actions/create-subscription/create-subscription.mjs(3 hunks)components/stripe/actions/create-usage-record/create-usage-record.mjs(0 hunks)components/stripe/actions/delete-customer/delete-customer.mjs(1 hunks)components/stripe/actions/delete-invoice-item/delete-invoice-item.mjs(2 hunks)components/stripe/actions/delete-or-void-invoice/delete-or-void-invoice.mjs(2 hunks)components/stripe/actions/finalize-invoice/finalize-invoice.mjs(2 hunks)components/stripe/actions/list-balance-history/list-balance-history.mjs(2 hunks)components/stripe/actions/list-customers/list-customers.mjs(2 hunks)components/stripe/actions/list-invoices/list-invoices.mjs(3 hunks)components/stripe/actions/list-payment-intents/list-payment-intents.mjs(2 hunks)components/stripe/actions/list-payouts/list-payouts.mjs(1 hunks)components/stripe/actions/list-refunds/list-refunds.mjs(3 hunks)components/stripe/actions/retrieve-balance/retrieve-balance.mjs(1 hunks)components/stripe/actions/retrieve-checkout-session-line-items/retrieve-checkout-session-line-items.mjs(2 hunks)components/stripe/actions/retrieve-checkout-session/retrieve-checkout-session.mjs(2 hunks)components/stripe/actions/retrieve-customer/retrieve-customer.mjs(1 hunks)components/stripe/actions/retrieve-invoice-item/retrieve-invoice-item.mjs(2 hunks)components/stripe/actions/retrieve-invoice/retrieve-invoice.mjs(1 hunks)components/stripe/actions/retrieve-payment-intent/retrieve-payment-intent.mjs(1 hunks)components/stripe/actions/retrieve-payout/retrieve-payout.mjs(1 hunks)components/stripe/actions/retrieve-price/retrieve-price.mjs(1 hunks)components/stripe/actions/retrieve-product/retrieve-product.mjs(1 hunks)components/stripe/actions/retrieve-refund/retrieve-refund.mjs(1 hunks)components/stripe/actions/search-customers/search-customers.mjs(3 hunks)
💤 Files with no reviewable changes (1)
- components/stripe/actions/create-usage-record/create-usage-record.mjs
✅ Files skipped from review due to trivial changes (1)
- components/stripe/actions/retrieve-invoice-item/retrieve-invoice-item.mjs
🚧 Files skipped from review as they are similar to previous changes (29)
- components/stripe/actions/delete-customer/delete-customer.mjs
- components/stripe/actions/retrieve-invoice/retrieve-invoice.mjs
- components/stripe/actions/create-price/create-price.mjs
- components/stripe/actions/retrieve-refund/retrieve-refund.mjs
- components/stripe/actions/retrieve-price/retrieve-price.mjs
- components/stripe/actions/retrieve-payout/retrieve-payout.mjs
- components/stripe/actions/delete-invoice-item/delete-invoice-item.mjs
- components/stripe/actions/retrieve-customer/retrieve-customer.mjs
- components/stripe/actions/retrieve-balance/retrieve-balance.mjs
- components/stripe/actions/cancel-or-reverse-payout/cancel-or-reverse-payout.mjs
- components/stripe/actions/delete-or-void-invoice/delete-or-void-invoice.mjs
- components/stripe/actions/create-billing-meter/create-billing-meter.mjs
- components/stripe/actions/retrieve-product/retrieve-product.mjs
- components/stripe/actions/list-payment-intents/list-payment-intents.mjs
- components/stripe/actions/retrieve-checkout-session/retrieve-checkout-session.mjs
- components/stripe/actions/retrieve-payment-intent/retrieve-payment-intent.mjs
- components/stripe/actions/list-customers/list-customers.mjs
- components/stripe/actions/list-balance-history/list-balance-history.mjs
- components/stripe/actions/finalize-invoice/finalize-invoice.mjs
- components/stripe/actions/cancel-payment-intent/cancel-payment-intent.mjs
- components/stripe/actions/retrieve-checkout-session-line-items/retrieve-checkout-session-line-items.mjs
- components/stripe/actions/list-refunds/list-refunds.mjs
- components/stripe/actions/create-payout/create-payout.mjs
- components/stripe/actions/create-refund/create-refund.mjs
- components/stripe/actions/create-product/create-product.mjs
- components/stripe/actions/create-invoice-item/create-invoice-item.mjs
- components/stripe/actions/list-payouts/list-payouts.mjs
- components/stripe/actions/create-payment-intent/create-payment-intent.mjs
- components/stripe/actions/list-invoices/list-invoices.mjs
⏰ Context from checks skipped due to timeout of 90000ms (4)
- GitHub Check: pnpm publish
- GitHub Check: Verify TypeScript components
- GitHub Check: Lint Code Base
- GitHub Check: Publish TypeScript components
🔇 Additional comments (35)
components/stripe/actions/search-customers/search-customers.mjs (6)
19-22: Good refactoring to use centralized prop definition.This change improves consistency by leveraging the centralized
53-55: Code formatting improvement.The conditional check for empty date strings is now better formatted with consistent indentation, improving readability without changing the function's logic.
92-96: Good use of destructuring for improved readability.Destructuring these properties and methods at the beginning of the function makes the code more maintainable and eliminates repetitive
this.references throughout the method.
98-98: Cleaner method invocation.Using the destructured method improves code clarity by making it explicit which function is being called without the
thisprefix.
105-105: Updated SDK client instantiation style.This change correctly aligns with the updated Stripe SDK usage pattern, removing the explicit API version parameter as this is now handled by the app's
sdkmethod.
107-107: Consistent parameter passing.Using the destructured
limitvariable maintains consistency with the destructuring pattern established earlier in the method.components/stripe/actions/capture-payment-intent/capture-payment-intent.mjs (6)
7-7: Version bump looks appropriate.The version increment from 0.1.1 to 0.1.2 is appropriate for these non-breaking enhancements.
15-18: Good conversion from snake_case to camelCase.Renaming from
payment_intenttopaymentIntentfollows JavaScript conventions while maintaining the same functionality. This improves code consistency.
19-25: Improved property definition with better description.The renamed property
amountToCapturenow has a more descriptive explanation that clarifies its default behavior.
26-61: Well-structured explicit properties replacing generic 'advanced' option.Breaking out specific properties with appropriate types and descriptions improves developer experience and code clarity. Each property is well-documented with its purpose and behavior.
64-87: Improved parameter handling with explicit mapping.The refactored run method with explicit property destructuring and mapping to the Stripe SDK parameters is much clearer than the previous implementation. The conditional inclusion of the transfer_data object only when needed is particularly well-implemented.
88-90: Updated summary message to match new property naming.The export summary has been correctly updated to reflect the new camelCase property naming.
components/stripe/actions/create-subscription/create-subscription.mjs (7)
1-2: Good addition of utilities module.Adding the utils import provides reusable functions for JSON and array parsing, improving code reusability across the Stripe component.
8-8: Version bump is appropriate.The version increment from 0.1.1 to 0.1.2 correctly reflects the non-breaking enhancements made to this component.
50-62: Improved property naming and descriptions.The conversion from snake_case to camelCase (
collection_method→collectionMethod,days_until_due→daysUntilDue) follows JavaScript conventions while maintaining clear documentation.
72-85: Better property organization with improved labels.Renaming to
defaultPaymentMethodwith a clear label and description improves the developer experience.
92-124: Well-structured new properties for automatic tax and payment behavior.The addition of explicit properties for automatic tax calculation and payment behavior options enhances the component's functionality. Each property has appropriate types, labels, descriptions, and options where applicable.
127-141: Clean property destructuring in run method.Explicitly destructuring all properties makes the code more readable and maintainable.
143-170: Well-implemented parameter construction with conditional logic.The subscription creation call now explicitly sets each parameter and includes conditional logic for automatic tax parameters. The use of
utils.parseJsonandutils.parseArrayensures proper handling of string inputs.components/stripe/actions/create-invoice/create-invoice.mjs (6)
7-8: Version bump and improved description.The version increment and updated documentation link improve the component's maintainability.
11-15: Good renaming to camelCase.Converting from
auto_advancetoautoAdvancefollows JavaScript conventions.
17-38: Well-structured automatic tax properties.The new properties for automatic tax calculation are well-documented with appropriate types, labels, and descriptions.
39-63: Improved property organization.The restructured properties with consistent camelCase naming and clear descriptions enhance developer experience.
93-106: Clean property destructuring.Explicitly destructuring all properties improves code readability.
107-131: Well-implemented conditional parameter construction.The invoice creation call now explicitly sets each parameter with a clean conditional inclusion of the automatic_tax object only when relevant properties are provided.
components/stripe/actions/create-customer/create-customer.mjs (9)
1-2: Good addition of utilities module.Adding the utils module provides functions for parsing JSON and arrays, improving code reusability across components.
8-9: Version bump with improved documentation.The version increment and updated documentation link enhance the component's maintainability.
31-72: Improved property naming and organization.Converting properties from snake_case to camelCase (e.g.,
addressLine1instead ofline1) improves consistency with JavaScript conventions.
73-90: Enhanced payment method properties.The improved structure with
paymentMethodTypeand dependentpaymentMethodprovides better control and clarity.
97-150: Comprehensive shipping address fields.The addition of detailed shipping address fields with clear labeling improves the component's functionality and usability.
151-166: Well-structured tax-related properties.The new tax-related properties are well-documented with appropriate types, labels, and descriptions.
167-253: Comprehensive customer configuration options.The extensive addition of properties for balance, cash balance, invoice settings, and other customer configurations significantly enhances the component's capabilities.
256-292: Clean and comprehensive property destructuring.The explicit destructuring of all properties improves code readability and maintainability.
294-391: Well-implemented conditional parameter construction.The customer creation call uses an excellent pattern of conditional inclusion for nested objects (address, shipping, tax, cash_balance, invoice_settings) only when relevant fields are provided. This prevents sending unnecessary empty objects to the API and makes the code more efficient.
The use of
utils.parseArrayfor taxIdData ensures proper handling of string inputs.components/stripe/actions/confirm-payment-intent/confirm-payment-intent.mjs (1)
116-126: Verifyautomatic_asynccapture method valueThe Stripe docs (up to 2024-08) list
automaticandmanualas the only acceptedcapture_methodvalues forpayment_intents.confirm.automatic_asyncmay be unsupported and would cause a validation error.Please double-check against the 2025-03-31 API changelog.
If not valid, remove it from theoptionsarray.
components/stripe/actions/confirm-payment-intent/confirm-payment-intent.mjs
Outdated
Show resolved
Hide resolved
components/stripe/actions/confirm-payment-intent/confirm-payment-intent.mjs
Show resolved
Hide resolved
9ac195a to
f60fdb4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 4
♻️ Duplicate comments (2)
components/stripe/actions/confirm-payment-intent/confirm-payment-intent.mjs (2)
192-196:⚠️ Potential issue
paymentMethodOptionsshould be parsed as JSON.The prop is defined as a string but Stripe expects an object for payment_method_options. This will cause runtime errors when users provide JSON strings.
- payment_method_options: paymentMethodOptions, + payment_method_options: utils.parseJson(paymentMethodOptions),Additionally, you need to import the utils module:
+import utils from "../../common/utils.mjs";
294-313:⚠️ Potential issueFix logical operator precedence in mandate_data condition.
There's a logical operator precedence issue that can cause runtime errors. The
&&operator has higher precedence than||, which means the condition might evaluate to a non-object value which cannot be spread.- ...( - mandateDataCustomerAcceptanceType - || mandateDataCustomerAcceptanceAcceptedAt - || mandateDataCustomerAcceptanceOffline - || mandateDataCustomerAcceptanceOnlineIpAddress - || mandateDataCustomerAcceptanceOnlineUserAgent - && { - mandate_data: { - customer_acceptance: { - type: mandateDataCustomerAcceptanceType, - accepted_at: mandateDataCustomerAcceptanceAcceptedAt, - offline: mandateDataCustomerAcceptanceOffline, - online: { - ip_address: mandateDataCustomerAcceptanceOnlineIpAddress, - user_agent: mandateDataCustomerAcceptanceOnlineUserAgent, - }, - }, - }, - } - ), + ...( + mandateDataCustomerAcceptanceType + || mandateDataCustomerAcceptanceAcceptedAt + || mandateDataCustomerAcceptanceOffline + || mandateDataCustomerAcceptanceOnlineIpAddress + || mandateDataCustomerAcceptanceOnlineUserAgent + ? { + mandate_data: { + customer_acceptance: { + ...(mandateDataCustomerAcceptanceType && { type: mandateDataCustomerAcceptanceType }), + ...(mandateDataCustomerAcceptanceAcceptedAt && { accepted_at: mandateDataCustomerAcceptanceAcceptedAt }), + ...(mandateDataCustomerAcceptanceOffline && { offline: mandateDataCustomerAcceptanceOffline }), + ...( + mandateDataCustomerAcceptanceOnlineIpAddress + || mandateDataCustomerAcceptanceOnlineUserAgent + ? { + online: { + ...(mandateDataCustomerAcceptanceOnlineIpAddress && { ip_address: mandateDataCustomerAcceptanceOnlineIpAddress }), + ...(mandateDataCustomerAcceptanceOnlineUserAgent && { user_agent: mandateDataCustomerAcceptanceOnlineUserAgent }), + }, + } + : {} + ), + }, + }, + } + : {} + ),
🧹 Nitpick comments (6)
components/stripe/common/utils.mjs (1)
26-33: Consider adding validation for date format compatibilityThe function correctly converts date strings to Unix timestamps (seconds since epoch) but doesn't validate that the input date format is compatible with Stripe's expectations.
const fromDateToInteger = (date) => { if (typeof date === "string") { const parsedDate = new Date(date); if (!isNaN(parsedDate.getTime())) { + // Ensure the timestamp is valid for Stripe's expected range + const timestamp = Math.floor(parsedDate.getTime() / 1000); + if (timestamp < 0) { + return null; // Avoid negative timestamps which might cause issues + } - return Math.floor(parsedDate.getTime() / 1000); + return timestamp; } } + return null; // Explicitly return null for invalid inputs };components/stripe/actions/create-subscription/create-subscription.mjs (1)
127-169: Fix logical issue in conditional automatic tax objectThe automatic tax configuration logic is correct, but there's a risk of passing empty objects in the liability section.
automatic_tax: { enabled: automaticTaxEnabled, - ...(automaticTaxLiabilityType && { + ...(automaticTaxLiabilityType ? { liability: { type: automaticTaxLiabilityType, - ...(automaticTaxLiabilityAccount && { + ...(automaticTaxLiabilityAccount ? { account: automaticTaxLiabilityAccount, - }), + } : {}), }, - }), + } : {}), },components/stripe/actions/update-payment-intent/update-payment-intent.mjs (2)
196-196: Consider adding error handling for JSON parsing.The metadata is parsed with
utils.parseJson, but there's no error handling if the parsing fails. This could lead to runtime errors if the metadata contains malformed JSON.- metadata: utils.parseJson(metadata), + metadata: utils.parseJson(metadata, {}),
231-236: Simplify conditional statement descriptor logic.The nullish coalescing with
undefinedfallback is redundant since if the value is falsy, it would be handled by the condition in the spread.- ...(statementDescriptor && { - statement_descriptor: statementDescriptor?.slice(0, 21) || undefined, - }), - ...(statementDescriptorSuffix && { - statement_descriptor_suffix: statementDescriptorSuffix?.slice(0, 21) || undefined, - }), + ...(statementDescriptor && { + statement_descriptor: statementDescriptor.slice(0, 21), + }), + ...(statementDescriptorSuffix && { + statement_descriptor_suffix: statementDescriptorSuffix.slice(0, 21), + }),components/stripe/actions/create-payment-intent/create-payment-intent.mjs (1)
83-87: Simplify conditional statement descriptor logic.Similar to update-payment-intent.mjs, the nullish coalescing with
undefinedfallback is redundant.- ...(statementDescriptor && { - statement_descriptor: statementDescriptor?.slice(0, 21) || undefined, - }), - ...(statementDescriptorSuffix && { - statement_descriptor_suffix: statementDescriptorSuffix?.slice(0, 21) || undefined, - }), + ...(statementDescriptor && { + statement_descriptor: statementDescriptor.slice(0, 21), + }), + ...(statementDescriptorSuffix && { + statement_descriptor_suffix: statementDescriptorSuffix.slice(0, 21), + }),components/stripe/stripe.app.mjs (1)
359-360: Fix typo in "resource" name property description.There's a typo in the property description for
name- "resouce" should be "resource".- description: "The resouce name", + description: "The resource name",
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (38)
components/stripe/actions/cancel-payment-intent/cancel-payment-intent.mjs(2 hunks)components/stripe/actions/capture-payment-intent/capture-payment-intent.mjs(1 hunks)components/stripe/actions/confirm-payment-intent/confirm-payment-intent.mjs(3 hunks)components/stripe/actions/create-customer/create-customer.mjs(1 hunks)components/stripe/actions/create-invoice-item/create-invoice-item.mjs(2 hunks)components/stripe/actions/create-invoice/create-invoice.mjs(1 hunks)components/stripe/actions/create-payment-intent/create-payment-intent.mjs(2 hunks)components/stripe/actions/create-payout/create-payout.mjs(2 hunks)components/stripe/actions/create-product/create-product.mjs(4 hunks)components/stripe/actions/create-refund/create-refund.mjs(4 hunks)components/stripe/actions/create-subscription/create-subscription.mjs(3 hunks)components/stripe/actions/delete-invoice-item/delete-invoice-item.mjs(2 hunks)components/stripe/actions/delete-or-void-invoice/delete-or-void-invoice.mjs(2 hunks)components/stripe/actions/finalize-invoice/finalize-invoice.mjs(2 hunks)components/stripe/actions/list-balance-history/list-balance-history.mjs(2 hunks)components/stripe/actions/list-invoices/list-invoices.mjs(3 hunks)components/stripe/actions/list-payment-intents/list-payment-intents.mjs(2 hunks)components/stripe/actions/list-payouts/list-payouts.mjs(1 hunks)components/stripe/actions/list-refunds/list-refunds.mjs(3 hunks)components/stripe/actions/retrieve-checkout-session-line-items/retrieve-checkout-session-line-items.mjs(2 hunks)components/stripe/actions/retrieve-checkout-session/retrieve-checkout-session.mjs(2 hunks)components/stripe/actions/retrieve-invoice-item/retrieve-invoice-item.mjs(2 hunks)components/stripe/actions/retrieve-payment-intent/retrieve-payment-intent.mjs(1 hunks)components/stripe/actions/retrieve-product/retrieve-product.mjs(1 hunks)components/stripe/actions/search-customers/search-customers.mjs(4 hunks)components/stripe/actions/update-customer/update-customer.mjs(4 hunks)components/stripe/actions/update-invoice-item/update-invoice-item.mjs(3 hunks)components/stripe/actions/update-invoice/update-invoice.mjs(3 hunks)components/stripe/actions/update-payment-intent/update-payment-intent.mjs(3 hunks)components/stripe/actions/update-payout/update-payout.mjs(1 hunks)components/stripe/actions/update-refund/update-refund.mjs(1 hunks)components/stripe/actions/void-invoice/void-invoice.mjs(2 hunks)components/stripe/actions/write-off-invoice/write-off-invoice.mjs(2 hunks)components/stripe/common/constants.mjs(2 hunks)components/stripe/common/utils.mjs(1 hunks)components/stripe/package.json(2 hunks)components/stripe/sources/common/webhook-base.mjs(4 hunks)components/stripe/stripe.app.mjs(9 hunks)
✅ Files skipped from review due to trivial changes (1)
- components/stripe/common/constants.mjs
🚧 Files skipped from review as they are similar to previous changes (24)
- components/stripe/actions/delete-invoice-item/delete-invoice-item.mjs
- components/stripe/actions/write-off-invoice/write-off-invoice.mjs
- components/stripe/actions/update-refund/update-refund.mjs
- components/stripe/actions/retrieve-invoice-item/retrieve-invoice-item.mjs
- components/stripe/actions/retrieve-checkout-session/retrieve-checkout-session.mjs
- components/stripe/actions/retrieve-product/retrieve-product.mjs
- components/stripe/actions/update-payout/update-payout.mjs
- components/stripe/actions/void-invoice/void-invoice.mjs
- components/stripe/actions/finalize-invoice/finalize-invoice.mjs
- components/stripe/actions/delete-or-void-invoice/delete-or-void-invoice.mjs
- components/stripe/actions/retrieve-payment-intent/retrieve-payment-intent.mjs
- components/stripe/actions/retrieve-checkout-session-line-items/retrieve-checkout-session-line-items.mjs
- components/stripe/actions/list-payment-intents/list-payment-intents.mjs
- components/stripe/actions/cancel-payment-intent/cancel-payment-intent.mjs
- components/stripe/actions/update-invoice/update-invoice.mjs
- components/stripe/actions/create-refund/create-refund.mjs
- components/stripe/actions/update-invoice-item/update-invoice-item.mjs
- components/stripe/actions/search-customers/search-customers.mjs
- components/stripe/actions/list-payouts/list-payouts.mjs
- components/stripe/actions/list-refunds/list-refunds.mjs
- components/stripe/actions/create-invoice-item/create-invoice-item.mjs
- components/stripe/actions/create-product/create-product.mjs
- components/stripe/actions/create-payout/create-payout.mjs
- components/stripe/actions/list-invoices/list-invoices.mjs
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: Publish TypeScript components
- GitHub Check: Lint Code Base
- GitHub Check: Verify TypeScript components
🔇 Additional comments (36)
components/stripe/package.json (2)
3-3: Version bumped from 0.6.4 to 0.7.0The version bump to 0.7.0 is appropriate given the significant upgrade to the Stripe SDK (from v8 to v18). This follows semantic versioning principles where non-breaking API improvements warrant a minor version increment.
13-13: Significant Stripe SDK version upgrade from v8 to v18Upgrading from Stripe SDK v8 to v18 is a major jump that brings the integration up to date with the latest Stripe API features and security improvements. This upgrade is aligned with the PR objectives to use the latest stable Stripe API version.
components/stripe/sources/common/webhook-base.mjs (3)
1-1: Import refactored fromstripetoappThe import has been updated to use the app instance wrapper instead of directly importing the Stripe SDK, consistent with the broader refactoring approach in this PR.
5-5: Property name updated fromstripetoappThis change aligns with the import change and ensures consistent naming throughout the codebase.
45-45: Updated Stripe SDK access to useapp.sdk()methodAll direct references to
this.stripehave been replaced withthis.app.sdk(), reflecting the new pattern for accessing the Stripe SDK through the app wrapper. This encapsulation makes SDK version management and configuration more centralized.Also applies to: 52-52, 65-65, 81-81
components/stripe/actions/capture-payment-intent/capture-payment-intent.mjs (5)
7-7: Version increment from 0.1.1 to 0.1.2Version number has been incremented appropriately to reflect changes in the component.
15-15: Prop naming standardization to camelCaseProps have been renamed from snake_case to camelCase (
payment_intent→paymentIntent,amount_to_capture→amountToCapture), improving consistency with JavaScript conventions while maintaining alignment with other components.Also applies to: 19-20
26-61: Enhanced explicit properties replacing genericadvancedpropThe generic
advancedprop has been replaced with explicit, well-documented properties:
metadataapplicationFeeAmountfinalCapturestatementDescriptorstatementDescriptorSuffixtransferDataAmountThis improves type safety, documentation, and developer experience by making available options clear and discoverable.
64-87: Refactored parameter handling with explicit mappingThe
runmethod now destructures specific properties and explicitly maps them to snake_case parameters required by the Stripe API. The conditional logic fortransferDataAmountproperly nests it within atransfer_dataobject, following Stripe's API structure.This approach increases code clarity and maintainability by making the parameter mapping explicit rather than relying on lodash.pick.
88-90: Updated success message to reflect new property namingThe success message has been updated to use the new camelCase property names, maintaining consistency throughout the component.
components/stripe/actions/list-balance-history/list-balance-history.mjs (6)
2-2: Added utils import for enhanced date handlingThe addition of the utils import provides access to functions for date conversion, which are used in the enhanced filtering parameters.
8-8: Significant version bump from 0.1.1 to 0.1.6The version jump from 0.1.1 to 0.1.6 reflects the substantial enhancements made to this component, including expanded filtering options and pagination capabilities.
25-27: Enhanced currency prop with default country parameterAdding a default country parameter (
{ country: "US" }) to the currency prop definition improves usability by providing sensible defaults.
31-69: Expanded transaction type options with detailed definitionsThe
typeprop has been enhanced from a simple propDefinition reference to a comprehensive string enum with all possible Stripe transaction types. This provides better documentation and type validation directly in the component.
76-111: Added comprehensive filtering and pagination optionsNew props have been added to support:
- Date-based filtering (
createdGt,createdGte,createdLt,createdLte)- Cursor-based pagination (
endingBefore,startingAfter)These additions significantly enhance the component's functionality, allowing for more precise data retrieval and efficient pagination through large result sets.
114-148: Refactored parameter building with date filter supportThe
runmethod has been refactored to:
- Use explicit destructuring for all properties
- Conditionally include date filtering parameters under a
createdobject- Convert date strings to timestamps using the utility function
fromDateToInteger- Properly pass pagination parameters
This implementation correctly translates the component's camelCase properties to Stripe's expected API parameters, while adding powerful filtering capabilities.
components/stripe/common/utils.mjs (3)
3-24: Well-structured recursive JSON parsing functionThis recursive
parseJsonimplementation handles nested JSON structures effectively, with proper error handling and type checking. The function can parse strings in deeply nested objects, which is valuable for handling complex Stripe metadata and other JSON inputs.
35-56: Robust array parsing with appropriate error handlingThe
parseArrayfunction has comprehensive validation and error handling. It properly checks for various input types and provides clear error messages when the input isn't a valid array.
58-67: Clear and consistent module exportsThe export pattern is consistent and provides good defaults. The exported
parseJsonfunction ensures objects are returned (defaulting to empty objects for non-object results), andparseArrayappliesparseJsonto each element for consistent handling.components/stripe/actions/create-subscription/create-subscription.mjs (2)
1-2: Proper migration to new SDK and naming conventionsThe code has been successfully updated to use the new app import pattern and properly increments the version. Props have been renamed from snake_case to camelCase for consistency with modern JavaScript conventions.
Also applies to: 8-8, 11-11, 14-14, 21-21, 29-29, 36-36, 50-62, 72-85
92-124: Thorough implementation of automatic tax configurationThe new automatic tax properties provide comprehensive control over Stripe's tax calculation features, with clear descriptions and appropriate option constraints.
components/stripe/actions/update-customer/update-customer.mjs (2)
1-1: Successfully migrated to new utils module and naming conventionsThe action has been properly updated to use the new utility functions and adopt consistent camelCase naming for address fields, which aligns with modern JavaScript conventions.
Also applies to: 8-8, 45-80
89-103: Well-structured property destructuringAll properties are clearly destructured, making the code more maintainable by explicitly showing which properties are being used.
components/stripe/actions/create-invoice/create-invoice.mjs (2)
7-90: Successfully updated props to match new SDK conventionsThe props have been properly renamed to camelCase and new automatic tax properties have been added with clear descriptions. The reorganization improves readability and consistency with other components.
93-106: Clean property destructuring for improved readabilityAll properties are clearly destructured, making the code more maintainable by explicitly showing which properties are being used.
components/stripe/stripe.app.mjs (11)
1-2: Properly upgraded Stripe SDK import style.The code correctly updates the Stripe import from default to named import, aligning with Stripe SDK v18.x requirements, and adds the constants import for centralized version management.
71-108: Naming convention improved with camelCase.The renaming from
payment_methodtopaymentMethodproperly aligns with JavaScript conventions and the updated Stripe SDK.
158-180: Rename to camelCase completed correctly.The change from
invoice_itemtoinvoiceItemmaintains consistent naming conventions across the codebase.
207-222: Consistent renaming of properties to camelCase.The properties
checkoutSessionandpaymentIntentare correctly renamed from snake_case to follow JavaScript conventions.
339-349: Updated statement descriptor documentation properly.The updated documentation for statement descriptors better reflects Stripe's current API terminology and limits.
353-354: Updated metadata description with documentation link.The metadata description now properly links to Stripe's documentation, improving developer experience.
396-402: Updated autoAdvance with improved description.The property has been renamed from snake_case and the description now properly links to Stripe's documentation on automatic collection.
403-418: Collection and due date properties renamed and documented.The
collectionMethodanddaysUntilDueproperties have been properly renamed from snake_case and their documentation has been enhanced.
481-540: Added comprehensive date filtering and pagination capabilities.Excellent addition of date filtering props (created and arrival date) with clear naming and descriptions. The pagination props properly follow Stripe's API conventions for cursor-based pagination.
541-600: Added detailed address and shipping fields.The addition of comprehensive address and shipping fields enhances the integration with Stripe's detailed customer data model.
606-611:✅ Verification successful
Updated SDK instantiation for version 18.
The SDK instantiation has been correctly updated to use the new
Stripenamed import and references the external API version constant instead of hardcoding it.
🏁 Script executed:
#!/bin/bash # Verify the API version constant used for Stripe SDK initialization # Check if the constants file exists and contains the API_VERSION constant cat components/stripe/common/constants.mjsLength of output: 639
🏁 Script executed:
#!/bin/bash # Verify Stripe import style in SDK initialization file rg -n "import.*stripe" -i components/stripe/stripe.app.mjsLength of output: 91
SDK Instantiation Verified for Stripe v18
Verified that the Stripe SDK is correctly instantiated using the imported
Stripeclass and the externalAPI_VERSIONconstant:
- In
components/stripe/stripe.app.mjs, you importStripefrom"stripe"and callsdk(apiVersion = constants.API_VERSION) { return new Stripe(this._apiKey(), { apiVersion, maxNetworkRetries: 2 }); }- In
components/stripe/common/constants.mjs,API_VERSIONis defined as"2025-03-31.basil".No further changes required.
components/stripe/actions/create-payment-intent/create-payment-intent.mjs
Show resolved
Hide resolved
f60fdb4 to
bb0ba34
Compare
components/stripe/actions/cancel-payment-intent/cancel-payment-intent.mjs
Outdated
Show resolved
Hide resolved
components/stripe/actions/confirm-payment-intent/confirm-payment-intent.mjs
Outdated
Show resolved
Hide resolved
bb0ba34 to
565e4e9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
♻️ Duplicate comments (3)
components/stripe/actions/create-payment-intent/create-payment-intent.mjs (1)
64-80:⚠️ Potential issueMissing JSON parsing for metadata
The metadata property is passed directly without parsing, unlike other Stripe actions that use
utils.parseJson. This inconsistency might lead to issues if users provide JSON strings.+import utils from "../../common/utils.mjs"; ... - metadata, + metadata: utils.parseJson(metadata),components/stripe/actions/update-customer/update-customer.mjs (1)
99-116:⚠️ Potential issueFix logical error in address condition
There's a logical error in the conditional check for including the address object. The missing parentheses around the condition and use of logical AND could lead to unexpected behavior.
- ...( - addressCity - || addressCountry - || addressLine1 - || addressLine2 - || addressPostalCode - || addressState - && { + ...(( + addressCity + || addressCountry + || addressLine1 + || addressLine2 + || addressPostalCode + || addressState + ) && { address: { city: addressCity, country: addressCountry, line1: addressLine1, line2: addressLine2, postal_code: addressPostalCode, state: addressState, }, - } + })components/stripe/actions/create-customer/create-customer.mjs (1)
386-401: 🛠️ Refactor suggestionMissing JSON parsing for metadata
Similar to other actions like update-payment-intent.mjs, metadata should be parsed using utils.parseJson for consistency.
- metadata, + metadata: utils.parseJson(metadata),
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (62)
components/stripe/actions/cancel-or-reverse-payout/cancel-or-reverse-payout.mjs(1 hunks)components/stripe/actions/cancel-payment-intent/cancel-payment-intent.mjs(1 hunks)components/stripe/actions/capture-payment-intent/capture-payment-intent.mjs(1 hunks)components/stripe/actions/confirm-payment-intent/confirm-payment-intent.mjs(2 hunks)components/stripe/actions/create-billing-meter/create-billing-meter.mjs(1 hunks)components/stripe/actions/create-customer/create-customer.mjs(1 hunks)components/stripe/actions/create-invoice-item/create-invoice-item.mjs(2 hunks)components/stripe/actions/create-invoice/create-invoice.mjs(1 hunks)components/stripe/actions/create-payment-intent/create-payment-intent.mjs(2 hunks)components/stripe/actions/create-payout/create-payout.mjs(2 hunks)components/stripe/actions/create-price/create-price.mjs(2 hunks)components/stripe/actions/create-product/create-product.mjs(4 hunks)components/stripe/actions/create-refund/create-refund.mjs(3 hunks)components/stripe/actions/create-subscription/create-subscription.mjs(3 hunks)components/stripe/actions/create-usage-record/create-usage-record.mjs(0 hunks)components/stripe/actions/delete-customer/delete-customer.mjs(2 hunks)components/stripe/actions/delete-invoice-item/delete-invoice-item.mjs(3 hunks)components/stripe/actions/delete-or-void-invoice/delete-or-void-invoice.mjs(2 hunks)components/stripe/actions/finalize-invoice/finalize-invoice.mjs(2 hunks)components/stripe/actions/list-balance-history/list-balance-history.mjs(2 hunks)components/stripe/actions/list-customers/list-customers.mjs(2 hunks)components/stripe/actions/list-invoices/list-invoices.mjs(3 hunks)components/stripe/actions/list-payment-intents/list-payment-intents.mjs(2 hunks)components/stripe/actions/list-payouts/list-payouts.mjs(1 hunks)components/stripe/actions/list-refunds/list-refunds.mjs(3 hunks)components/stripe/actions/retrieve-balance/retrieve-balance.mjs(1 hunks)components/stripe/actions/retrieve-checkout-session-line-items/retrieve-checkout-session-line-items.mjs(2 hunks)components/stripe/actions/retrieve-checkout-session/retrieve-checkout-session.mjs(1 hunks)components/stripe/actions/retrieve-customer/retrieve-customer.mjs(2 hunks)components/stripe/actions/retrieve-invoice-item/retrieve-invoice-item.mjs(3 hunks)components/stripe/actions/retrieve-invoice/retrieve-invoice.mjs(2 hunks)components/stripe/actions/retrieve-payment-intent/retrieve-payment-intent.mjs(1 hunks)components/stripe/actions/retrieve-payout/retrieve-payout.mjs(2 hunks)components/stripe/actions/retrieve-price/retrieve-price.mjs(2 hunks)components/stripe/actions/retrieve-product/retrieve-product.mjs(1 hunks)components/stripe/actions/retrieve-refund/retrieve-refund.mjs(2 hunks)components/stripe/actions/search-customers/search-customers.mjs(4 hunks)components/stripe/actions/send-invoice/send-invoice.mjs(2 hunks)components/stripe/actions/update-customer/update-customer.mjs(4 hunks)components/stripe/actions/update-invoice-item/update-invoice-item.mjs(3 hunks)components/stripe/actions/update-invoice/update-invoice.mjs(3 hunks)components/stripe/actions/update-payment-intent/update-payment-intent.mjs(3 hunks)components/stripe/actions/update-payout/update-payout.mjs(1 hunks)components/stripe/actions/update-refund/update-refund.mjs(1 hunks)components/stripe/actions/void-invoice/void-invoice.mjs(2 hunks)components/stripe/actions/write-off-invoice/write-off-invoice.mjs(2 hunks)components/stripe/common/constants.mjs(2 hunks)components/stripe/common/utils.mjs(1 hunks)components/stripe/package.json(2 hunks)components/stripe/sources/abandoned-cart/abandoned-cart.mjs(1 hunks)components/stripe/sources/canceled-subscription/canceled-subscription.mjs(1 hunks)components/stripe/sources/common/webhook-base.mjs(4 hunks)components/stripe/sources/custom-webhook-events/custom-webhook-events.mjs(1 hunks)components/stripe/sources/new-customer/new-customer.mjs(1 hunks)components/stripe/sources/new-dispute/new-dispute.mjs(1 hunks)components/stripe/sources/new-failed-invoice-payment/new-failed-invoice-payment.mjs(1 hunks)components/stripe/sources/new-failed-payment/new-failed-payment.mjs(1 hunks)components/stripe/sources/new-invoice/new-invoice.mjs(1 hunks)components/stripe/sources/new-payment/new-payment.mjs(1 hunks)components/stripe/sources/new-subscription/new-subscription.mjs(1 hunks)components/stripe/sources/subscription-updated/subscription-updated.mjs(1 hunks)components/stripe/stripe.app.mjs(9 hunks)
💤 Files with no reviewable changes (1)
- components/stripe/actions/create-usage-record/create-usage-record.mjs
✅ Files skipped from review due to trivial changes (1)
- components/stripe/actions/create-price/create-price.mjs
🚧 Files skipped from review as they are similar to previous changes (51)
- components/stripe/sources/new-payment/new-payment.mjs
- components/stripe/sources/custom-webhook-events/custom-webhook-events.mjs
- components/stripe/sources/new-customer/new-customer.mjs
- components/stripe/sources/abandoned-cart/abandoned-cart.mjs
- components/stripe/sources/new-failed-invoice-payment/new-failed-invoice-payment.mjs
- components/stripe/common/constants.mjs
- components/stripe/sources/new-failed-payment/new-failed-payment.mjs
- components/stripe/package.json
- components/stripe/sources/new-subscription/new-subscription.mjs
- components/stripe/sources/new-invoice/new-invoice.mjs
- components/stripe/actions/update-refund/update-refund.mjs
- components/stripe/sources/canceled-subscription/canceled-subscription.mjs
- components/stripe/actions/delete-customer/delete-customer.mjs
- components/stripe/sources/common/webhook-base.mjs
- components/stripe/actions/write-off-invoice/write-off-invoice.mjs
- components/stripe/sources/new-dispute/new-dispute.mjs
- components/stripe/actions/retrieve-invoice/retrieve-invoice.mjs
- components/stripe/actions/retrieve-balance/retrieve-balance.mjs
- components/stripe/actions/void-invoice/void-invoice.mjs
- components/stripe/actions/retrieve-invoice-item/retrieve-invoice-item.mjs
- components/stripe/sources/subscription-updated/subscription-updated.mjs
- components/stripe/actions/delete-or-void-invoice/delete-or-void-invoice.mjs
- components/stripe/actions/retrieve-payout/retrieve-payout.mjs
- components/stripe/actions/send-invoice/send-invoice.mjs
- components/stripe/actions/retrieve-customer/retrieve-customer.mjs
- components/stripe/actions/create-billing-meter/create-billing-meter.mjs
- components/stripe/actions/retrieve-price/retrieve-price.mjs
- components/stripe/actions/update-payout/update-payout.mjs
- components/stripe/actions/finalize-invoice/finalize-invoice.mjs
- components/stripe/actions/retrieve-checkout-session/retrieve-checkout-session.mjs
- components/stripe/actions/list-payment-intents/list-payment-intents.mjs
- components/stripe/actions/update-invoice-item/update-invoice-item.mjs
- components/stripe/actions/retrieve-product/retrieve-product.mjs
- components/stripe/actions/retrieve-payment-intent/retrieve-payment-intent.mjs
- components/stripe/actions/list-customers/list-customers.mjs
- components/stripe/actions/delete-invoice-item/delete-invoice-item.mjs
- components/stripe/actions/retrieve-checkout-session-line-items/retrieve-checkout-session-line-items.mjs
- components/stripe/actions/list-invoices/list-invoices.mjs
- components/stripe/actions/capture-payment-intent/capture-payment-intent.mjs
- components/stripe/actions/retrieve-refund/retrieve-refund.mjs
- components/stripe/actions/cancel-or-reverse-payout/cancel-or-reverse-payout.mjs
- components/stripe/actions/create-payout/create-payout.mjs
- components/stripe/actions/update-invoice/update-invoice.mjs
- components/stripe/actions/create-invoice-item/create-invoice-item.mjs
- components/stripe/actions/list-refunds/list-refunds.mjs
- components/stripe/common/utils.mjs
- components/stripe/actions/search-customers/search-customers.mjs
- components/stripe/actions/cancel-payment-intent/cancel-payment-intent.mjs
- components/stripe/actions/create-invoice/create-invoice.mjs
- components/stripe/actions/list-payouts/list-payouts.mjs
- components/stripe/actions/create-product/create-product.mjs
⏰ Context from checks skipped due to timeout of 90000ms (4)
- GitHub Check: Verify TypeScript components
- GitHub Check: pnpm publish
- GitHub Check: Publish TypeScript components
- GitHub Check: Lint Code Base
🔇 Additional comments (43)
components/stripe/actions/list-balance-history/list-balance-history.mjs (6)
2-2: Good addition of utility moduleAdding the utils module enables the action to properly handle date conversions for filtering, which is crucial for the newly added date range filtering capabilities.
8-9: Version bump appropriately reflects changesThe version increment from 0.1.1 to 0.1.6 accurately reflects the significant enhancements made to this action, including expanded filtering capabilities and improved documentation.
12-17: Helpful informational alert addedThe new informational alert provides users with valuable context about the action's behavior and includes a link to the Stripe documentation.
34-72: Enhanced transaction type optionsReplacing the previous propDefinition with an explicit list of transaction types improves the action's usability by providing a comprehensive set of options with proper labeling and description.
79-114: Great addition of filtering and pagination capabilitiesThe new date range filtering props (
createdGt,createdGte,createdLt,createdLte) and pagination props (endingBefore,startingAfter) significantly enhance the query capabilities of this action, allowing for more precise and flexible data retrieval.
117-151: Well-structured parameter constructionThe refactored run method improves code clarity and maintainability by:
- Explicitly destructuring all props
- Clearly building the parameters object with conditional date filters
- Using utility functions for date conversion
- Properly passing pagination parameters
This approach makes the code more readable and easier to maintain.
components/stripe/actions/create-subscription/create-subscription.mjs (5)
1-2: Good import refactoringRenaming the import to
appand adding the utilities module improves consistency across the codebase and enables robust JSON and array parsing.
50-62: Consistent naming conventionConverting props from snake_case to camelCase (e.g.,
collectionMethod,daysUntilDue,defaultPaymentMethod) improves consistency across the codebase and provides a better user experience.
92-112: Enhanced automatic tax handlingThe addition of automatic tax-related props allows users to configure tax calculations with fine-grained control, including liability type and account references.
113-124: Helpful payment behavior optionsThe new
paymentBehaviorprop with clear options and documentation improves flexibility when creating subscriptions with different initial states.
149-169: Improved parameter handlingThe use of utility functions for parsing JSON metadata and array items enhances robustness and error handling. The conditional inclusion of automatic tax parameters is well-structured and maintainable.
components/stripe/actions/create-refund/create-refund.mjs (3)
12-16: Helpful informational alertAdding an informational alert provides valuable context about refund behavior and includes a link to Stripe documentation.
36-45: Improved reason optionsConverting the
reasonprop to an explicit string prop with defined options and documentation enhances usability by providing clear guidance on available choices.
66-85: Well-structured parameter mappingThe refactored
runmethod with explicit destructuring and parameter mapping improves code clarity and maintainability while correctly handling the conversion between camelCase prop names and snake_case API parameters.components/stripe/actions/create-payment-intent/create-payment-intent.mjs (2)
81-86: Elegant inline truncationThe inline truncation of
statementDescriptorandstatementDescriptorSuffixwithin the parameter construction is a clean approach that improves code readability while ensuring values meet Stripe's length requirements.
88-88: Improved summary message formattingUsing backticks around dynamic values in the summary message improves readability and makes the message more consistent with other Stripe actions.
components/stripe/actions/update-customer/update-customer.mjs (1)
132-139: Successfully updated to use explicit parameter destructuringThe code was refactored to use explicit parameter destructuring and properly map props to their corresponding Stripe API parameters, making the code more maintainable.
components/stripe/actions/update-payment-intent/update-payment-intent.mjs (2)
182-217: Well-structured conditional parameter buildingThe
getOtherParamsmethod correctly builds nested objects for shipping, statement descriptors, and other parameters only when relevant fields are present. This is a cleaner approach than the previous implementation.
235-246: Good implementation of explicit parameter handlingThe SDK call now explicitly maps all parameters and properly parses JSON metadata. This is more maintainable than using lodash.pick with an advanced options object.
components/stripe/actions/create-customer/create-customer.mjs (1)
256-363: Well-structured conditional parameter buildingThe
getOtherParamsmethod effectively handles the conditional construction of nested objects for address, shipping, tax, cash balance, and invoice settings. This is a clear and maintainable approach.components/stripe/actions/confirm-payment-intent/confirm-payment-intent.mjs (3)
248-309: Well-structured conditional parameter building with proper nestingThe
getOtherParamsmethod correctly builds nested objects for shipping, mandate data, and radar options only when relevant fields are present. The conditional logic using ternary operators avoids operator precedence issues that could cause runtime errors.
342-342: Correctly parsing payment method options as JSONGood use of
utils.parseJsonfor thepaymentMethodOptionsparameter, ensuring proper conversion from string to object format as required by the Stripe API.
12-17: Helpful contextual alert for usersAdding an informational alert is a user-friendly touch that provides context about the action's behavior and links to the relevant documentation.
components/stripe/stripe.app.mjs (20)
1-2: Updated import style for Stripe SDK compatibilityThe import has been changed from a default import to a named import, matching the requirements of the upgraded Stripe SDK version (v18.0.0). This is accompanied by importing constants from a newly created common module that contains the API version information.
71-71: Property naming convention changed to camelCaseThe property has been renamed from snake_case
payment_methodto camelCasepaymentMethod, following JavaScript conventions and making the codebase more consistent.
158-158: Property naming convention changed to camelCaseThe property has been renamed from snake_case
invoice_itemto camelCaseinvoiceItem, aligning with JavaScript conventions.
207-207: Property naming convention changed to camelCaseThe property has been renamed from snake_case
checkout_sessionto camelCasecheckoutSession, following JavaScript conventions.
213-213: Property naming convention changed to camelCaseThe property has been renamed from snake_case
payment_intentto camelCasepaymentIntent, aligning with JavaScript conventions.
292-293: Property naming convention changed to camelCaseThe property has been renamed from snake_case
payment_intent_client_secretto camelCasepaymentIntentClientSecret, following JavaScript conventions.
299-300: Property naming convention changed to camelCaseThe property has been renamed from snake_case
payment_intent_cancellation_reasonto camelCasepaymentIntentCancellationReason, following JavaScript conventions.
317-318: Property naming convention changed to camelCaseThe property has been renamed from snake_case
payment_method_typesto camelCasepaymentMethodTypes, following JavaScript conventions.
338-343: Updated statement descriptor documentationThe description for
statementDescriptorhas been enhanced with more detailed information about character limits and linking to official documentation, improving developer understanding.
344-349: Added statement descriptor suffix propertyA new property
statementDescriptorSuffixhas been added to support the Stripe feature that allows appending a suffix to the statement descriptor prefix. This enhances flexibility for merchants managing payment descriptors.
353-353: Enhanced metadata descriptionThe description for
metadatahas been updated with a link to Stripe's documentation and more detailed explanation of how metadata can be used and modified, improving developer understanding.
359-378: Improved descriptions for common propertiesThe descriptions for
name,phone, anddescriptionproperties have been enhanced with more detailed and accurate information, better explaining their purpose and constraints.
380-381: Property naming convention changed to camelCaseThe property has been renamed from snake_case
setup_future_usageto camelCasesetupFutureUsage, following JavaScript conventions.
396-402: Property naming convention changed to camelCase with improved documentationThe property has been renamed from snake_case
auto_advanceto camelCaseautoAdvance, with an updated label and more detailed description linking to Stripe's documentation.
403-412: Property naming convention changed to camelCase with improved documentationThe property has been renamed from snake_case
collection_methodto camelCasecollectionMethod, with an updated description that better explains the behavior of each option.
413-418: Property naming convention changed to camelCase with improved documentationThe property has been renamed from snake_case
days_until_dueto camelCasedaysUntilDue, with an updated label and clearer description.
481-540: Added filtering and pagination propertiesNew filtering and pagination properties have been added to enhance querying capabilities:
- Date-based filtering:
createdGt,createdGte,createdLt,createdLte,arrivalDateGt,arrivalDateGte,arrivalDateLt,arrivalDateLte- Cursor-based pagination:
endingBefore,startingAfterThese additions align with Stripe's API capabilities and provide more flexibility when retrieving resources.
541-600: Added structured address and shipping propertiesNew properties have been added for address and shipping information:
- Address fields:
addressCity,addressCountry,addressLine1,addressLine2,addressPostalCode,addressState- Shipping fields:
shippingName,shippingCarrier,shippingPhone,shippingTrackingNumberThese replace the previous flat address fields and provide better structure and organization for address and shipping data.
606-608: Updated SDK instantiation for compatibility with Stripe v18The SDK instantiation has been updated to use:
- The new class-based initialization with
new Stripe()rather than the function-call style- The API version from the constants module (
constants.API_VERSION)This change ensures compatibility with the upgraded Stripe SDK (v18) and centralizes API version management.
1-608:❓ Verification inconclusive
Verify API version compatibility with production systems
The code update changes the Stripe API version to "2025-03-31.basil" as noted in the PR summary. This is a significant version jump from the previous "2020-03-02".
While the code changes look good, it's important to verify that all features used in production are compatible with this newer API version, as Stripe may have deprecated or changed behaviors for certain endpoints.
🌐 Web query:
What are the major changes between Stripe API version 2020-03-02 and 2025-03-31.basil?💡 Result:
Between Stripe API versions 2020-03-02 and 2025-03-31.basil, several significant changes have been implemented:
1. Billing Enhancements:
- Coupon Management: Support for discount coupons without specified end times has been removed, and parameters for stackable discounts have been reorganized. (docs.stripe.com)
- Invoice Flexibility: Top-level price fields have been replaced with improved price modeling on Invoice Items and Invoice Line Items. Additionally, support for multiple (partial) payments on invoices has been added. (docs.stripe.com)
2. Checkout Session Updates:
- Subscription Handling: The creation of subscriptions is now postponed until after the user completes payment, enhancing latency and allowing customers to modify billing details post-payment. (docs.stripe.com)
- Custom UI Mode: A new
ui_modeparameter allows the use of Elements and Checkout Sessions to design custom checkout pages. (docs.stripe.com)3. Payment Method Support:
- New Integrations: Support has been added for Affirm, Pix, Billie, Klarna on Hosted Invoice Pages, Naver Pay, Satispay, and New Zealand’s BECS Direct Debit across various APIs. (docs.stripe.com)
4. API Versioning and Release Process:
- Basil Release: The 2025-03-31.basil release introduces breaking changes and new features, with subsequent Basil versions focusing on additive changes. This aligns with Stripe's new API release process, which combines semiannual major updates with monthly feature enhancements. (docs.stripe.com, stripe.com)
5. Deprecations and Removals:
- Total Count Expansion: The ability to expand the
total_countproperty on list API methods has been removed, as it is no longer a recommended integration pattern. (docs.stripe.com)For a comprehensive list of changes, refer to Stripe's official changelog. (docs.stripe.com)
Citations:
- 1: https://docs.stripe.com/changelog/basil?utm_source=openai
- 2: https://docs.stripe.com/changelog/basil?utm_source=openai
- 3: https://docs.stripe.com/changelog/basil?utm_source=openai
- 4: https://docs.stripe.com/changelog/basil?utm_source=openai
- 5: https://docs.stripe.com/changelog/basil?utm_source=openai
- 6: https://docs.stripe.com/changelog/basil?utm_source=openai
- 7: https://stripe.com/blog/introducing-stripes-new-api-release-process?utm_source=openai
- 8: https://docs.stripe.com/changelog/basil?utm_source=openai
- 9: https://docs.stripe.com/changelog?utm_source=openai
Verify compatibility with Stripe API v2025-03-31.basil
We’ve jumped from v2020-03-02 to v2025-03-31.basil, which introduces several breaking and behavioral changes. Before rolling this out, please confirm that none of these impact your production workflows:
- Coupon management no longer supports open-ended coupons or old stacking parameters.
- Invoice price fields have been revamped to live on Line Items/Invoice Items, and partial payments on invoices are now allowed.
- Checkout Sessions now postpone subscription creation until after payment and add a new
ui_modefor custom UIs.- The
total_countexpand parameter on list endpoints has been removed—ensure you’re not relying on it.- New payment methods (Affirm, Pix, Klarna, etc.) have been added—verify that existing types still function as expected.
Action items:
- Audit any usage of
total_countexpansions.- Review invoice-related code for price field changes.
- Test customer/checkout flows (subscription creation, custom UI) in a staging environment.
- Validate that all production‐critical endpoints behave as before under the new API version.
luancazarine
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @jcortes, I just added a minor suggestion.
components/stripe/actions/list-balance-history/list-balance-history.mjs
Outdated
Show resolved
Hide resolved
565e4e9 to
05e96e4
Compare
d4a9734
d4a9734 to
75a18ee
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🔭 Outside diff range comments (1)
components/stripe/stripe.app.mjs (1)
71-108: 💡 Verification agent🧩 Analysis chain
Breaking change: Property names converted from snake_case to camelCase.
The systematic conversion from snake_case to camelCase (e.g.,
payment_method→paymentMethod,invoice_item→invoiceItem) improves naming consistency but constitutes a breaking change for existing integrations.Also applies to: 158-180, 207-212, 213-222, 292-298, 299-310, 317-337, 380-389, 403-418
🏁 Script executed:
#!/bin/bash # Description: Verify all action and source files have been updated to use the new camelCase prop names # Expected: No usage of old snake_case prop names should remain # Check for usage of old snake_case prop names that were changed rg 'payment_method|invoice_item|checkout_session|payment_intent|setup_future_usage|collection_method|days_until_due|statement_descriptor' --type js --type mjs -A 3Length of output: 193
🏁 Script executed:
#!/bin/bash # Description: Verify all action and source files have been updated to use the new camelCase prop names # Checks for any remaining snake_case usage in .js, .mjs, .ts, and .tsx files rg -g '*.js' -g '*.mjs' -g '*.ts' -g '*.tsx' \ 'payment_method|invoice_item|checkout_session|payment_intent|setup_future_usage|collection_method|days_until_due|statement_descriptor' -A 3 || echo "No matches found"Length of output: 38488
Fix remaining snake_case props in Stripe components
The conversion from snake_case to camelCase in your Stripe props is a breaking change and several Stripe files still reference the old names. Please update these to the new camelCase properties (or provide backwards‐compatibility shims) before merging.
Files requiring updates:
- components/stripe/actions/update-invoice/update-invoice.mjs
• days_until_due → daysUntilDue
• default_payment_method → defaultPaymentMethod
• collection_method → collectionMethod- components/stripe/actions/list-refunds/list-refunds.mjs
• payment_intent → paymentIntent- components/stripe/actions/list-invoices/list-invoices.mjs
• collection_method → collectionMethod- components/stripe/actions/create-payout/create-payout.mjs
• statement_descriptor → statementDescriptor
• source_type → sourceType- components/stripe/actions/create-payment-intent/create-payment-intent.mjs
• payment_method_types → paymentMethodTypes
• statement_descriptor → statementDescriptor
• statement_descriptor_suffix → statementDescriptorSuffix- components/stripe/actions/confirm-payment-intent/confirm-payment-intent.mjs
• payment_method → paymentMethod
• setup_future_usage → setupFutureUsage- components/stripe/actions/update-payment-intent/update-payment-intent.mjs
• setup_future_usage → setupFutureUsage- components/stripe/actions/create-customer/create-customer.mjs
• default_payment_method → defaultPaymentMethod
• payment_method → paymentMethod- components/stripe/actions/create-subscription/create-subscription.mjs
• collection_method → collectionMethod
• days_until_due → daysUntilDue- components/stripe/actions/delete-invoice-item/delete-invoice-item.mjs
• invoice_item → invoiceItem- components/stripe/actions/create-refund/create-refund.mjs
• payment_intent → paymentIntent- components/stripe/actions/capture-payment-intent/capture-payment-intent.mjs
• statement_descriptor → statementDescriptor
• statement_descriptor_suffix → statementDescriptorSuffix- components/stripe/sources/common/constants.mjs
• allpayment_intent.*andpayment_method.*event keys- components/stripe/sources/*.mjs test‐event fixtures
• update any snake_case event payload fields to camelCase
♻️ Duplicate comments (1)
components/stripe/actions/create-customer/create-customer.mjs (1)
352-391: Clean parameter mapping with proper array parsing.The explicit destructuring and parameter construction is well-implemented. The use of
utils.parseArray(taxIdData)correctly handles the tax ID data array. However, the metadata field should be parsed as JSON for consistency.The metadata should be parsed using
utils.parseJson(metadata)for consistency with other actions likeupdate-payment-intent.mjs.- metadata, + metadata: utils.parseJson(metadata),
🧹 Nitpick comments (3)
components/stripe/stripe.app.mjs (3)
508-509: Fix inconsistent descriptions for arrival date filters.The descriptions for
arrivalDateGtandarrivalDateGteincorrectly state "transactions that were created after this date" when they should refer to arrival dates.- description: "Only return transactions that were created after this date (exclusive). In ISO 8601 format. Eg. `2023-01-01T00:00:00Z`", + description: "Only return transactions that arrived after this date (exclusive). In ISO 8601 format. Eg. `2023-01-01T00:00:00Z`",- description: "Only return transactions that were created after this date (inclusive). In ISO 8601 format. Eg. `2023-01-01T00:00:00Z`", + description: "Only return transactions that arrived after this date (inclusive). In ISO 8601 format. Eg. `2023-01-01T00:00:00Z`",Also applies to: 514-515
541-600: Good addition of address and shipping props with minor description inconsistencies.The new address and shipping props provide comprehensive coverage for address handling. However, there are some inconsistencies in the descriptions.
Fix these description inconsistencies:
- label: "Shipping - Address - Line 2", + label: "Address - Line 2",- label: "Shipping - Address - State", + label: "Address - State",
359-360: Fix typo in description.There's a typo in the name prop description: "resouce" should be "resource".
- description: "The resouce name", + description: "The resource name",
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (62)
components/stripe/actions/cancel-or-reverse-payout/cancel-or-reverse-payout.mjs(1 hunks)components/stripe/actions/cancel-payment-intent/cancel-payment-intent.mjs(1 hunks)components/stripe/actions/capture-payment-intent/capture-payment-intent.mjs(1 hunks)components/stripe/actions/confirm-payment-intent/confirm-payment-intent.mjs(2 hunks)components/stripe/actions/create-billing-meter/create-billing-meter.mjs(1 hunks)components/stripe/actions/create-customer/create-customer.mjs(1 hunks)components/stripe/actions/create-invoice-item/create-invoice-item.mjs(2 hunks)components/stripe/actions/create-invoice/create-invoice.mjs(1 hunks)components/stripe/actions/create-payment-intent/create-payment-intent.mjs(2 hunks)components/stripe/actions/create-payout/create-payout.mjs(2 hunks)components/stripe/actions/create-price/create-price.mjs(2 hunks)components/stripe/actions/create-product/create-product.mjs(4 hunks)components/stripe/actions/create-refund/create-refund.mjs(3 hunks)components/stripe/actions/create-subscription/create-subscription.mjs(3 hunks)components/stripe/actions/create-usage-record/create-usage-record.mjs(0 hunks)components/stripe/actions/delete-customer/delete-customer.mjs(2 hunks)components/stripe/actions/delete-invoice-item/delete-invoice-item.mjs(3 hunks)components/stripe/actions/delete-or-void-invoice/delete-or-void-invoice.mjs(2 hunks)components/stripe/actions/finalize-invoice/finalize-invoice.mjs(2 hunks)components/stripe/actions/list-balance-history/list-balance-history.mjs(2 hunks)components/stripe/actions/list-customers/list-customers.mjs(2 hunks)components/stripe/actions/list-invoices/list-invoices.mjs(3 hunks)components/stripe/actions/list-payment-intents/list-payment-intents.mjs(2 hunks)components/stripe/actions/list-payouts/list-payouts.mjs(1 hunks)components/stripe/actions/list-refunds/list-refunds.mjs(3 hunks)components/stripe/actions/retrieve-balance/retrieve-balance.mjs(1 hunks)components/stripe/actions/retrieve-checkout-session-line-items/retrieve-checkout-session-line-items.mjs(2 hunks)components/stripe/actions/retrieve-checkout-session/retrieve-checkout-session.mjs(1 hunks)components/stripe/actions/retrieve-customer/retrieve-customer.mjs(2 hunks)components/stripe/actions/retrieve-invoice-item/retrieve-invoice-item.mjs(3 hunks)components/stripe/actions/retrieve-invoice/retrieve-invoice.mjs(2 hunks)components/stripe/actions/retrieve-payment-intent/retrieve-payment-intent.mjs(1 hunks)components/stripe/actions/retrieve-payout/retrieve-payout.mjs(2 hunks)components/stripe/actions/retrieve-price/retrieve-price.mjs(2 hunks)components/stripe/actions/retrieve-product/retrieve-product.mjs(1 hunks)components/stripe/actions/retrieve-refund/retrieve-refund.mjs(2 hunks)components/stripe/actions/search-customers/search-customers.mjs(5 hunks)components/stripe/actions/send-invoice/send-invoice.mjs(2 hunks)components/stripe/actions/update-customer/update-customer.mjs(4 hunks)components/stripe/actions/update-invoice-item/update-invoice-item.mjs(3 hunks)components/stripe/actions/update-invoice/update-invoice.mjs(3 hunks)components/stripe/actions/update-payment-intent/update-payment-intent.mjs(3 hunks)components/stripe/actions/update-payout/update-payout.mjs(1 hunks)components/stripe/actions/update-refund/update-refund.mjs(1 hunks)components/stripe/actions/void-invoice/void-invoice.mjs(2 hunks)components/stripe/actions/write-off-invoice/write-off-invoice.mjs(2 hunks)components/stripe/common/constants.mjs(2 hunks)components/stripe/common/utils.mjs(1 hunks)components/stripe/package.json(2 hunks)components/stripe/sources/abandoned-cart/abandoned-cart.mjs(1 hunks)components/stripe/sources/canceled-subscription/canceled-subscription.mjs(1 hunks)components/stripe/sources/common/webhook-base.mjs(4 hunks)components/stripe/sources/custom-webhook-events/custom-webhook-events.mjs(1 hunks)components/stripe/sources/new-customer/new-customer.mjs(1 hunks)components/stripe/sources/new-dispute/new-dispute.mjs(1 hunks)components/stripe/sources/new-failed-invoice-payment/new-failed-invoice-payment.mjs(1 hunks)components/stripe/sources/new-failed-payment/new-failed-payment.mjs(1 hunks)components/stripe/sources/new-invoice/new-invoice.mjs(1 hunks)components/stripe/sources/new-payment/new-payment.mjs(1 hunks)components/stripe/sources/new-subscription/new-subscription.mjs(1 hunks)components/stripe/sources/subscription-updated/subscription-updated.mjs(1 hunks)components/stripe/stripe.app.mjs(9 hunks)
💤 Files with no reviewable changes (1)
- components/stripe/actions/create-usage-record/create-usage-record.mjs
✅ Files skipped from review due to trivial changes (1)
- components/stripe/actions/create-price/create-price.mjs
🚧 Files skipped from review as they are similar to previous changes (55)
- components/stripe/actions/create-billing-meter/create-billing-meter.mjs
- components/stripe/actions/create-payout/create-payout.mjs
- components/stripe/actions/create-invoice-item/create-invoice-item.mjs
- components/stripe/actions/retrieve-invoice/retrieve-invoice.mjs
- components/stripe/sources/abandoned-cart/abandoned-cart.mjs
- components/stripe/common/constants.mjs
- components/stripe/sources/new-subscription/new-subscription.mjs
- components/stripe/sources/new-failed-payment/new-failed-payment.mjs
- components/stripe/package.json
- components/stripe/actions/list-refunds/list-refunds.mjs
- components/stripe/sources/new-dispute/new-dispute.mjs
- components/stripe/sources/new-invoice/new-invoice.mjs
- components/stripe/sources/new-customer/new-customer.mjs
- components/stripe/sources/custom-webhook-events/custom-webhook-events.mjs
- components/stripe/sources/new-payment/new-payment.mjs
- components/stripe/sources/canceled-subscription/canceled-subscription.mjs
- components/stripe/sources/common/webhook-base.mjs
- components/stripe/actions/delete-or-void-invoice/delete-or-void-invoice.mjs
- components/stripe/actions/delete-customer/delete-customer.mjs
- components/stripe/sources/new-failed-invoice-payment/new-failed-invoice-payment.mjs
- components/stripe/sources/subscription-updated/subscription-updated.mjs
- components/stripe/actions/retrieve-balance/retrieve-balance.mjs
- components/stripe/actions/write-off-invoice/write-off-invoice.mjs
- components/stripe/actions/retrieve-customer/retrieve-customer.mjs
- components/stripe/actions/finalize-invoice/finalize-invoice.mjs
- components/stripe/actions/delete-invoice-item/delete-invoice-item.mjs
- components/stripe/actions/update-refund/update-refund.mjs
- components/stripe/actions/void-invoice/void-invoice.mjs
- components/stripe/actions/retrieve-checkout-session/retrieve-checkout-session.mjs
- components/stripe/actions/send-invoice/send-invoice.mjs
- components/stripe/actions/retrieve-invoice-item/retrieve-invoice-item.mjs
- components/stripe/actions/retrieve-payout/retrieve-payout.mjs
- components/stripe/actions/list-balance-history/list-balance-history.mjs
- components/stripe/actions/list-payment-intents/list-payment-intents.mjs
- components/stripe/actions/update-payout/update-payout.mjs
- components/stripe/actions/update-invoice-item/update-invoice-item.mjs
- components/stripe/actions/retrieve-checkout-session-line-items/retrieve-checkout-session-line-items.mjs
- components/stripe/actions/retrieve-price/retrieve-price.mjs
- components/stripe/actions/list-customers/list-customers.mjs
- components/stripe/actions/retrieve-payment-intent/retrieve-payment-intent.mjs
- components/stripe/actions/retrieve-product/retrieve-product.mjs
- components/stripe/actions/search-customers/search-customers.mjs
- components/stripe/common/utils.mjs
- components/stripe/actions/capture-payment-intent/capture-payment-intent.mjs
- components/stripe/actions/retrieve-refund/retrieve-refund.mjs
- components/stripe/actions/create-refund/create-refund.mjs
- components/stripe/actions/cancel-payment-intent/cancel-payment-intent.mjs
- components/stripe/actions/create-payment-intent/create-payment-intent.mjs
- components/stripe/actions/list-invoices/list-invoices.mjs
- components/stripe/actions/create-product/create-product.mjs
- components/stripe/actions/update-invoice/update-invoice.mjs
- components/stripe/actions/create-subscription/create-subscription.mjs
- components/stripe/actions/create-invoice/create-invoice.mjs
- components/stripe/actions/update-customer/update-customer.mjs
- components/stripe/actions/cancel-or-reverse-payout/cancel-or-reverse-payout.mjs
⏰ Context from checks skipped due to timeout of 90000ms (4)
- GitHub Check: Verify TypeScript components
- GitHub Check: pnpm publish
- GitHub Check: Lint Code Base
- GitHub Check: Publish TypeScript components
🔇 Additional comments (15)
components/stripe/actions/list-payouts/list-payouts.mjs (4)
2-2: LGTM! Clean import of utilities module.The addition of the utils module import aligns with the broader refactoring to remove lodash dependencies and provides necessary utility functions for date conversion.
30-95: Excellent enhancement with comprehensive filtering options.The addition of extensive filtering props for creation dates, arrival dates, destination, and pagination significantly improves the action's functionality. The prop definitions are well-structured and use appropriate propDefinitions.
97-138: Well-implemented conditional parameter construction.The
getOtherParamsmethod correctly constructs nested filter objects only when relevant date filters are provided. The use ofutils.fromDateToIntegerfor date conversion is appropriate and consistent with the Stripe API requirements.
140-167: Clean refactoring with explicit parameter handling.The replacement of lodash.pick with explicit destructuring improves code clarity. The parameter mapping from camelCase props to snake_case API parameters is correctly implemented.
components/stripe/actions/update-payment-intent/update-payment-intent.mjs (3)
59-162: Comprehensive prop expansion with excellent organization.The addition of detailed shipping address fields, payment method options, and statement descriptor props significantly enhances the action's capabilities. The prop definitions are well-structured with clear labels and descriptions.
164-217: Excellent conditional object construction logic.The
getOtherParamsmethod correctly constructs nested shipping objects only when relevant fields are provided. The statement descriptor truncation to 21 characters follows Stripe API requirements and handles edge cases properly with the optional chaining and undefined fallback.
219-249: Clean refactoring with proper parameter mapping.The explicit destructuring and parameter construction replaces lodash.pick effectively. The use of
utils.parseJson(metadata)ensures proper JSON parsing, and the camelCase to snake_case mapping is correctly implemented for all API parameters.components/stripe/actions/create-customer/create-customer.mjs (1)
255-349: Excellent implementation of complex nested parameter construction.The
getOtherParamsmethod effectively handles conditional construction of multiple nested objects (address, shipping, tax, cash_balance, invoice_settings) based on the presence of related props. The logic is well-structured and follows Stripe API requirements.components/stripe/actions/confirm-payment-intent/confirm-payment-intent.mjs (4)
13-17: Good addition of informational alert.The alert prop provides helpful context to users about payment confirmation behavior, improving the user experience.
196-201: Excellent fix for payment method options type.The change from
type: "string"totype: "object"correctly addresses the previous review feedback. This ensures the prop type matches Stripe API expectations for the payment_method_options parameter.
227-304: Well-implemented nested parameter construction.The
getOtherParamsmethod correctly handles conditional construction of shipping, mandate data, and radar options. The mandate data construction properly addresses the previous operator precedence concern by using separate boolean checks (hasMandateDataandhasOnlineData) with appropriate conditional spreading.
306-345: Clean implementation with proper JSON parsing.The explicit parameter construction is well-implemented. The use of
utils.parseJson(paymentMethodOptions)correctly handles the object parsing requirement, addressing previous feedback about type handling.components/stripe/stripe.app.mjs (3)
481-540: Good addition of enhanced filtering and pagination props.The new date filtering props (
createdGt,createdGte,createdLt,createdLte,arrivalDateGt, etc.) and pagination props (endingBefore,startingAfter) provide much-needed flexibility for data retrieval operations.
606-611:✅ Verification successful
Verify the constants.API_VERSION is properly defined.
The SDK method correctly uses the new Stripe constructor pattern and references
constants.API_VERSION. Ensure the constants file defines the correct API version.
🏁 Script executed:
#!/bin/bash # Description: Verify the API_VERSION constant is properly defined # Expected: Should show the new API version (likely "2025-03-31.basil" based on the PR summary) # Check the constants file for API_VERSION definition cat components/stripe/common/constants.mjs | grep -A 2 -B 2 API_VERSIONLength of output: 177
constants.API_VERSION is properly defined
The API_VERSION constant is set to"2025-03-31.basil"incomponents/stripe/common/constants.mjsas expected. No further changes needed.
1-2:❓ Verification inconclusive
Verify consistent import changes across the codebase.
The import change from default to named import is correct for the newer Stripe SDK version. However, this is a breaking change that must be applied consistently across all files that use the Stripe SDK.
🏁 Script executed:
#!/bin/bash # Description: Verify all Stripe SDK imports are updated consistently across the codebase # Expected: All imports should use the named import pattern # Search for any remaining default Stripe imports rg -A 2 'import.*stripe.*from.*["\']stripe["\']' --type js --type mjs # Search for any usage of stripe() constructor calls that need updating rg 'new stripe\(' --type js --type mjsLength of output: 116
🏁 Script executed:
#!/bin/bash set -euo pipefail echo "🔍 Verifying Stripe import consistency..." # 1. Check for any legacy lowercase default imports (should be uppercase/named now) rg -n -E "import\s+stripe\s+from\s+['\"]stripe['\"]" --type js --type mjs || echo "No lowercase default imports found." # 2. Check for named-import variants (e.g., import { Stripe } from 'stripe') rg -n -E "import\s+\{\s*Stripe\s*\}\s+from\s+['\"]stripe['\"]" --type js --type mjs || echo "No named-import variants found." # 3. Confirm the approved default import pattern (import Stripe from 'stripe') rg -n -E "import\s+Stripe\s+from\s+['\"]stripe['\"]" --type js --type mjs || echo "No default imports of Stripe found; double-check if named import is intended." echo "🔍 Verifying Stripe constructor usage..." # 4. Look for any lowercase constructor calls rg -n -E "new\s+stripe\s*\(" --type js --type mjs || echo "No lowercase `new stripe(` calls found." # 5. Look for the correct constructor usage rg -n -E "new\s+Stripe\s*\(" --type js --type mjs || echo "No `new Stripe(` calls found; ensure constructors are updated." echo "✅ Verification script complete."Length of output: 3588
🏁 Script executed:
#!/bin/bash set -euo pipefail echo "🔍 Re-verifying Stripe imports with simplified patterns..." # Check for any default lowercase imports rg -n "import stripe from 'stripe'" --type js --type mjs || true rg -n 'import stripe from "stripe"' --type js --type mjs || true # Check for any named-import variants rg -n "import { Stripe } from 'stripe'" --type js --type mjs || true rg -n 'import { Stripe } from "stripe"' --type js --type mjs || true # Check for any default uppercase imports rg -n "import Stripe from 'stripe'" --type js --type mjs || true rg -n 'import Stripe from "stripe"' --type js --type mjs || true echo "🔍 Re-verifying Stripe constructor usage..." # Look for lowercase constructor calls rg -n "new stripe(" --type js --type mjs || echo "No lowercase `new stripe(` calls found." # Look for uppercase constructor calls rg -n "new Stripe(" --type js --type mjs || echo "No uppercase `new Stripe(` calls found." echo "✅ Re-verification complete."Length of output: 1928
Manual verification required: ensure Stripe imports & constructors are fully updated
This upgrade to the Stripe SDK is breaking and must be applied consistently across all
.js/.mjsfiles. Please confirm:
- No remaining legacy imports:
import stripe from 'stripe'or"stripe"import { Stripe } from 'stripe'(if your intended pattern is default import)- Only the approved import style is used:
import Stripe from 'stripe';- All constructor invocations use the updated class:
new Stripe(…)You can run these simple checks at the repo root:
# Look for any old-style imports rg "import stripe from 'stripe'" -g "*.js" -g "*.mjs" || echo "✔ no legacy default imports" rg "import { Stripe } from 'stripe'" -g "*.js" -g "*.mjs" || echo "✔ no named-import variants" # Confirm desired import exists rg "import Stripe from 'stripe'" -g "*.js" -g "*.mjs" || echo "⚠️ missing approved default import" # Verify constructor usage rg "new Stripe\(" -g "*.js" -g "*.mjs" || echo "⚠️ no updated constructor calls found"Once you’ve confirmed there are no leftover imports or constructor calls, this breaking change can be considered safely applied.
|
/approve |
75a18ee to
1e58f7b
Compare
|
/approve |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
♻️ Duplicate comments (1)
components/stripe/actions/create-customer/create-customer.mjs (1)
376-376: Missing JSON parsing for metadata.Similar to the previous review feedback, metadata is passed directly without parsing. For consistency with other actions like update-payment-intent.mjs, consider using utils.parseJson.
- metadata, + metadata: utils.parseJson(metadata),
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (62)
components/stripe/actions/cancel-or-reverse-payout/cancel-or-reverse-payout.mjs(1 hunks)components/stripe/actions/cancel-payment-intent/cancel-payment-intent.mjs(1 hunks)components/stripe/actions/capture-payment-intent/capture-payment-intent.mjs(1 hunks)components/stripe/actions/confirm-payment-intent/confirm-payment-intent.mjs(2 hunks)components/stripe/actions/create-billing-meter/create-billing-meter.mjs(1 hunks)components/stripe/actions/create-customer/create-customer.mjs(1 hunks)components/stripe/actions/create-invoice-item/create-invoice-item.mjs(2 hunks)components/stripe/actions/create-invoice/create-invoice.mjs(1 hunks)components/stripe/actions/create-payment-intent/create-payment-intent.mjs(2 hunks)components/stripe/actions/create-payout/create-payout.mjs(2 hunks)components/stripe/actions/create-price/create-price.mjs(2 hunks)components/stripe/actions/create-product/create-product.mjs(4 hunks)components/stripe/actions/create-refund/create-refund.mjs(3 hunks)components/stripe/actions/create-subscription/create-subscription.mjs(3 hunks)components/stripe/actions/create-usage-record/create-usage-record.mjs(0 hunks)components/stripe/actions/delete-customer/delete-customer.mjs(2 hunks)components/stripe/actions/delete-invoice-item/delete-invoice-item.mjs(3 hunks)components/stripe/actions/delete-or-void-invoice/delete-or-void-invoice.mjs(2 hunks)components/stripe/actions/finalize-invoice/finalize-invoice.mjs(2 hunks)components/stripe/actions/list-balance-history/list-balance-history.mjs(2 hunks)components/stripe/actions/list-customers/list-customers.mjs(2 hunks)components/stripe/actions/list-invoices/list-invoices.mjs(3 hunks)components/stripe/actions/list-payment-intents/list-payment-intents.mjs(2 hunks)components/stripe/actions/list-payouts/list-payouts.mjs(1 hunks)components/stripe/actions/list-refunds/list-refunds.mjs(3 hunks)components/stripe/actions/retrieve-balance/retrieve-balance.mjs(1 hunks)components/stripe/actions/retrieve-checkout-session-line-items/retrieve-checkout-session-line-items.mjs(2 hunks)components/stripe/actions/retrieve-checkout-session/retrieve-checkout-session.mjs(1 hunks)components/stripe/actions/retrieve-customer/retrieve-customer.mjs(2 hunks)components/stripe/actions/retrieve-invoice-item/retrieve-invoice-item.mjs(3 hunks)components/stripe/actions/retrieve-invoice/retrieve-invoice.mjs(2 hunks)components/stripe/actions/retrieve-payment-intent/retrieve-payment-intent.mjs(1 hunks)components/stripe/actions/retrieve-payout/retrieve-payout.mjs(2 hunks)components/stripe/actions/retrieve-price/retrieve-price.mjs(2 hunks)components/stripe/actions/retrieve-product/retrieve-product.mjs(1 hunks)components/stripe/actions/retrieve-refund/retrieve-refund.mjs(2 hunks)components/stripe/actions/search-customers/search-customers.mjs(5 hunks)components/stripe/actions/send-invoice/send-invoice.mjs(2 hunks)components/stripe/actions/update-customer/update-customer.mjs(4 hunks)components/stripe/actions/update-invoice-item/update-invoice-item.mjs(3 hunks)components/stripe/actions/update-invoice/update-invoice.mjs(3 hunks)components/stripe/actions/update-payment-intent/update-payment-intent.mjs(3 hunks)components/stripe/actions/update-payout/update-payout.mjs(1 hunks)components/stripe/actions/update-refund/update-refund.mjs(1 hunks)components/stripe/actions/void-invoice/void-invoice.mjs(2 hunks)components/stripe/actions/write-off-invoice/write-off-invoice.mjs(2 hunks)components/stripe/common/constants.mjs(2 hunks)components/stripe/common/utils.mjs(1 hunks)components/stripe/package.json(2 hunks)components/stripe/sources/abandoned-cart/abandoned-cart.mjs(1 hunks)components/stripe/sources/canceled-subscription/canceled-subscription.mjs(1 hunks)components/stripe/sources/common/webhook-base.mjs(4 hunks)components/stripe/sources/custom-webhook-events/custom-webhook-events.mjs(1 hunks)components/stripe/sources/new-customer/new-customer.mjs(1 hunks)components/stripe/sources/new-dispute/new-dispute.mjs(1 hunks)components/stripe/sources/new-failed-invoice-payment/new-failed-invoice-payment.mjs(1 hunks)components/stripe/sources/new-failed-payment/new-failed-payment.mjs(1 hunks)components/stripe/sources/new-invoice/new-invoice.mjs(1 hunks)components/stripe/sources/new-payment/new-payment.mjs(1 hunks)components/stripe/sources/new-subscription/new-subscription.mjs(1 hunks)components/stripe/sources/subscription-updated/subscription-updated.mjs(1 hunks)components/stripe/stripe.app.mjs(9 hunks)
💤 Files with no reviewable changes (1)
- components/stripe/actions/create-usage-record/create-usage-record.mjs
✅ Files skipped from review due to trivial changes (1)
- components/stripe/actions/create-price/create-price.mjs
🚧 Files skipped from review as they are similar to previous changes (55)
- components/stripe/sources/custom-webhook-events/custom-webhook-events.mjs
- components/stripe/package.json
- components/stripe/sources/new-subscription/new-subscription.mjs
- components/stripe/common/constants.mjs
- components/stripe/sources/new-failed-invoice-payment/new-failed-invoice-payment.mjs
- components/stripe/sources/new-failed-payment/new-failed-payment.mjs
- components/stripe/sources/new-customer/new-customer.mjs
- components/stripe/sources/new-payment/new-payment.mjs
- components/stripe/sources/new-invoice/new-invoice.mjs
- components/stripe/sources/new-dispute/new-dispute.mjs
- components/stripe/actions/retrieve-invoice/retrieve-invoice.mjs
- components/stripe/sources/subscription-updated/subscription-updated.mjs
- components/stripe/sources/common/webhook-base.mjs
- components/stripe/actions/write-off-invoice/write-off-invoice.mjs
- components/stripe/sources/canceled-subscription/canceled-subscription.mjs
- components/stripe/actions/send-invoice/send-invoice.mjs
- components/stripe/actions/void-invoice/void-invoice.mjs
- components/stripe/sources/abandoned-cart/abandoned-cart.mjs
- components/stripe/actions/delete-or-void-invoice/delete-or-void-invoice.mjs
- components/stripe/actions/create-billing-meter/create-billing-meter.mjs
- components/stripe/actions/delete-customer/delete-customer.mjs
- components/stripe/actions/update-payout/update-payout.mjs
- components/stripe/actions/list-payment-intents/list-payment-intents.mjs
- components/stripe/actions/retrieve-checkout-session/retrieve-checkout-session.mjs
- components/stripe/actions/retrieve-product/retrieve-product.mjs
- components/stripe/actions/retrieve-customer/retrieve-customer.mjs
- components/stripe/actions/retrieve-payout/retrieve-payout.mjs
- components/stripe/actions/retrieve-payment-intent/retrieve-payment-intent.mjs
- components/stripe/actions/retrieve-price/retrieve-price.mjs
- components/stripe/actions/retrieve-checkout-session-line-items/retrieve-checkout-session-line-items.mjs
- components/stripe/actions/list-customers/list-customers.mjs
- components/stripe/actions/retrieve-balance/retrieve-balance.mjs
- components/stripe/actions/update-refund/update-refund.mjs
- components/stripe/actions/delete-invoice-item/delete-invoice-item.mjs
- components/stripe/actions/finalize-invoice/finalize-invoice.mjs
- components/stripe/actions/update-invoice-item/update-invoice-item.mjs
- components/stripe/actions/retrieve-refund/retrieve-refund.mjs
- components/stripe/actions/create-payment-intent/create-payment-intent.mjs
- components/stripe/actions/retrieve-invoice-item/retrieve-invoice-item.mjs
- components/stripe/actions/create-invoice-item/create-invoice-item.mjs
- components/stripe/actions/create-product/create-product.mjs
- components/stripe/actions/list-refunds/list-refunds.mjs
- components/stripe/actions/list-balance-history/list-balance-history.mjs
- components/stripe/actions/search-customers/search-customers.mjs
- components/stripe/actions/update-invoice/update-invoice.mjs
- components/stripe/actions/create-payout/create-payout.mjs
- components/stripe/actions/cancel-payment-intent/cancel-payment-intent.mjs
- components/stripe/common/utils.mjs
- components/stripe/actions/create-refund/create-refund.mjs
- components/stripe/actions/create-subscription/create-subscription.mjs
- components/stripe/actions/list-invoices/list-invoices.mjs
- components/stripe/actions/create-invoice/create-invoice.mjs
- components/stripe/actions/list-payouts/list-payouts.mjs
- components/stripe/actions/cancel-or-reverse-payout/cancel-or-reverse-payout.mjs
- components/stripe/actions/update-customer/update-customer.mjs
⏰ Context from checks skipped due to timeout of 90000ms (4)
- GitHub Check: pnpm publish
- GitHub Check: Publish TypeScript components
- GitHub Check: Lint Code Base
- GitHub Check: Verify TypeScript components
🔇 Additional comments (13)
components/stripe/actions/capture-payment-intent/capture-payment-intent.mjs (1)
7-96: Excellent refactoring from generic to explicit props!The transformation from a generic
advancedprop to explicit, well-defined individual properties significantly improves clarity and maintainability. Key improvements include:
- Clear prop definitions with proper types and descriptions
- Informational alert guiding users on PaymentIntent capture behavior
- Proper camelCase to snake_case parameter mapping
- Conditional parameter inclusion (e.g.,
transfer_dataonly whentransferDataAmountis provided)This approach makes the action more discoverable and reduces the likelihood of API errors from incorrect parameter formatting.
components/stripe/actions/update-payment-intent/update-payment-intent.mjs (2)
164-217: Well-implemented conditional parameter construction!The
getOtherParamsmethod elegantly handles conditional inclusion of nested objects:
- Shipping object only included when any shipping field is present
- Statement descriptor truncation to 21 characters (Stripe's limit)
- Clean conditional spread syntax for optional parameters
This approach prevents sending empty nested objects to the Stripe API.
237-237: Proper JSON parsing for metadata!Good use of
utils.parseJson(metadata)for consistent JSON handling across the codebase.components/stripe/actions/create-customer/create-customer.mjs (2)
255-350: Excellent conditional parameter construction!The
getOtherParamsmethod effectively handles complex nested objects:
- Proper conditional checks for address, shipping, tax, cash balance, and invoice settings
- Clean separation of concerns for different parameter groups
- Appropriate snake_case parameter naming for Stripe API
385-385: Good use of parseArray utility!Proper handling of
taxIdDataarray parsing ensures robust input validation.components/stripe/actions/confirm-payment-intent/confirm-payment-intent.mjs (3)
12-17: Helpful informational alert!The alert prop provides valuable context about payment confirmation behavior, improving user experience.
227-304: Robust conditional parameter construction!The
getOtherParamsmethod properly handles complex nested objects with safe conditional logic:
- Shipping object construction with proper field checking
- Mandate data with nested customer acceptance handling
- Radar options conditional inclusion
The conditional spread syntax is correctly implemented and avoids potential runtime errors.
336-336: Proper JSON parsing for paymentMethodOptions!Good implementation using
utils.parseJson(paymentMethodOptions)which addresses the previous review concern about type handling. This ensures the Stripe API receives a proper object instead of a string.components/stripe/stripe.app.mjs (5)
1-2: LGTM - Correct SDK import pattern for v18The change from default import to named import
Stripealigns with the newer Stripe SDK v18 patterns. The addition of the constants module import is also appropriate for centralizing API version configuration.
481-540: LGTM - Comprehensive filtering and pagination propsThe new filtering and pagination properties (created/arrival date filters, cursor pagination) follow Stripe API patterns correctly and will enhance the functionality of list operations.
606-611: LGTM - Correct SDK initialization with API versionThe SDK initialization has been properly updated to use the named import
Stripeconstructor and the centralized API version constant. This aligns with the v18 SDK patterns and maintains consistency.
341-341: LGTM - Improved property descriptionsThe updated descriptions provide better clarity and include relevant documentation links. The changes improve the user experience by providing more detailed and accurate information.
Also applies to: 347-347, 353-353, 359-359, 365-365, 371-371, 377-377, 393-393, 399-399, 406-406, 416-416
71-71:✅ Verification successful
Verify breaking changes from snake_case to camelCase property names
Multiple property names have been changed from snake_case to camelCase (e.g.,
payment_method→paymentMethod,invoice_item→invoiceItem, etc.). While this improves consistency, these are breaking changes that would affect all existing actions and sources using these properties.Please run the following script to verify that all dependent files have been updated to use the new camelCase property names:
Also applies to: 158-158, 207-207, 213-213, 292-292, 299-299, 317-317, 380-380
🏁 Script executed:
#!/bin/bash # Description: Verify that all references to old snake_case property names have been updated echo "Checking for remaining snake_case property references..." # Check for old property names that should have been updated rg -n "payment_method[^_]" --type js rg -n "invoice_item[^_]" --type js rg -n "checkout_session[^_]" --type js rg -n "payment_intent[^_]" --type js rg -n "setup_future_usage[^_]" --type js echo "Checking for new camelCase usage in action files..." rg -n "paymentMethod\|invoiceItem\|checkoutSession\|paymentIntent\|setupFutureUsage" components/stripe/actions/ -A 2Length of output: 553
🏁 Script executed:
#!/bin/bash # Refined check: include .mjs, .js, .ts, .tsx files and drop the [^_] suffix echo "🔍 Checking for remaining snake_case property references across .{js,mjs,ts,tsx}..." rg -n "payment_method" --glob "*.{js,mjs,ts,tsx}" rg -n "invoice_item" --glob "*.{js,mjs,ts,tsx}" rg -n "checkout_session" --glob "*.{js,mjs,ts,tsx}" rg -n "payment_intent" --glob "*.{js,mjs,ts,tsx}" rg -n "setup_future_usage" --glob "*.{js,mjs,ts,tsx}" echo echo "✅ Checking for new camelCase property usage across .{js,mjs,ts,tsx}..." rg -n "paymentMethod" --glob "*.{js,mjs,ts,tsx}" rg -n "invoiceItem" --glob "*.{js,mjs,ts,tsx}" rg -n "checkoutSession" --glob "*.{js,mjs,ts,tsx}" rg -n "paymentIntent" --glob "*.{js,mjs,ts,tsx}" rg -n "setupFutureUsage" --glob "*.{js,mjs,ts,tsx}"Length of output: 32247
No action needed—Stripe input props are already camelCase and SDK request keys remain snake_case
The remaining
payment_method,invoice_item, etc. strings are parameter keys for the Stripe SDK (which expects snake_case) and not references to input props. All input properties in components/stripe have been updated to camelCase.
| }, | ||
| addressLine2: { | ||
| type: "string", | ||
| label: "Shipping - Address - Line 2", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix inconsistent property descriptions
The descriptions for these address properties incorrectly reference "Shipping" when they should reference "Address":
addressLine2: {
type: "string",
- label: "Shipping - Address - Line 2",
+ label: "Address - Line 2",
description: "Address line 2 (e.g., apartment, suite, unit, or building).",
optional: true,
}, addressState: {
type: "string",
- label: "Shipping - Address - State",
+ label: "Address - State",
description: "State, county, province, or region.",
optional: true,
},Also applies to: 573-573
🤖 Prompt for AI Agents
In components/stripe/stripe.app.mjs at lines 561 and 573, the property
descriptions incorrectly use "Shipping" instead of "Address". Update the
descriptions to replace "Shipping" with "Address" to ensure consistency and
accuracy in the property labels.
| arrivalDateGt: { | ||
| type: "string", | ||
| label: "Arrival Date (Greater Than)", | ||
| description: "Only return transactions that were created after this date (exclusive). In ISO 8601 format. Eg. `2023-01-01T00:00:00Z`", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix incorrect descriptions for arrival date filters
The descriptions for arrival date filters incorrectly reference "created" instead of "arrival date":
arrivalDateGt: {
type: "string",
label: "Arrival Date (Greater Than)",
- description: "Only return transactions that were created after this date (exclusive). In ISO 8601 format. Eg. `2023-01-01T00:00:00Z`",
+ description: "Only return transactions with arrival date after this date (exclusive). In ISO 8601 format. Eg. `2023-01-01T00:00:00Z`",
optional: true,
},Apply similar fixes to arrivalDateGte, arrivalDateLt, and arrivalDateLte descriptions.
Also applies to: 514-514, 520-520, 526-526
🤖 Prompt for AI Agents
In components/stripe/stripe.app.mjs at lines 508, 514, 520, and 526, the
descriptions for the arrival date filters incorrectly mention "created" instead
of "arrival date." Update the description strings for arrivalDateGte,
arrivalDateLt, and arrivalDateLte to correctly reference "arrival date" rather
than "created" to accurately describe the filter criteria.
WHY
Resolves #16415 and #16554
Summary by CodeRabbit
Summary by CodeRabbit