#lmdad-q

1 messages · Page 1 of 1 (latest)

pine saffron
#

@hollow narwhal feel free to ask your question!

hollow narwhal
#

Hey

#

It's a follow up from an answer given by koopjah

#

I'll paste the screenshots of the convo here

#

So you get the context

#

Ahh, it's disappeared!

#

😞

#

Okay, nvm

#

I'll explain

#

So we want to implement discount functionality on a service we offer. We don't use products/subscriptions.

Reading Stripe docs, it recommends we implement it ourselves by discounting the amount from the PaymentIntent.

koopjah mentioned the following flow:

  1. Assuming a payment intent from a Customer -> Connect account of £10, with a discount of 50%. Add the code to charge the reduced £5 with a PaymentIntent
  2. Initiate a transfer to the Connect account of the remaining £5 so they still receive their full amount
#

If that makes sense, I can go ahead and follow up with the question I had around this flow?

pine saffron
#

sure

hollow narwhal
#

Okay, so the thing I wasn't sure about is if this process would initiate two payments to the Connect account?

#

In other words, what I'm trying to avoid is the slightly weird behaviour on our Connect account end where they receive (in the above scenario) two separate payments of £5 to their bank accounts in the payout

pine saffron
#

it would depend how you build it exactly

#

it wouldn't create two if you don't pass transfer_data on the PaymentIntent you create for the payment

hollow narwhal
#

Oh, so just had a look at the doc. Assuming we use the same string for the transfer_group , it would group them into one payment?

pine saffron
#

no it's all separate transfers(or 'payments' as seen from the connected account).

hollow narwhal
#

Okay, at the moment we aren't passing transfer_data.

#

So with that in mind, would the following ensure a single payment of £10 assuming the example above

#
  1. Create PaymentIntent for £5
  2. Create separate transfer of £5
pine saffron
#

hmm, not sure how it would. A payment from whom to whom?

#

in that example you charge the customer £5 so your platform gets that and then you transfer £5 to the connected account, so they get that. (and your platform loses money since you paid the Stripe fees)

hollow narwhal
#

When we create a payment intent, we set the destination as the connect account

pine saffron
#

then you .. are using transfer_data? I was assuming your example did not , since that's what you said.

hollow narwhal
#

We want to charge the Customer £5 (discounted from £10)
We still want the Connect account to get the £10 (total amount before discount)

I understand we need to create a payment intent followed by a transfer. My question is how can we implement this such that the Connect account gets £10?

pine saffron
#

1/ Create a PaymentIntent for £5 without transfer_data
2/ Create a Transfer for £10

now, it will be hard since 2/ will probably fail, since after all, you don't actually have £10 if we look at this in isolation

#

so this assumes that for example your platform account is on manual payouts and has accumulated some available balance sufficient to make that transfer

hollow narwhal
#

Is there a way around this without manual payouts?

pine saffron
hollow narwhal
#

Ah okay, so accumulating a balance is the way to do it?

pine saffron
hollow narwhal
#

Yh I get that

#

It's more just understand what options we have to fix that

#

In a scalable way

pine saffron
#

usually it's source_transaction

hollow narwhal
#

Ah okay, so if I've understood correctly

#

Step 2 where we initiate the transfer (after 1 of creating a payment intent)

#

In that step, we can link the source_transaction to the PaymnetIntent from step 1?

pine saffron
#

you can but it would still fail

#

since you're making a transfer of 10 but linking to a payment of 5

hollow narwhal
#

makes sense

pine saffron
#

so it can only work if you have an accumulated balance

#

or if you link to some other payment that was >=10

hollow narwhal
#

Okay, think it sounds better to just ensure we have an accumulated balance at all times.

pine saffron
#

but AFAIK you shouldn't do that since it makes the funds flow murky from a regulatory perspective since it mixes two transactions, though I'm not sure on that part

hollow narwhal
#

Hmm

#

This feels rather hacky for a discount solution

#

I think part of the reason is we aren't using Products/Subscriptions which seem to have out of the box functionality for discounts etc.

#

Do customers tend to use this over PaymentIntents for this reason?

#

Because implementing this type of discount functionality for PaymentIntets/Transfers feels rather messy

pine saffron
#

hmm what you're describing is a really advanced usage of Stripe though

#

it's only complicated because you want the connected account to get the full amount despite the fact you give the customer a discount

hollow narwhal
#

yeah, i suppose that as a marketplace that doesn't feel like a big ask though, right?

#

as in, customer gets a discount (given by platform) and connect still gets their money

pine saffron
#

perhaps, but it's not something we natively support today

hollow narwhal
#

yeah makes sense

#

out of interest have you experienced a use case like this before

pine saffron
#

yes, for really large users sometimes

hollow narwhal
#

just wondering if instead we should be using Stripe Product for example

pine saffron
#

I mean you can use Products but that's a higher-level question and we're deep into exploring this option

hollow narwhal
#

Yeah it was more of a quesiton

pine saffron
hollow narwhal
#

Should we have used Products for this?

pine saffron
#

well there is no easy solution if you have this requirement of transferring the undiscounted amount

hollow narwhal
#

Okay so it would still have been complex even if we did use Products

pine saffron
#

regardless of what you use you would end up needing to accumulate a balance and making separate transfers as far as I know

hollow narwhal
#

Fair enough.

#

I saw Stripe had capability for discounts with Products/Subscriptions

#

So i just assumed maybe this use case would have been easier

#

or the right way to go about it/should have gone about it

#

but if that's what youre saying, i understand

#

alright, is there anyway to leave this thread open/export without taking screenshots

#

i just want a way to refer back to the things you mentioned for our dev team

hollow narwhal
pine saffron
hollow narwhal
#

thanks, also I just realised the step 2 would only be £5. given in step 1 we created a payment intent of £5. That would be £10 in total so it should be fine.

#

as long as the amount in the transfer doesn't exceed the payment intent amount

#

which should be the case

pine saffron
#

hmm I am so lost

#

wasn't the whole point that you want to charge 5 but transfer 10

pine saffron
hollow narwhal
# pine saffron wasn't the whole point that you want to charge 5 but transfer 10
  1. Charge £5 to Customer (discounted from £10).

Currently we use PaymentIntent with the amount of £10. So for this use case we adjust to £5

  1. Now we need to figure out how to send the remaining £5 so that the destination Connect account gets their full amount. With this in mind, we initiate a transfer of £5 (difference) so in total they should receive £10

?

pine saffron
#

so you do charge £5 then!

#

when I say "charge" I mean the amount you pass when creating the PaymentIntent, since that's all that matters really

hollow narwhal
#

Yup, the amount we would charge is £5.

#

Does this make it easier 😛

#

But again, we want to ensure the Connect account gets the remaining £5. So in total they receive £10. In this case that is.

pine saffron
#

yep so then you need to have £10 in your platform's available balance(by being on manual payouts and accumulating funds over time and/or adding topups to keep your balance sufficient (https://stripe.com/docs/connect/top-ups) )

hollow narwhal
#

Okay, just to be clear the Connect account doesn't need to have manual payments switched on?

pine saffron
#

no, it's for your platform(since otherwise your platform doesn't accumulate funds as they get paid out automatically)

#

the connected accounts can use any payout schedule, that's separate

hollow narwhal
#

Awesome

#

Okay this is sounding better

#

🙌

#

Hey, just floating an idea.

What if we created a PaymentIntent without transfer_data. This would mean those funds come to our platform account right?

Assuming we ensured that our platform remains topped up with a balance, we can just trigger a transfer directly to the Connect account of the entire amount?

#

That way we avoid sending part of the payment to the destination account (Customer) directly via the PaymentIntent which we currently do and then also initiate a transfer with the difference.

pine saffron
#

this is exactly what I've been proposing.

#

sorry, maybe we were not on the same page, but that's exactly what I was talking about

hollow narwhal
#

Oh okay, sorry it's been a complex deep-dive 😅

hollow narwhal
#

Thank you

#

!

pine saffron
#

I'm stepping away for lunch but I think things are fairly clear at the moment?