CyberSource / CyberSource/cybersource-rest-client-java

PtsV2CreateOrderPost201Response is missing the id field from API response

Open
#237 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
29
Forks
50
Avg merge
28m
Merged PRs (30d)
1

Description

Here's a ready-to-use GitHub issue text:

Title: PtsV2CreateOrderPost201Response is missing the id field from API response

Body:

Bug Description

The PtsV2CreateOrderPost201Response model class is missing the id field,
even though the CyberSource API returns it in the JSON response.

This completely blocks the order-to-authorization flow, since the id returned
by the Create Order endpoint is required to perform the subsequent authorization call.

Steps to Reproduce

  1. Call the Create Order API (POST /pts/v2/orders)
  2. Receive a 201 response from the API
  3. Try to access the id field from PtsV2CreateOrderPost201Response
  4. Field returns null despite being present in the raw JSON response

Expected Behavior

PtsV2CreateOrderPost201Response.getId() should return the order id
provided in the API response.

Actual Behavior

PtsV2CreateOrderPost201Response has no getId() method and no id field mapped.
The raw JSON response clearly contains the field:

{
"id": "XXXXXXXXXXXX",
"submitTimeUtc": "...",
"status": "PENDING",
...
}

But the SDK model does not deserialize it, resulting in a null value.

Impact

Critical — Without the id, it is impossible to proceed with the
authorization API call, making the full order flow non-functional.

Workaround

Manually parsing the raw response body using peekBody() and Gson
to extract the id before the SDK consumes the response:

String rawJson = response.peekBody(Long.MAX_VALUE).string();
JsonObject jsonObject = JsonParser.parseString(rawJson).getAsJsonObject();
String orderId = jsonObject.get("id").getAsString();
  • **SDK Version: All

Add the missing id field to PtsV2CreateOrderPost201Response:

@SerializedName("id")
@JsonProperty("id")
private String id;

public String getId() { return id; }
public void setId(String id) { this.id = id; }

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

Locate the PtsV2CreateOrderPost201Response model and inspect how its existing fields are serialized and exposed. Confirm the Create Order response mapping against the documented JSON, then verify that the order id is available through the model's public accessor and can support the subsequent authorization flow.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.