#loaderchips_code
1 messages ยท Page 1 of 1 (latest)
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- loaderchips_code, 4 days ago, 13 messages
- loaderchips_docs, 5 days ago, 23 messages
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
๐ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1268070131549077504
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hey @royal pecan
this is the relevant documentation https://docs.stripe.com/payments/accept-a-payment?platform=web&ui=embedded-form
I see. Normally Standard Account works with Direct Charge, where Express works with Destination Charge (They are different fund flow)
thank you for sharing. can we give you a slightly detailed example to explain the context?
it will help us understand if we are getting the right questions and answers
https://grateful-rescue.webflow.io/ this is a nonprofit website. if you click on donate you will see a modal open which allows end donors to donate
that modal has the stripe embedded checkout in it.
this is the client side part of it. On the server , we are on stripe connect express so everything is essentially in a single account
now after moving to connect standard, there will be a separate account for this nonprofit as well as the associated customers , products , prices etc.
Yeah, and you will still have a Platfrom account, and a Connected Standard Account
this is how we currently initiate a session
module StripeService
class InitSubscriptionSession < BaseService
include Rails.application.routes.url_helpers
attr_accessor :session
def initialize(donor, donation_tier, options = {})
@donor = donor
@donation_tier = donation_tier
@embedded = options[:embedded]
@cover_fee = options[:cover_fee]
end
def call
unless @donation_tier.stripe_trackable_id.present?
raise InvalidCheckoutParamsError.new('Tier Not Available')
end
line_items = [{
price: @donation_tier.stripe_trackable_id,
quantity: 1
}]
if @cover_fee
line_items.push({
price: CreateFeePrice.call(@donation_tier),
quantity: 1
})
end
session_params = {
mode: 'subscription',
line_items: line_items,
customer: @donor.stripe_id,
metadata: { donor_id: @donor.id, donation_tier_id: @donation_tier.id, cover_fee: !!@cover_fee },
expires_at: Constants::Stripe::CHECKOUT_SESSION_EXPIRES_IN.after.to_i,
success_url: "#{checkout_success_url}?session_id={CHECKOUT_SESSION_ID}",
cancel_url: checkout_cancel_url
}
if @donation_tier.nonprofit.connected?
session_params.merge!(
subscription_data: {
transfer_data: {
destination: @donation_tier.nonprofit.connected_account.account_id
}
}
)
end
if @embedded
Stripe.api_version = "2022-11-15; embedded_checkout_beta=v1"
session_params.merge!(ui_mode: 'embedded')
session_params.delete :success_url
session_params.delete :cancel_url
end
session = Stripe::Checkout::Session.create(session_params, { api_key: ApiKeySelector.select_api_key })
session
end
end
end
sorry for the long text
so our core question is
- is it theoretically even possible for embedded checkout to still work when we as a company move to stripe connect standard
- if yes, will we need additional tooling for the standard connect-ed accounts to make this happen?
Np and thank you for providing such details
Yes there are some minor change. If you look at this link, you would notice there is an additional parameter around
{stripe_account: '{{CONNECTED_ACCOUNT_ID}}'},
Literrally your ApiKeySelector.select_api_key should still be your Platform secret key, but then you have this stripe_account additional parameter point to the Standard Connected Account
ahh yes. i see it
got it. this points to the nonprofits stripe connected account
which will be created
when they onboard
Also, the price, the customer
all needs to be on the Standard Account. You create them normally but with the same stripe_account parameter
https://docs.stripe.com/connect/authentication for quick demonstration
understood. One wrinkly question here
our forms have a cover platform fees option, which essentially creates a line item which is charged by us as platform
now if i understand correctly, since the checkout form itself has the {stripe_account: '{{CONNECTED_ACCOUNT_ID}}'}, param and not the individual line items
this is something that cannot be achieved? basically generating charges for the platform account and the stripe account via the same embedded checkout session
You can still keep that line item, so it's part of the "order" your Connected Account is charging the customer. But then you pull that amount back in payment_intent_data.application_fee_amount
Sorry I throw many URLs but they can explain better than me ๐
no no we appreciate it and dont mind doing the diligence
this is pretty neat. so it essentially first goes to the connected account then comes to us. we will need to specify it in the transaction itself
Yes. That's the idea of Direct Charge. Directly to the Connected Account first
this is the right area of the documentation i believe
Yes yes
Also here from this Doc
this i cannot find on the page
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Which you cannot find? The URL works for me