#loaderchips_code

1 messages ยท Page 1 of 1 (latest)

eager boneBOT
errant jewelBOT
#

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.

eager boneBOT
#

๐Ÿ‘‹ 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.

onyx flower
#

Hey @royal pecan

royal pecan
#

I see. Normally Standard Account works with Direct Charge, where Express works with Destination Charge (They are different fund flow)

onyx flower
#

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

#

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.

royal pecan
#

Yeah, and you will still have a Platfrom account, and a Connected Standard Account

onyx flower
#

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

  1. is it theoretically even possible for embedded checkout to still work when we as a company move to stripe connect standard
  2. if yes, will we need additional tooling for the standard connect-ed accounts to make this happen?
royal pecan
#

Np and thank you for providing such details

royal pecan
#

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

onyx flower
#

ahh yes. i see it

#

got it. this points to the nonprofits stripe connected account

#

which will be created

#

when they onboard

royal pecan
#

Also, the price, the customer

#

all needs to be on the Standard Account. You create them normally but with the same stripe_account parameter

onyx flower
#

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

royal pecan
#

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 ๐Ÿ™‚

onyx flower
#

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

royal pecan
#

Yes. That's the idea of Direct Charge. Directly to the Connected Account first

onyx flower
#

this is the right area of the documentation i believe

royal pecan
#

Yes yes

onyx flower
#

this i cannot find on the page

royal pecan
#

Which you cannot find? The URL works for me

onyx flower
#

๐Ÿ™‚ the url works . i mean to say the payment_intent_data: {application_fee_amount: 123}. no matter, i got the right url right? i will find it

#

ok to summarize. frontend does not need to change

#

we need to make changes in our checkout session generation calls and we will be set