CyberSource / CyberSource/cybersource-rest-samples-csharp

Error while calling samples.

Open
#17 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
28
Forks
46
PR merge metrics
No merged PRs in 30d

Description

Tried to call API though samples (C#) but it always through error "object reference error"
Not sure what I am doing wrong.

Below is the stack trace, it failed in CallAuthenticationHeaders

Able to generate by own secratekey and able to download report and access others APIs using same credentials over here: https://developer.cybersource.com/api/reference/api-reference.html

at CyberSource.Client.ApiClient.CallAuthenticationHeaders(String requestType, String requestTarget, String requestJsonData)
at CyberSource.Client.ApiClient.PrepareRequest(String path, Method method, Dictionary2 queryParams, Object postBody, Dictionary2 headerParams, Dictionary2 formParams, Dictionary2 fileParams, Dictionary2 pathParams, String contentType) at CyberSource.Client.ApiClient.CallApi(String path, Method method, Dictionary2 queryParams, Object postBody, Dictionary2 headerParams, Dictionary2 formParams, Dictionary2 fileParams, Dictionary2 pathParams, String contentType)
at CyberSource.Api.ReportDownloadsApi.DownloadReportWithHttpInfo(Nullable`1 reportDate, String reportName, String organizationId)
at Cybersource_rest_samples_dotnet.Samples.Reporting.CoreServices.DownloadReport.Run() in C:\Users\agarwaly\Desktop\CyberSource Reports\cybersource-rest-samples-csharp-master (2)\cybersource-rest-samples-csharp-master\src\Samples\Reporting\CoreServices\DownloadReport.cs:line 35

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 at src/Samples/Reporting/CoreServices/DownloadReport.cs line 35 and follow the stack trace into ApiClient.CallAuthenticationHeaders and PrepareRequest. Reproduce the DownloadReport sample with the stated credentials and compare its request inputs with the other working API calls. Done means the sample identifies the cause and downloads the report without the object reference error.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.