#blobzed
1 messages · Page 1 of 1 (latest)
Hi there!
hi
Where is the metadata stored exactly? On the PaymentIntent object of somwhere else?
I have no idea but would assume its somehow linked to the customer record
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.
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)'
Can you shar eone PaymentIntent ID (pi_xxx) so I can have a look myself?
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"
},
yes
Then of you have a BalanceTransaction object, you can:
- Check the
sourcewhich should contain a Charge ID - And in the Charge objecgt check the
payment_intentID - And in the PaymentIntent check the
metadata
Note that you should be able to do all of this in a single API call if you use expand as explained here: https://stripe.com/docs/expand
Unfortunately the source is null!
Well you need to only check balance transaction that comes from a Charge
They should have type:charge: https://stripe.com/docs/api/balance_transactions/object?lang=node#balance_transaction_object-type
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
I see it as sourceId
but you can't expand sourceid I believe
If you expand sourceId, maybe you'll get an object inside of source? I recommend doing some tests.
Just tried gives an exception can't expand sourceid
Can you try without using expand for now, and see if everything works?