Skip to content

Commit 81ccced

Browse files
committed
Fixing issues reported on Github
1 parent 966eccb commit 81ccced

30 files changed

+61
-55
lines changed

generator/cybersource-php-template/ApiClient.mustache

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,18 @@ class ApiClient
5858
*
5959
* @param Configuration $config config for this ApiClient
6060
*/
61-
public function __construct(\{{invokerPackage}}\Configuration $config = null)
61+
public function __construct(\{{invokerPackage}}\Configuration $config = null, \{{invokerPackage}}\Authentication\Core\MerchantConfiguration $merchantConfig = null)
6262
{
6363
if ($config === null) {
6464
$config = Configuration::getDefaultConfiguration();
6565
}
66+
67+
if ($merchantConfig === null) {
68+
echo "Merchant Configuration cannot be null.";
69+
}
6670

6771
$this->config = $config;
72+
$this->merchantConfig = $merchantConfig;
6873
$this->serializer = new ObjectSerializer();
6974
}
7075

@@ -382,9 +387,7 @@ class ApiClient
382387
*/
383388
public function callAuthenticationHeader($method, $postData, $resourcePath)
384389
{
385-
require_once './Resources/ExternalConfiguration.php';
386-
$ExternalConfigurationObj = new ExternalConfiguration();
387-
$merchantConfig = $ExternalConfigurationObj->merchantConfigObject();
390+
$merchantConfig = $this->merchantConfig;
388391
$authentication = new Authentication();
389392
$getToken = $authentication->generateToken($resourcePath, $postData, $method, $merchantConfig);
390393
if($merchantConfig->getAuthenticationType()==GlobalParameter::HTTP_SIGNATURE){

generator/cybersource-php-template/api.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ use \{{invokerPackage}}\ObjectSerializer;
9393
* @param {{dataType}} ${{paramName}} {{description}} {{#required}}(required){{/required}}{{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}
9494
{{/allParams}}
9595
* @throws \{{invokerPackage}}\ApiException on non-2xx response
96-
* @return {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}}
96+
* @return array of {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}}, HTTP status code, HTTP response headers (array of strings)
9797
*/
9898
public function {{operationId}}({{#allParams}}${{paramName}}{{^required}} = {{#defaultValue}}'{{{.}}}'{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}})
9999
{

generator/cybersource-php-template/configuration.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ class Configuration
8585
*
8686
* @var string
8787
*/
88-
protected $host = '{{{basePath}}}';
88+
protected $host = '{{{host}}}';
8989
9090
/**
9191
* Timeout (second) of the HTTP request, by default set to 0, no timeout

lib/Api/CaptureApi.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public function setApiClient(\CyberSource\ApiClient $apiClient)
9595
* @param \CyberSource\Model\CapturePaymentRequest $capturePaymentRequest (required)
9696
* @param string $id The payment ID returned from a previous payment request. This ID links the capture to the payment. (required)
9797
* @throws \CyberSource\ApiException on non-2xx response
98-
* @return \CyberSource\Model\PtsV2PaymentsCapturesPost201Response
98+
* @return array of \CyberSource\Model\PtsV2PaymentsCapturesPost201Response, HTTP status code, HTTP response headers (array of strings)
9999
*/
100100
public function capturePayment($capturePaymentRequest, $id)
101101
{

lib/Api/ConversionDetailsApi.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public function setApiClient(\CyberSource\ApiClient $apiClient)
9696
* @param \DateTime $endTime Valid report End Time in **ISO 8601 format** Please refer the following link to know more about ISO 8601 format. - https://xml2rfc.tools.ietf.org/public/rfc/html/rfc3339.html#anchor14 **Example date format:** - yyyy-MM-dd'T'HH:mm:ssXXX (required)
9797
* @param string $organizationId Valid Cybersource Organization Id (optional)
9898
* @throws \CyberSource\ApiException on non-2xx response
99-
* @return \CyberSource\Model\ReportingV3ConversionDetailsGet200Response
99+
* @return array of \CyberSource\Model\ReportingV3ConversionDetailsGet200Response, HTTP status code, HTTP response headers (array of strings)
100100
*/
101101
public function getConversionDetail($startTime, $endTime, $organizationId = null)
102102
{

lib/Api/CreditApi.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public function setApiClient(\CyberSource\ApiClient $apiClient)
9494
*
9595
* @param \CyberSource\Model\CreateCreditRequest $createCreditRequest (required)
9696
* @throws \CyberSource\ApiException on non-2xx response
97-
* @return \CyberSource\Model\PtsV2CreditsPost201Response
97+
* @return array of \CyberSource\Model\PtsV2CreditsPost201Response, HTTP status code, HTTP response headers (array of strings)
9898
*/
9999
public function createCredit($createCreditRequest)
100100
{

lib/Api/FlexTokenApi.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public function setApiClient(\CyberSource\ApiClient $apiClient)
9494
*
9595
* @param \CyberSource\Model\TokenizeRequest $tokenizeRequest (optional)
9696
* @throws \CyberSource\ApiException on non-2xx response
97-
* @return \CyberSource\Model\FlexV1TokensPost200Response
97+
* @return array of \CyberSource\Model\FlexV1TokensPost200Response, HTTP status code, HTTP response headers (array of strings)
9898
*/
9999
public function tokenize($tokenizeRequest = null)
100100
{

lib/Api/InstrumentIdentifierApi.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public function setApiClient(\CyberSource\ApiClient $apiClient)
9595
* @param string $profileId The id of a profile containing user specific TMS configuration. (required)
9696
* @param string $tokenId The TokenId of an Instrument Identifier. (required)
9797
* @throws \CyberSource\ApiException on non-2xx response
98-
* @return void
98+
* @return array of void, HTTP status code, HTTP response headers (array of strings)
9999
*/
100100
public function tmsV1InstrumentidentifiersTokenIdDelete($profileId, $tokenId)
101101
{
@@ -221,7 +221,7 @@ public function tmsV1InstrumentidentifiersTokenIdDeleteWithHttpInfo($profileId,
221221
* @param string $profileId The id of a profile containing user specific TMS configuration. (required)
222222
* @param string $tokenId The TokenId of an Instrument Identifier. (required)
223223
* @throws \CyberSource\ApiException on non-2xx response
224-
* @return \CyberSource\Model\TmsV1InstrumentidentifiersPost200Response
224+
* @return array of \CyberSource\Model\TmsV1InstrumentidentifiersPost200Response, HTTP status code, HTTP response headers (array of strings)
225225
*/
226226
public function tmsV1InstrumentidentifiersTokenIdGet($profileId, $tokenId)
227227
{
@@ -352,7 +352,7 @@ public function tmsV1InstrumentidentifiersTokenIdGetWithHttpInfo($profileId, $to
352352
* @param string $tokenId The TokenId of an Instrument Identifier. (required)
353353
* @param \CyberSource\Model\Body1 $body Please specify the previous transaction Id to update. (required)
354354
* @throws \CyberSource\ApiException on non-2xx response
355-
* @return \CyberSource\Model\TmsV1InstrumentidentifiersPost200Response
355+
* @return array of \CyberSource\Model\TmsV1InstrumentidentifiersPost200Response, HTTP status code, HTTP response headers (array of strings)
356356
*/
357357
public function tmsV1InstrumentidentifiersTokenIdPatch($profileId, $tokenId, $body)
358358
{

lib/Api/InstrumentIdentifiersApi.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public function setApiClient(\CyberSource\ApiClient $apiClient)
9595
* @param string $profileId The id of a profile containing user specific TMS configuration. (required)
9696
* @param \CyberSource\Model\Body $body Please specify either a Card or Bank Account. (required)
9797
* @throws \CyberSource\ApiException on non-2xx response
98-
* @return \CyberSource\Model\TmsV1InstrumentidentifiersPost200Response
98+
* @return array of \CyberSource\Model\TmsV1InstrumentidentifiersPost200Response, HTTP status code, HTTP response headers (array of strings)
9999
*/
100100
public function tmsV1InstrumentidentifiersPost($profileId, $body)
101101
{

lib/Api/KeyGenerationApi.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public function setApiClient(\CyberSource\ApiClient $apiClient)
9494
*
9595
* @param \CyberSource\Model\GeneratePublicKeyRequest $generatePublicKeyRequest (optional)
9696
* @throws \CyberSource\ApiException on non-2xx response
97-
* @return \CyberSource\Model\FlexV1KeysPost200Response
97+
* @return array of \CyberSource\Model\FlexV1KeysPost200Response, HTTP status code, HTTP response headers (array of strings)
9898
*/
9999
public function generatePublicKey($generatePublicKeyRequest = null)
100100
{

0 commit comments

Comments
 (0)