Skip to content

Cursor pagination resulting in 500 error #73

Open

Description

@iamroi

When I tried to use the nextPageLink retrieved from the first request for the next pagination request, 500 error response received.

Sample request code,

$listPaymentsData = new ListPaymentsData([
    'nextPageUrl' => "https:\/\/global-api.afterpay.com\/v2\/payments?cursor=FooBarAyNDA2MTYJUSNQxMDIwLjEwOVo%3D%3AMDAxLnN2Z3Vnbmc4bWxrYzYyZWxyMnZkMXBmb3JzdW11NDc0NDc0bXJvMHZzbjBhcXN1aw%3D%3D&statuses=APPROVED&fromCreatedDate=2024-06-03T14%3A05%3A15+10%3A00&includeNextLink=true&toCreatedDate=2024-06-11T14%3A25%3A15+10%3A00",
]);

$result = resolve(AfterpayApiService::class)->listPayments($listPaymentsData);

Response:

 HTTP request returned status code 500:
{
  "errorCode" : "error",
  "errorId" : "9940463abf9b1a1e",
  "message" : "An error occurred processing your request",
 (truncated...).

Note that the nextPageUrl contains statuses, fromCreatedDate, toCreatedDate. If I remove them and just keep the cursor parameter, it works. Is it this intended and safe to remove those parameters for pagination request?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions