#viking66
1 messages · Page 1 of 1 (latest)
Hi. It depends on how you're making the request, but if you're using the Stripe account header, https://stripe.com/docs/connect/authentication, then yes. These objects would need to be on the Connected Account.
I think you might want to clone customer across accounts: https://stripe.com/docs/connect/cloning-customers-across-accounts.
1/Create the customer on the Platform Account
2/ Create the Payment Method on the Platform Account
3/ Attach the Payment Method to the Customer on the Platform Account
4/ Create a Payment Method using the Stripe Account Header and by passing the above object ids. It creates a Payment Method on the Connected Account
5/ Create a Customer on the Connected Account also by using the Stripe Account Header
6/ Attach the Payment Method from step 4 to this customer id from step 5 by using the Stripe Account Header
let's say i've cloned the account across several connect accounts and the customer updates their payment method on one of those accounts, do all clones also get updated automatically?
No, it does not.
so if a user has active recurring subscriptions associated with payment methods cloned from the parent account and the user changes their payment method at the parent account level, how do i update all the clones?
You'd update the Payment Methods: https://stripe.com/docs/api/payment_methods/update
let's take a step back real quick. when a customer wants to opt into a subscription on my platform I generate checkout url via https://stripe.com/docs/api/checkout/sessions/create?lang=curl. at that point the customer may not already have their payment method set up so how would the cloning work in that scenario?
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
You would need to collect the Payment Methods first. What does your request to create a Subscription look like?
i create the checkout session and then when the customer completes that, stripe creates the subscription which we are notified of in the resulting webhook
does that answer your question?
What does your code to create that Chechkous session look like?
stripe.Key = self.key
params := &stripe.CheckoutSessionParams{
Customer: stripe.String(args.CustomerID),
LineItems: []*stripe.CheckoutSessionLineItemParams{
{
Price: stripe.String(args.PriceID),
Quantity: stripe.Int64(1),
},
},
Mode: stripe.String("subscription"),
SuccessURL: stripe.String(args.SuccessURL),
CancelURL: stripe.String(args.CancelURL),
SubscriptionData: &stripe.CheckoutSessionSubscriptionDataParams{
ApplicationFeePercent: stripe.Float64(args.SubscriptionFee),
},
}
params.SetStripeAccount(args.AccountID)
params.AddMetadata("paymentSubscriptionID", strconv.Itoa(args.PaymentSubscriptionID))
params.AddMetadata("paymentUserID", strconv.Itoa(args.PaymentUserID))
params.AddMetadata("channelUserID", strconv.Itoa(args.ChannelUserID))
if args.TrialPeriod > 0 {
params.SubscriptionData.TrialPeriodDays = stripe.Int64(int64(args.TrialPeriod))
}
result, err := session.New(params)
Ok, so you're making this call using the Connect Account header, https://stripe.com/docs/connect/authentication and the objects would need to be on the Connected Account.
yes, and that's why i'm trying to understand the payment cloning. is there any way to use the clone with the checkout session api?
I see, no. Sorry, I took us in the wrong direction.