#masudrhossain

1 messages · Page 1 of 1 (latest)

analog shardBOT
floral crest
#

Hello! Is your intention to accept Plaid payment directly on those connected accounts (using the Stipre-Account header)?

full patrol
#

I'm not sure what you mean by stripe-account header 😕

#

but yes, i want to accept plaid payments on their behalf (the merchants are on our stripe platform as a connect account).

floral crest
#

Let me back up - when you create payments do you create them directly on their account as direct charges? (you'd need the stripe-account header to do this)

#

Or do you create the payments on the platform account and transfer some portion of the funds to the connected account?

full patrol
#

directly

#

example:

Stripe::PaymentIntent.create({
          amount: amount_due.round, # Amount in cents
          currency: @service_price.stripe_data["currency"], # Currency code
          customer: customer.id, # Replace with the actual Customer ID
          metadata: { product_id: @service_price.stripe_data["id"] }
        })
#

and for subscriptions
Stripe.api_key = @service.organization.stripe_account.access_token (access_token was given to use when they complete their oauth)

# Create a subscription
        subscription = Stripe::Subscription.create({
          customer: customer.id, # Replace with the actual customer ID
          items: [
            { price: params[:price_id] }
          ], 
          coupon: params[:coupon_code].present? ? params[:coupon_code] : nil, 
          metadata: {
            service_id: @service_price.token
          }, 
          expand: ['latest_invoice.payment_intent'],
          description: "#{@service_price.service.title} -#{@service_price.token}"
        })
floral crest
#

Ah, you're using access tokens (that explains why the stripe-account header wasn't familiar to you)

#

Let me double check and see if this is supported (I'm pretty sure the answer is yes, but I'm not 100% sure)

#

Hmmm... I'm not finding anything super definitive here - what I'd recommend is using Plaid on the platform account and cloning the created source to your connected accounts

#

That way your connected accounts won't have to onboard onto plaid separately