#sinotz-paymentintents
1 messages · Page 1 of 1 (latest)
hello again
you list PaymentIntents created for a Customer: https://stripe.com/docs/api/payment_intents/list?lang=node#list_payment_intents-customer
they are in reverse-chronological order, so you might have to paginate to get the oldest (if it is >100)
hi again lol
how about first time successful payment intents for all customers within a daterange?
in other words new sales for each month as an example
or each day
from people who never paid before but it is their first time paying
oh wow
lemme link it to you
no arrays or anything?
i think i have to put all the dates into an array to get the earliest one out of them
it is easy for 1 customer but now i want to do it for all customers
that is an example to get the total first time sales from all customers
not sure I understand
but really, the date params I mentioned to you are "show me charges created before X date but after Y date"
so if you have a bunch of customers you want to look for PaymentIntents on, you'll have to make multiple requests to the List endpoint
Hello! Sigma requires Dashboard access, so if you can't log in you wouldn't be able to use Sigma.
gotta do things the hard way then
would you happen to know how to get all customer first time payment amounts then total them all?
You can do it via the API using the list calls above, but it would take a while depending on how many Customers you have.
You would first list all your Customers, then for each Customer list their payments until you got to the first one.
so 2 loops?
loop through successful payment intents then pass the customer ids from the successful payment intents to another stripe list call?
I would recommend doing it the other way around: list Customer loop with a get first Payment Intent loop inside that one.
ok
Can I ask why you need access to the first payment only for each Customer?
And you don't have Dashboard access?
first time sales for a date range
gotta prepare in case you guys randomly shut off my account for no reason
i need to track payments for bookeeping purposes
Why would we shut off your account?
for political reasons who knows
could be anything
unfortunately that is the reality we are living
If you're looking for a date range and not the first ever payment you can specify a specific date range when listing Payment Intents for a Customer: https://stripe.com/docs/api/payment_intents/list#list_payment_intents-created
yes that i know how to do
Eve if we shut down your account you would still have full access, you just can't accept payments
but ultimately you should cache all of this in your database
that is fine i need to use the api then to access the data
this is requiring me so much work just because we live in a cancel culture
Let's leave the politics out of it please
It's fairly easy to ingest all of that in your database, either via daily exports from Sigma or via the API itself + webhooks
sigma can connect to my database?
no but you can use the reporting API to export whatever you need daily for example
a reporting API? you mean prestodb queries?
ok that i have used before i thought this was a new API with new objects
What do I do next? https://dpaste.org/c5Uk
I'm not sure what you're asking, there are 5 lines of code and it's just paginating the List PaymentIntents API
you do whatever you want with the data here. You store the information you care about in your own database
i am trying to replace this sigma query https://dpaste.org/Du27
that is an old query before payment intent time
Sure, but that's mostly up to you to figure this out, I can't just write your code
get a total of first time sales (first time a customer ever paid) and add the totals up
you're getting a PAymentIntent. Dump the whole object and look for the information you care about and aggregate all of this in your own database
if you want to aggregate sales you really will need 200+ lines of code
it's not a 5 minutes script
does that make sense?
yea but the way you said it makes me not want to do it anymore
I'm trying to explain that you can't replace one Sigma query with a few lines of code unfortunately. If you want to use the API, you'll usually aggregate all the data on your end (what Sigma does for you) and then run your own queries on your own data. This is a lot of work to put this in place
yea while with cryptocurrency i set everything up in a day lol
this is why if stripe does not change i don't see things getting better for you guys
I mean we built all of Sigma, and you have all the info you want in one query, so we are doing something right. You seem to not want to trust Sigma, nor use the API daily to ingest the Sigma results. If you want to rebuild your own implementation of Sigma, it's expected that it won't take 5 minutes or even a day.
yea you're right