Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cursor pagination resulting in 500 error #73

Open
iamroi opened this issue Jun 12, 2024 · 0 comments
Open

Cursor pagination resulting in 500 error #73

iamroi opened this issue Jun 12, 2024 · 0 comments

Comments

@iamroi
Copy link

iamroi commented Jun 12, 2024

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant