#kanwardanial_api

1 messages · Page 1 of 1 (latest)

green nimbusBOT
uncut flaxBOT
#

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

green nimbusBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1240342170834046987

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

steady nexus
#

Hi

shell wind
#

Hello! When you say it's not giving the desired result, what is it giving, and how exactly is it different from what you expect?

steady nexus
#

its only shows 11 or sometime 8 records that are all incomplete_expired

shell wind
#

What are you expecting instead?

steady nexus
#

all subscriptions within the date range

#

that same as shown if i select for 2 to 3 days range

shell wind
steady nexus
#

subscriptions-audit?subscriptions_from_date=2024-05-01&subscriptions_to_date=2024-05-15&status_option=all&payment_option=ps2&subscriptions_account=

shell wind
#

No, sorry, I need the request ID. It's the Stripe ID for that API request. It starts with req_.

steady nexus
#

ok

#

where i can look this request??

hybrid geode
#

Hi why stripe don’t support Middle East country ?
I am in Kuwait why I can’t use stripe for my store ???

shell wind
#

See the link I added above.

green nimbusBOT
#

@hybrid geode looks like you're in the wrong place, this thread is for someone else's question.

Note that posting inappropriate messages in other people's threads is against the rules. No worries if this was just an honest mistake, but anyone who violates the rules multiple times will be removed from this server.

steady nexus
#

??

shell wind
#

Do you have a new question?

steady nexus
#

@shell wind can you please tell me where i find request from my stripe dashboard?

shell wind
#

Do you have questions about those instructions?

steady nexus
#

Oops my bad Sorry

#

Request query parameters
{
"limit": "200",
"status": "all",
"created": {
"lte": "1714867200",
"gte": "1714521600"
},
"expand": {
"0": "data.customer"
}
}

#

req_MBWi6pxJItJMA0

shell wind
#

The date range specified in that request is 2024-05-01 00:00:00 UTC to 2024-05-05 00:00:00. Is that the date range you're expecting?

steady nexus
#

05-01 00:00:00 UTC to 2024-05-15 00:00:00

#

in this i got only 11 results

green nimbusBOT
shell wind
#

That's not the date range you provided.

#

You're saying the 1st to the 15th, but the actual timestamps you passed in the request are from the 1st to 5th.

steady nexus
#

{
"limit": "200",
"status": "all",
"created": {
"lte": "1715731200",
"gte": "1714521600"
},
"expand": {
"0": "data.customer"
}
}

#

req_mC3VEuH8rjzArM

eternal topaz
#

Hi there 👋 taking over, as my colleague needs to step away

Give me a few minutes to get caught up.

steady nexus
#

Hi

#

i am epecting 226 records only getting 11

eternal topaz
#

What are you looking at that indicates that you have 226 Subscriptions created within those specific dates?

steady nexus
#

stripe dashboard

#

using filter at subscription list it gives me 226 records

eternal topaz
#

Can you be more specific? What filters did you select?

steady nexus
#

i select status='all' & dates in between 01-05-2024 to 15-05-2024

#

and from my application i added this request

#

{
"limit": "200",
"status": "all",
"created": {
"lte": "1715731200",
"gte": "1714521600"
},
"expand": {
"0": "data.customer"
}
}

#

?

eternal topaz
steady nexus
#

I did the same but only get 1st itteration records not all.

eternal topaz
#

What does that mean "the same"?

steady nexus
#

$stripeSubscriptions = \Stripe\Subscription::all([
'limit' => 100,
'status' => $status,
'created' => [
'gte' => $subscriptions_from_date,
'lte' => $subscriptions_to_date,
],
'expand' => ['data.customer'],
'starting_after' => $from_id,
]);

eternal topaz
#

You have to create a loop that does that recursively like what they show in the examples

steady nexus
#

$subscriptions = (object)[];
$subscriptions->data = [];
$hasNext = true;
while($hasNext && count($subscriptions->data) < 1000){
$from_id = "";
if ($subscriptions->data){
$from_id = end($subscriptions->data)->id;
}
if ($from_id){
// echo $from_id;die;
$stripeSubscriptions = \Stripe\Subscription::all([
'limit' => 50,
'status' => $status,
'created' => [
'gte' => $subscriptions_from_date,
'lte' => $subscriptions_to_date,
],
'expand' => ['data.customer'],
'starting_after' => $from_id,
]);
}else{
$stripeSubscriptions = \Stripe\Subscription::all([
'limit' => 50,
'status' => $status,
'created' => [
'gte' => $subscriptions_from_date,
'lte' => $subscriptions_to_date,
],
'expand' => ['data.customer'],

            ]);
        }

        $subscriptions->data = array_merge($subscriptions->data, $stripeSubscriptions->data);
        $hasNext = count($stripeSubscriptions->data) == 50;
    }
#

this is my code, can you please review it and identify the mistake that i do....