Skip to content
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

Allow stripe_elements_tag to accept a block #228

Merged
merged 1 commit into from
Mar 22, 2024

Conversation

chip
Copy link
Contributor

@chip chip commented Mar 3, 2024

Hello and thanks for creating this gem!

I needed to pass some form fields to stripe_elements_tag, so I've implemented it here. The Gemfile and test/spec_helper.rb changes were to simply get the tests to pass.

I'm happy to make changes if there's a better way. I hope you find this useful.

Copy link
Owner

@tansengming tansengming left a comment

Choose a reason for hiding this comment

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

thanks for PR @chip this looks great! It just needs a few little fixes to get the tests passing.

Gemfile Outdated Show resolved Hide resolved
lib/stripe/rails/version.rb Outdated Show resolved Hide resolved
@tansengming
Copy link
Owner

Can you do me a favor? Do you have a link to the Stripe docs for custom elements? I couldn't find anything about it on the web.

@chip chip force-pushed the master branch 2 times, most recently from 3c826f7 to ffed520 Compare March 22, 2024 03:57
@chip
Copy link
Contributor Author

chip commented Mar 22, 2024

Can you do me a favor? Do you have a link to the Stripe docs for custom elements? I couldn't find anything about it on the web.

@tansengming - It's been a while since I made these changes, so I'm drawing a blank and the Stripe docs are a tad bit insane. I would be happy to continue looking, though, if you have any suggestions. Cheers.

@tansengming
Copy link
Owner

looks good thanks @chip !

@tansengming tansengming merged commit 70ef420 into tansengming:master Mar 22, 2024
5 checks passed
@tansengming
Copy link
Owner

Can you do me a favor? Do you have a link to the Stripe docs for custom elements? I couldn't find anything about it on the web.

@tansengming - It's been a while since I made these changes, so I'm drawing a blank and the Stripe docs are a tad bit insane. I would be happy to continue looking, though, if you have any suggestions. Cheers.

Feel free to post it here once you find the url. It'll be good to have a reference in case we need it.

@chip
Copy link
Contributor Author

chip commented Mar 22, 2024

Can you do me a favor? Do you have a link to the Stripe docs for custom elements? I couldn't find anything about it on the web.

@tansengming - It's been a while since I made these changes, so I'm drawing a blank and the Stripe docs are a tad bit insane. I would be happy to continue looking, though, if you have any suggestions. Cheers.

Feel free to post it here once you find the url. It'll be good to have a reference in case we need it.

Sure, I followed this example (using Sinatra) to get me started.

The billing_path should point to a Rails controller method that captures the params[:user][:email] field in my example and sets it on the metadata of the Stripe PaymentIntent.

HTH 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants