xgeek116
Sending headers when using the lib "stripity_stripe"
I’m trying to create a PaymentIntent using the package stripity_stripe , I need to specify the “connected user account id” which will be the receipient of the payment. To do that I need to send a Header named “Stripe-Account” and the id as value.
I’m using Standard accounts with direct payments, so I can’t use the parameter named “on_behalf_of” (it’s dedicated for indirect payments) in the lib docs :
Here is an example in the Stripe API how to send the Header :
Create direct charges | Stripe Documentation
Thanks
Marked As Solved
daskycodes
The PaymentIntent.create/2 function takes extra stripe options as second parameter. You can provide a keyword list with headers as key and a map as value.
The opts are passed to the new_request/2 function: stripity-stripe/lib/stripe/request.ex at dd89df648456f97e667938bed0e18550427c6a04 · beam-community/stripity-stripe · GitHub
opts = [headers: %{"Stripe-Account" => connected_stripe_account_id}]
PaymentIntent.create(params, opts)
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance










