[16.x] Stripe Basil API Support #1762
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR targets the
16.x
branch in line with Laravel’s support policy. It finalizes Cashier’s compatibility with Stripe’s Basil API (API version2025-03-31.basil
), as highlighted in the Cashier source code:Summary of Changes
Invoice Line Items: Added helpers to extract pricing data using Stripe’s new
price_details
andinline_price_data
structures introduced in Basil:Unit Amount Handling: Retrieve unit amounts and support inline price data:
Tax Behavior Retrieval: Access the
tax_behavior
on invoice line items:Benefits to Users
Keeps Cashier aligned with Stripe’s latest Basil API, as requested by Taylor April tweet inviting contributions.
Testing
Added PHPUnit tests covering the new invoice line item helpers:
priceId
and price retrievalunitAmount
handling for bothprice_details
andinline_price_data
taxBehavior
methodAll test suites pass locally. Please refer to the CI checks for confirmation.
Motivation
Taylor mentioned that the team “would love some assistance making Cashier compatible with Stripe's latest API version (Basil)” — this PR answers that call. It updates core invoice item logic and tests to ensure developers can rely on Cashier when using the latest Stripe features.
This is my first significant open source contribution attempt so apologies if it isn't quite up to scratch, I welcome any criticism or commits to improve it!