#prabhaw-soti-ebpearls_api

1 messages ยท Page 1 of 1 (latest)

sharp runeBOT
vivid fjordBOT
#

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

sharp runeBOT
#

๐Ÿ‘‹ Welcome to your new thread!

โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

๐Ÿ”— This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1234713020513390685

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

noble spruce
#

does txn_1PAqwND80PYF8bjMUMgk2WTH this transaction is payout.paid or not with intent id pi_3PAqwMDRWO0fOu0Z1CPFRl3v

vivid fjordBOT
noble spruce
#

case 'payment_intent.succeeded':
setTimeout(async () => {
paymentIntent = paymentData.id;
const charge = await this.stripe.paymentIntents.retrieve(paymentIntent,{
expand:['latest_charge.transfer.destination_payment']
})

      //@ts-ignore
       const chargeId = charge.latest_charge.transfer.destination_payment.balance_transaction

       console.log(chargeId)
    
      await this.handlePaymentIntendSuccessEvent(paymentIntent, chargeId);
      },1000);
      break;

case "payout.paid":
// setTimeout( async ()=>{
console.log(paymentData.balance_transaction)
await this.handlePaymentSuccedeedEvent(paymentData.balance_transaction);
// }, 10000);
break;

#

does the balance_transction from intent.success is equal to payout.pain.balance_transaction

sharp runeBOT
dark cove
#

๐Ÿ‘‹ Taking over this thread, catching up now

noble spruce
#

ok

#

const chargeId = charge.latest_charge.transfer.destination_payment.balance_transaction

#

is this same to

#

case "payout.paid":
// setTimeout( async ()=>{
console.log(paymentData.balance_transaction)
await this.handlePaymentSuccedeedEvent(paymentData.balance_transaction);
// }, 10000);
break;

#

does txn_1PAqwND80PYF8bjMUMgk2WTH this transaction is payout.paid or not with intent id pi_3PAqwMDRWO0fOu0Z1CPFRl3v

dark cove
#

payout.paid is the payout of your balance that can include multiple payments.

What are you trying to achieve here?

noble spruce
#

i have create connect account and and when user pay to my bank account i save ( paymentIntent and charge.latest_charge.transfer.destination_payment.balance_transaction to database ) so that wnen user get or strip deposit payment to seller bank account which is auto then i have to update status in may database ( first when user create intent to connect accoun it will be "PENDING" , when payout is success ite willbe "DEPOSITED" and when failed "FAILED" status

#

case 'payment_intent.succeeded':
setTimeout(async () => {
paymentIntent = paymentData.id;
const charge = await this.stripe.paymentIntents.retrieve(paymentIntent,{
expand:['latest_charge.transfer.destination_payment']
})

      //@ts-ignore
       const chargeId = charge.latest_charge.transfer.destination_payment.balance_transaction

       console.log(chargeId)

      await this.handlePaymentIntendSuccessEvent(paymentIntent, chargeId);
      },1000);
      break;  

this evene is on normal event

#

case "payout.paid":
// setTimeout( async ()=>{
console.log(paymentData.balance_transaction)
await this.handlePaymentSuccedeedEvent(paymentData.balance_transaction);
// }, 10000);
break;

#

this event is in connect account event

#

also how to get charge id from single balance transction without loop of current payout

#

if charge is to be save

dark cove
#

A single payout (po_xxx) in payout.paid event can include multiple payments, i.e. it is not one payout to one charge mapping. It's one payout to multiple charges.

You'd need to:

  1. Listen to payout.paid event
  2. Get the charge list in this payout with the guide here: https://docs.stripe.com/expand/use-cases#charges-in-payout
  3. Loop through the charge list and mark those charges have been paid out to deposited status

Learn how the expand attribute helps you perform common tasks.

noble spruce
#

so i have to fetch list of balance transction and if source has charge id and if source match then update status yes

dark cove
#

Yes! That sounds right

noble spruce
#

const balanceTransactions = await this.stripe.balanceTransactions.list({
payout: paymentData.id,
type: 'payment',
expand: ['data.source'],
});

   console.log(balanceTransactions.data.map((txn) => txn.id === 'txn_1PAqwND80PYF8bjMUMgk2WTH'))
#

is this correct is id match it shoul return true and is data has true i will update my status so ( can i do it using balance transction id or i have to check charge id or sorce id )

dark cove
#

You should get the list of charges with

const charges = balanceTransactions.data.map(
  (txn) => txn.source.source_transfer.source_transaction
);
noble spruce
#

so source_transction.id shold be equal to intent.latest_charge.transfer.destination_payment.balance_transaction

#

is this correct

#

why my all payout is deleted in test account

dark cove