#Rachel Bingham-py-payments
1 messages ยท Page 1 of 1 (latest)
Good question. Checking in to that...
Is the end goal to list out payments with that prefix?
The end goal is to call Stripe::Charge.list and be sure that all charges including the py_xxx ones are there.
We are missing some charges and normally we have a service which checks this but I think it is missing the bank payments
Do you have an example id if a py_xxx that is not showing up?
Yes. But should I reveal it here???
Not sure if that call alone can list those payments but I am sure there will be some way to list it
Yep, safe to send the IDs here
here's the charge py_3K546MKoz4lNOAHN0M5XpeWA
I have a script to list all charges between two times using a loop and```
created: { gte: since.to_time.to_i, lte: till.to_time.to_i }
That charge was created in between those times but is not showing up. Listing all charges ids there only seem to be ch_xx ones```
Thanks for the info, will look in to this in a minute
Thanks ๐
Interesting. I am able to see a charge that I create the same way when I list charges like that. Have you confirmed that py_3K546MKoz4lNOAHN0M5XpeWA specifically does not show up when you list charges from that time?
Yes, I pulled a list of charges from a 3 hour period covering when it was created and it (and possible several more) were not lncluded. I can share my script if that helps?
Yes please, unsure why it wouldn't be listed there
Basically this
last_charge_id = nil
all_charges = []
loop do
stripe_charges = Stripe::Charge.list(limit: 100,
starting_after: last_charge_id,
created: { gte: since.to_time.to_i, lte: till.to_time.to_i })
stripe_charges.each do |stripe_charge|
all_charges << stripe_charge
end
break unless stripe_charges.has_more
last_charge_id = stripe_charges.data.last.id
end
Also
since = Time.new(2021, 12, 10, 6, 30)
till = since + 3.hours
stripe_charge = Stripe::Charge.retrieve("py_3K546MKoz4lNOAHN0M5XpeWA")
stripe_charge.created.in?(since.to_time.to_i..till.to_time.to_i) # true
Also there were defo some other charges with py_xx ids during that period which is how we came to be investigating this (we had a short outage during this time)
Not immediately seeing why it wouldn't show up in that call, especially if retrieve works from the same account
Yeah it is weird but it seems they can't be listed that way
That was created from a payment intent, do you see the payment intent pi_3K546MKoz4lNOAHN0ZnKJosy when you list your payment intents?
Also I can't see why this would be different, but can you try our auto paging iterator and see if that works instead? https://stripe.com/docs/api/pagination/auto?lang=ruby
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
I have the payment intent and the stripe event in our system. I don't normally try listing them
I'm just trying to see where else this is present or not present
Or how I might be able to recreate this. Like I said I was able to find a charge with a py_ id from the same payment method.
Oh, I'll try that autopaginator - haven't see that before.
Same result with autopaginator. I have a confession - we are on API version "2014-09-08" - could that be the issue?
Yes, that may have something to do with it. Let me check in to that.
Thanks
So yes, it looks like this is related to your API version. 2015-09-23 is the version that first allowed non-card payment types to be retrieved via the list all charges call. https://stripe.com/docs/upgrades#2015-09-23
Thinking for a bit on what you can do here...
We are looking to upgrade but it is not imminent. But we do need to be able to locate missing payments ๐
Good to know. Unfortunately I am not seeing an easy way to modify that call to get non-card payments on your version
You can override what version of the API your app specifically is using One thing that comes to mind is that you can override the API version for your app and make this list call https://stripe.com/docs/api/versioning?lang=ruby
Which would allow it to list the payments you are looking for. I don't think the structure of the objects has changed so that may not be too large a lift in this specific case One thing that comes to mind is that you can override the API version for your app and make this list call https://stripe.com/docs/api/versioning?lang=ruby