-
Notifications
You must be signed in to change notification settings - Fork 0
[feature] Add CEDP/Product 3 data support for Stripe PaymentIntents #243
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
base: master
Are you sure you want to change the base?
Conversation
himn1
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.
1 comment
himn1
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.
1 comment
| post[:amount_details] = options[:amount_details] | ||
| post[:payment_method_types] = ["card"] | ||
| @options.merge!(:version => '2025-04-30.preview') | ||
| options[:version] = options.dig(:stripe_level3_version) |
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.
can we just send it correctly from AB -> Conduit so we don't have to adjust it here?
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.
what's the point of modyfinging options here, in general?
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.
@himn1 , I'll refactor this to grab the version from the information sent from AB.
I was doing this replacement because the version is taken from the options hash from within the #api_version method and I didn;t want to touch it.
And about the new version (2025-04-30.preview), this is needed because this CEDP feature is only working on that version within Stripe's api, so until they release it to the production one, we need to point the purchase method to that preview api version
|
|
||
| def api_version(options) | ||
| options[:version] || @options[:version] || "2015-04-07" | ||
| options[:stripe_level3_version] ||options[:version] || @options[:version] || "2015-04-07" |
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.
format issue
||options.
reminder:
discuss with Curstor + GPT 5.2 before asking a human for review
Is this implementation optimal?
Is this in the most optimal place?
Check what we do in similar places
himn1
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.
I created sub PR where I did final refactoring
#246
familiarize and merge with your
then
adjust Conduit, AB to :stripe_api_version change
|
|
||
| def api_version(options) | ||
| options[:version] || @options[:version] || "2015-04-07" | ||
| options[:stripe_level3_version] || options[:version] || @options[:version] || "2015-04-07" |
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.
AI and me:
rename :stripe_level3_version to :stripe_api_version
Co-authored-by: himn1 <[email protected]>
Ticket
https://maxioevolution.atlassian.net/browse/PAY-2783
Related
https://github.com/maxio-com/chargify/pull/27000
What
We adding support for sending CEDP / Level 3 data to Stripe on each payment intent
How
Adjusting the creation of this piece of payload to comply with the new format, which is still on preview.
Notes
About the
2025-04-30.previewheaderWe’re now sending “payment line items” (Stripe’s new CEDP / Level 3-style data) when we create the PaymentIntent. This data goes in the
payment_details[...]object (for example order_reference) andamount_details[line_items][...](per-item info like product name, unit cost, quantity, tax). This feature is behind a public preview in Stripe, and Stripe requires that we send the preview API version header2025-04-30.previewon the request so those params are accepted and persisted. See Stripe’sPayment line itemspreview docs, which say: “You can use this public preview feature by including the version header2025-04-30.preview… You can now add the line items … by passing thepayment_detailsandamount_detailsparams when creating a PaymentIntent.”https://docs.stripe.com/payments/payment-line-items
https://docs.stripe.com/changelog/basil/2025-04-30/payment-line-items
About the new key
payment_method_types: ['card']When we switched to that preview version, Stripe changed default behavior for payment methods. If you don’t tell Stripe which payment method types you want, Stripe will auto-enable every method you’ve turned on in the Dashboard. Some of those methods are redirect-based, so Stripe then requires a
return_urlon the PaymentIntent. To avoid that (we only charge cards, server-side, no redirects), we now explicitly send:post[:payment_method_types] = ["card"]Stripe’s docs describe that you can either
(a) pass
payment_method_types: ['card']when creating the PaymentIntent, or(b) force
automatic_payment_methods[allow_redirects]=never, to prevent redirect methods and skip thereturn_urlrequirement.https://docs.stripe.com/upgrades/manage-payment-methods
https://docs.stripe.com/changelog/2023-08-16/automatic-payment-methods
Note
Medium Risk
Changes the Stripe PaymentIntent/charge request payload to sometimes send new
payment_details/amount_detailsfields and forcespayment_method_typesfor card intents, which can affect payment behavior if options are set incorrectly. Also alters API version header selection via a newstripe_api_versionoption, impacting request compatibility.Overview
Adds support for Stripe’s CEDP/payment line items by conditionally sending
payment_detailsandamount_details(and explicitly settingpayment_method_types: ["card"]) when creating PaymentIntents/charges for card-not-present transactions; otherwise it falls back to existing Level 3level3data.Updates Stripe API version handling to prefer
options[:stripe_api_version]over the legacy:versionoption so preview API versions can be requested per-call.Written by Cursor Bugbot for commit 57c4797. This will update automatically on new commits. Configure here.