#Kryptman-charge-BT

1 messages ยท Page 1 of 1 (latest)

kind eagle
#

Hello ๐Ÿ‘‹
Can you share the code snippet you're currently using to retrieve this?

viscid moss
#

Sure

#
  const balanceTransaction = await stripe.charges.retrieve(
    txn, {
      expand: ['payment_intent.source'],
    }
  );
}```
#

I know this charge has 100% some tax amount of 690 => ch_3LRdX9A2IeyTC3z31PtKjlV1

#

but I can't retrieve it

pure summit
#

๐Ÿ‘‹ stepping in here for hanzo as they needed to step away.

viscid moss
#

yep

#

and how do I connect my charge with the checkout session object ?

#

or with the balance transaction? is there any way ?

#

maybe throught the payment_intent ?

pure summit
#

Yep

#

You can expand the PaymentIntent on the Session

#

Which will contain the Charge

viscid moss
#

but according to the documentation

#

or am I doing something wrong ?

#

I can only think on querying the checkoutsession with

const sessions = await stripe.checkout.sessions.list({
  payment_intent: myPaymentIntent,
});

And from there retrieve the information

pure summit
#

Yep you would need to go Session --> PaymentIntent here.

viscid moss
#

epic

#

this will do the trick !

pure summit
#

Really the recommended route is that you store this in your own database

viscid moss
#

thank you so much bismarck

pure summit
#

So you don't have to list each time

#

Yep sure thing!

viscid moss
#

ok

#

we will do something like that moving forward

#

because invoicing is getting very messy ๐Ÿ˜„

#

have a really awesome Wednesday and thanks again !