#vitali-auto-payout
1 messages ยท Page 1 of 1 (latest)
What are you looking to test, specifically? You would either use a manual payout or you would mock the data here.
Ah sorry, didn't realize you had a recent thread.
Yeah unfortunately there isn't a great way to test this. There is already a feature request to make automatic payouts more easily generated in testmode, but it isn't currently supported other than waiting for the payout to be created due to the schedule.
another question, when i look at the payout object all the payment_intents start with py_ instead of pi_ what should i be saving to the db?
Those are actually charge objects. Some charge objects will start with ch_xxx and some with py_xxxx.
Most likely you are looking at charges on the Connected Account that are a result of transfers from your platform.
transfers meaning we transfered the money as in manual payout?
No, a transfer is when you move funds from your platform to your Connected account.
Yeah. With a Destination charge we create a PaymentIntent on your platform, a transfer on your platform, and a charge (py_xxx) on your Connected Account
so ill need to retrieve the charge by the py_ i have from the payout and then check if the charge payment_intent matches what i have in the db?
or how else can i turn a py_ to a pi_?
What is the end goal here in terms of info you looking to store in your DB?
The original payment intent on your platform?
thats what i currently keep
for every refund and charge i have the payment intent
i want to show my connected accounts their payments and their current payout status, and in which payout it was paid out
i thought it'll be simple
I don't think the exact method you mentioned would work but there should be a way to find the original payment intent.
Can you send me an example py_123 ID?
py_1KdXRfRc2WX8jYNY6LebXVFw
can i make a request for this to be simpler? they should add it in the api
Thank you. I am checking that out
I can put in feedback for it but I cannot promise that it will be added so you will likely want to integrate with the API features that we have now
yeah definately
im just sure im not the only one
and i know connect is fairly new
anyways im listening
I am still looking and will update you with what I can find
๐
If you are looking to show which of their payments. You can figure that out with just the py_123 charge ID and payout information on the account.
What you might want to do is after each payout, make the list balance transactions call with the ID of the payout that you just made. Any payments that are a part of that payout will be returned and can be marked as paid out in your DB https://stripe.com/docs/api/balance_transactions/list
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
If you are only storing the original payment intent ID, we will still need to look in to how to match those up. Otherwise that should help you see what has been paid out
yeah thats what i tried so far
i just have them as pi and the payout lists them as py
how do i even get the py from the begining? when i pay using the payment intent api i get back a pi
Good question. I am looking in to how to line up the pi on your platform with the py on the connected account. Will get back to you with what I can find
ok thx im going offline please keep me updated
You can get back to the original PaymentIntent on the platform account by:
- Fetching the Charge on the connected account and look at its source_transfer property: https://stripe.com/docs/api/charges/object#charge_object-source_transfer
- Fetching the Transfer on the platform account using that ID, then look at the Transfer's source_transaction: https://stripe.com/docs/api/transfers/object#transfer_object-source_transaction
- Fetching the source transaction on the platform account: https://stripe.com/docs/api/charges/retrieve
- Checking the payment_intent property on that charge