#harshit.tyagi
1 messages · Page 1 of 1 (latest)
Hi there, no you can't specify percentage for transfer_data (https://stripe.com/docs/api/payment_intents/object?lang=node#payment_intent_object-transfer_data-amount) you should consider the discount when calculating the amount for transfer_data
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
But, my use case doesn't allow me to consider the discount when calculating the amount for transfer_data. I have multiple type of stripe promo codes which give different discount % to customers .. so I don't know which promo code will be availed by customer.
@vast mason
There's no need to tag me, I'd reply you eventually
So I believe the problem here is that you don't know what promo code that your customer will use when creating the checkout session.
Yes, that's correct
OK, please try this out. Create a checkout session with paymentIntent' capture_method=manual, once the checkout session completes, capture the PaymentIntent with the new transfer_data[amount]
okay, so when and where should I specify the connect transfer amount if I use this capture_method=manual?
When you capture the paymentIntent https://stripe.com/docs/api/payment_intents/capture?lang=node#capture_payment_intent-transfer_data
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
hmm ... okay so what I am understanding here - there would be two separate api calls
- to create the checkout session
- to capture the amount and to do the connect transfer
but in this process, how'd would I get the discounted amount .. because I think I'd need that to make the second call?