#blobzed

1 messages · Page 1 of 1 (latest)

vital thistleBOT
worldly grove
#

Hi there!

tall mason
#

hi

worldly grove
#

Where is the metadata stored exactly? On the PaymentIntent object of somwhere else?

tall mason
#

I have no idea but would assume its somehow linked to the customer record

worldly grove
#

Well you need to know precisely where it is stored if you want to be able to retrieve it with the API.

#

Is it on the Customer obejct, PaymentMethod object, PaymentIntent object, somewhere else?

#

You set the metadata yourself, so you should know where it is. Or you can find it by looking at the objects in the dashboard.

tall mason
#

I didn't set the metadata and I don;t know where it's stored. Actually I don;t even know if it's metadata in Strips terms because the BalanceTransaction doesn't have a metadata field. I just see in the export that some columns are labelled 'email(metadata)'

worldly grove
#

Can you shar eone PaymentIntent ID (pi_xxx) so I can have a look myself?

tall mason
#

hang on a sec

#

pi_3OFHlLEwRTZC74DD0c7XPlOB

worldly grove
#

The object contains a lot of metadata. Is this what you are looking for?

metadata: {
    First name: "xxx",
    Course category: "xxx",
    SessionID: "xxx",
    Course type: "xxx",
    Visit Date: "xxx",
    Last name: "xxx",
    Course Name: "xxx",
    CourseID: "xxx",
    Course code: "xxx",
    Email address: "xxx",
    Phone number: "xxx"
  },
tall mason
#

yes

worldly grove
#

Then of you have a BalanceTransaction object, you can:

  • Check the source which should contain a Charge ID
  • And in the Charge objecgt check the payment_intent ID
  • And in the PaymentIntent check the metadata
tall mason
#

Unfortunately the source is null!

worldly grove
#

Well you need to only check balance transaction that comes from a Charge

tall mason
#

null for type=charge as well.

#

MAybe I'm doing something wrong

#

DateRangeOptions dr = new DateRangeOptions()
{
GreaterThan = new DateTime(2023, 11, 22, 0, 0, 0),
LessThan = new DateTime(2023, 11, 23, 0, 0, 0),
};
BalanceTransactionListOptions listOptions = new BalanceTransactionListOptions
{
Created = dr,
//Expand = new List<string>() { "source"}
};
BalanceTransactionService transactionService = new BalanceTransactionService(StripeConfiguration.StripeClient);
using (StreamWriter sw = new StreamWriter(@"C:\ClubCaptain\Data\Stripe.csv"))
{
foreach (BalanceTransaction bt in transactionService.ListAutoPaging(listOptions))

#

and the BalanceTransaction looks like

worldly grove
#

I see it as sourceId

tall mason
#

but you can't expand sourceid I believe

worldly grove
#

If you expand sourceId, maybe you'll get an object inside of source? I recommend doing some tests.

tall mason
#

Just tried gives an exception can't expand sourceid

worldly grove
#

Can you try without using expand for now, and see if everything works?

vital thistleBOT