CyberSource / CyberSource/cybersource-rest-client-php

0.0.73: createPlan() fatals — SdkTracker calls missing CreatePlanRequest::getClientReferenceInformation()

Open
#223 0 comments 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

Problem

Recurring billing (Plans + Subscriptions) fails with PHP fatals before the HTTP request is sent.

1) PlansApi::createPlan()
Call to undefined method CyberSource\Model\CreatePlanRequest::getClientReferenceInformation()
in lib/Utilities/Tracking/SdkTracker.php
SdkTracker includes CreatePlanRequest and calls getClientReferenceInformation().
In 0.0.73, CreatePlanRequest only has planInformation and orderInformation (no clientReferenceInformation).
In 0.0.61, that field existed.
Create Plan API does not document clientReferenceInformation on create plan.

2) SubscriptionsApi::createSubscription()
Class "CyberSource\Model\Rbsv1subscriptionsClientReferenceInformation" not found
Removed in 0.0.73.
CreateSubscriptionRequest now uses GetAllSubscriptionsResponseClientReferenceInformation (code only).
Sample CreateSubscription.php still uses removed class names (written for older SDK).

3) SdkTracker on subscriptions
After fixing (2), unpatched SdkTracker calls getPartner() on GetAllSubscriptionsResponseClientReferenceInformation, which has no getPartner() → another fatal.

Reproduce

Install SDK 0.0.73.
Call createPlan() with body: planInformation + orderInformation only → fatal (1).
Call createSubscription() using current samples / old model class → fatal (2) or (3).

Expected

Requests reach the API without PHP fatals.

Suggested fix

Remove CreatePlanRequest from SdkTracker inclusion list or use method_exists() before calling getClientReferenceInformation / setClientReferenceInformation.
Use method_exists() for getPartner / setPartner on nested client-reference objects.
Update cybersource-rest-samples-php for 0.0.73 model names.
Document migration from 0.0.61 → 0.0.73 for RBS models.
Workaround
Patch lib/Utilities/Tracking/SdkTracker.php locally; use GetAllSubscriptionsResponseClientReferenceInformation with code only in app code.

Update

Same SDK version also breaks subscriptions: Rbsv1subscriptionsClientReferenceInformation removed; use GetAllSubscriptionsResponseClientReferenceInformation (code only). SdkTracker must not call getPartner() on that model. Samples need updating for 0.0.73.

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/Utilities/Tracking/SdkTracker.php and trace its handling of CreatePlanRequest and subscription client-reference models. Then inspect the current CreateSubscription.php sample and the 0.0.73 model classes. Done means plan and subscription requests reach the API without PHP fatals, and the sample uses the current model names.

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
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.