#viking66

1 messages · Page 1 of 1 (latest)

primal parcelBOT
fierce flint
#

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

vernal steppe
#

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?

fierce flint
#

No, it does not.

vernal steppe
#

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?

fierce flint
vernal steppe
#

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?

fierce flint
#

You would need to collect the Payment Methods first. What does your request to create a Subscription look like?

vernal steppe
#

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?

fierce flint
#

What does your code to create that Chechkous session look like?

vernal steppe
#
        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)
fierce flint
vernal steppe
#

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?

fierce flint
#

I see, no. Sorry, I took us in the wrong direction.