#prabhaw-soti-ebpearls_api
1 messages ยท Page 1 of 1 (latest)
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.
- prabhaw-soti-ebpearls_api, 18 hours ago, 42 messages
- prabhaw-soti-ebpearls_api, 20 hours ago, 8 messages
- prabhaw-soti-ebpearls_api, 3 days ago, 22 messages
๐ 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.
does txn_1PAqwND80PYF8bjMUMgk2WTH this transaction is payout.paid or not with intent id pi_3PAqwMDRWO0fOu0Z1CPFRl3v
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
๐ Taking over this thread, catching up now
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
payout.paid is the payout of your balance that can include multiple payments.
What are you trying to achieve here?
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
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:
- Listen to
payout.paidevent - Get the charge list in this payout with the guide here: https://docs.stripe.com/expand/use-cases#charges-in-payout
- Loop through the charge list and mark those charges have been paid out to
depositedstatus
so i have to fetch list of balance transction and if source has charge id and if source match then update status yes
Yes! That sounds right
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 )
You should get the list of charges with
const charges = balanceTransactions.data.map(
(txn) => txn.source.source_transfer.source_transaction
);
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
Have you read the guide above? https://docs.stripe.com/expand/use-cases#charges-in-payout
Your code wasn't the same as above