#priya_api

1 messages ¡ Page 1 of 1 (latest)

granite jungleBOT
#

👋 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/1439848165422665779

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

ripe mulch
#

Hey! Taking a look at your question now!

#

You would have to use the next_page value in the response and add it to the next request to get the following page

#

Do note not to include it in the first call

weary phoenix
#

Hi @ripe mulch I understand that using the charge object, we can fetch and use next_page value. But I am using the Stripe.Client , not the direct Charge Object... In Stripe.Client , I use the code snippet :

func (s Service) GetFailedTransactions(ctx context.Context, reqQueries cmsCont.ListFailedTransactionReq) ([]stripe_v83.Charge, error) {
partnerID := gCommon.GetPartnerID(ctx)
sc := s.client[partnerID]

expandField := pCommon.DataCustomer

params := &stripe_v83.ChargeSearchParams{
    Expand: []*string{&expandField},

    SearchParams: stripe_v83.SearchParams{
        Single: true,
        Query:  "status:'failed' AND created>=" + reqQueries.StartTime + " AND created<=" + reqQueries.EndTime,
        Limit:  stripe_v83.Int64(reqQueries.Limit),
    },
}

if reqQueries.NextPage != "" {
    params.Page = stripe_v83.String(reqQueries.NextPage)
}

failedTransactions := []stripe_v83.Charge{}

for charge, err := range sc.V1Charges.Search(ctx, params) {
    if err != nil {
        return nil, err
    }

    failedTransactions = append(failedTransactions, *charge)
}

return &failedTransactions, nil

}

and here I am not able to retrieve the NextPage params from the response body.

Please help me to rectify the code to able to fetch the next page value here.

#

Please note that, I am using the Stripe Go SDK version v83, where I don't get the methods like .Next() or .Meta()

ripe mulch
#

The next_page field is not in the charge object but in the Search Response object as seen here

weary phoenix
#

Hi @ripe mulch I already understand the docs you shared, but they didn't resolve my issue. I have moved to the stripe support email...

ripe mulch
#

As in, you submitted a support ticket for this?