CyberSource / CyberSource/cybersource-rest-client-php

DateTime Not Supported For ReportDownloadsApi Rest Api

Open
#38 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
41
Forks
77
Avg merge
26m
Merged PRs (30d)
1

Description

Issue

Passing a DateTime object as the $reportDate parameter into CyberSource\Api\ReportDownloadsApi::downloadReport($reportDate, $reportName, $organizationId = null) produces an error, despite it being a valid parameter type.

Seems to be due to the the CyberSource\ObjectSerializer formatting the date as \DateTime::ATOM which does not appear to be supported. Only date format that worked was a string value in the format of YYYY-MM-DD, which your examples do show.

Related Issue

I only bring this up because I'm converting a client to the Rest API to continue to receive their daily reports. The main issue I've been running into is that the transaction dates in at least the ConversionDetailReport_Daily_Classic report are coming back inconsistently when I pass the same date for US/CA/UK cybersource accounts. The UK report is returning transaction dates for two days ago instead of the previous day.

Example:
If I passed 2019-10-25 for US/CA/UK accounts I get the following transaction start/end dates in the reports:

US:
ReportStartDate="2019-10-24T07:00:00Z-08:00"
ReportEndDate="2019-10-25T07:00:00Z-08:00"

CA:
ReportStartDate="2019-10-24T00:00:00Z+00:00"
ReportEndDate="2019-10-25T00:00:00Z+00:00"

UK:
ReportStartDate="2019-10-23T23:00:00Z+00:00"
ReportEndDate="2019-10-24T23:00:00Z+00:00"

Known Affected Reports

  • ConversionDetailReport_Daily_Classic
  • PaymentBatchDetailReport_Daily_Classic
  • TransactionDetailReport_Daily_Classic

https://github.com/CyberSource/cybersource-rest-client-php/blob/4a9ed50c7d8fe3e8bc63a5fb2271c376d0140bd7/lib/ObjectSerializer.php#L176

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with lib/ObjectSerializer.php around line 176 and trace how ReportDownloadsApi::downloadReport handles the $reportDate parameter. Compare DateTime and YYYY-MM-DD inputs, then review the listed daily reports and their returned ReportStartDate and ReportEndDate values. Done means the supported input behavior and the affected report date handling are consistent with the issue’s expected previous-day reporting.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
api, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.