#vitali-auto-payout

1 messages ยท Page 1 of 1 (latest)

errant whale
#

Hi there! No, this isn't possible.

velvet totem
#

lol ok

#

is there a way i can test it?

errant whale
#

What are you looking to test, specifically? You would either use a manual payout or you would mock the data here.

velvet totem
errant whale
#

Ah sorry, didn't realize you had a recent thread.

velvet totem
#

its not your fault

#

its also unrelated i guess lol

errant whale
#

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.

velvet totem
#

dang

#

oh well

#

thx anyways

velvet totem
#

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?

errant whale
#

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.

velvet totem
#

transfers meaning we transfered the money as in manual payout?

errant whale
#

No, a transfer is when you move funds from your platform to your Connected account.

velvet totem
#

so thats a payout?

#

oh you mean destination charges

errant whale
#

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

velvet totem
#

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_?

next steeple
#

What is the end goal here in terms of info you looking to store in your DB?

#

The original payment intent on your platform?

velvet totem
#

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

next steeple
#

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?

velvet totem
#

py_1KdXRfRc2WX8jYNY6LebXVFw

#

can i make a request for this to be simpler? they should add it in the api

next steeple
#

Thank you. I am checking that out

velvet totem
#

like payout:po_

#

for every payment

next steeple
#

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

velvet totem
#

yeah definately

#

im just sure im not the only one

#

and i know connect is fairly new

#

anyways im listening

next steeple
#

I am still looking and will update you with what I can find

velvet totem
#

๐Ÿ™

next steeple
#

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

#

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

velvet totem
#

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

next steeple
#

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

velvet totem
#

ok thx im going offline please keep me updated

next steeple
#

You can get back to the original PaymentIntent on the platform account by:

  1. 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
  2. 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
  3. Fetching the source transaction on the platform account: https://stripe.com/docs/api/charges/retrieve
  4. Checking the payment_intent property on that charge