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

The samples are all completely independent and self-contained. #58

Open
BackcountryBug opened this issue Feb 19, 2023 · 2 comments
Open

Comments

@BackcountryBug
Copy link

BackcountryBug commented Feb 19, 2023

Under Readme section "Using the Sample Code" - https://github.com/CyberSource/cybersource-rest-samples-php#using-the-sample-code - it states "The samples are all completely independent and self-contained.", but after reviewing the code, this doesn't appear to be true.

Example:
https://github.com/CyberSource/cybersource-rest-samples-php/blob/master/Samples/Payments/Payments/AuthorizationWithCaptureSale.php

This file has code:

require_once __DIR__ . DIRECTORY_SEPARATOR . '../../../Resources/ExternalConfiguration.php';

which is another file in the repo. Maybe I'm reading the blurb wrong, but that file to me is a sample, and if it's self-contained it shouldn't require other files.

Anyway, even if I consider "self-contained" samples to mean "the repo is self-contained as a run app", then that's not exactly true either. The above line of code requires vendor through composer that's compatible with PHP 5.6:

require_once __DIR__ . DIRECTORY_SEPARATOR . '../../../vendor/autoload.php';

This is required for at least one line in that AuthorizationWithCaptureSale.php sample file's code, like:

$api_instance = new CyberSource\Api\PaymentsApi($api_client);

I'm working on a Mac (Ventura) that doesn't have PHP 5.6 or a compatible version of composer installed, so I will have to do a deep-dive to figure that out for a "self-contained" sample file.

Anyway, I can try to get the whole repo with vendor code running, but to me the blurb is not accurate, as the sample files are not self-contained. I'm curious exactly what's meant by "self-contained" or "independent".

@BackcountryBug
Copy link
Author

I searched GitHub for CyberSource PaymentsApi - https://github.com/search?q=org%3ACyberSource+cybersource+PaymentsApi - and results said 0 repositories... so... is that library restricted?

At best I can try installing the samples repo on another computer at another location with composer to see if it downloads it to vendor...

@davidkhala
Copy link

@BackcountryBug while I am not sure about context, but this repository is written in nodejs instead of php. Should this issue be moved to https://github.com/CyberSource/cybersource-rest-samples-php?

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

No branches or pull requests

2 participants