Skip to content

Commit 331bd38

Browse files
OctopusDeploy release: 14.0.1
1 parent 9abe3a1 commit 331bd38

File tree

6 files changed

+88
-11
lines changed

6 files changed

+88
-11
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@
33
</a>
44

55
# Changelog
6-
## Latest Version v14.0.0 (11/06/25)
6+
## Latest Version v14.0.1 (11/13/25)
7+
### Enhancements:
8+
- [GPAPI] Added ContractReference field in Stored Credential
9+
10+
## v14.0.0 (11/06/25)
711
### Enhancements:
812
- [Rebrand] Replace Heartland branding with Global Payments
913

metadata.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
<xml>
2-
<releaseNumber>14.0.0</releaseNumber>
2+
<releaseNumber>14.0.1</releaseNumber>
33
</xml>

src/Builders/AuthorizationBuilder.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,14 @@ class AuthorizationBuilder extends TransactionBuilder
271271
*/
272272
public $invoiceNumber;
273273

274+
/**
275+
* Request contract reference
276+
*
277+
* @internal
278+
* @var string
279+
*/
280+
public $contractReference;
281+
274282
/**
275283
* Request should request Level II
276284
*

src/Builders/RequestBuilder/GpApi/GpApiAuthorizationRequestBuilder.php

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ private function generateVerificationRequest(AuthorizationBuilder $builder, GpAp
448448
$requestBody['country'] = $config->country;
449449
$requestBody['payment_method'] = $this->createPaymentMethodParam($builder, $config);
450450
if (!empty($builder->storedCredential)) {
451-
$this->setRequestStoredCredentials($builder->storedCredential, $requestBody);
451+
$this->setRequestStoredCredentials($builder->storedCredential, $requestBody, $builder);
452452
}
453453

454454
return $requestBody;
@@ -512,7 +512,7 @@ private function createFromAuthorizationBuilder($builder, GpApiConfig $config)
512512
$this->setNotificationUrls($requestBody);
513513
}
514514
if (!empty($builder->storedCredential)) {
515-
$this->setRequestStoredCredentials($builder->storedCredential, $requestBody);
515+
$this->setRequestStoredCredentials($builder->storedCredential, $requestBody, $builder, $config);
516516
}
517517

518518
if (!empty($builder->dccRateData)) {
@@ -528,7 +528,7 @@ private function createFromAuthorizationBuilder($builder, GpApiConfig $config)
528528
return $requestBody;
529529
}
530530

531-
private function setRequestStoredCredentials(StoredCredential $storedCredential, &$request)
531+
private function setRequestStoredCredentials(StoredCredential $storedCredential, &$request, $builder = null, $config = null)
532532
{
533533
$request['initiator'] = !empty($storedCredential->initiator) ?
534534
EnumMapping::mapStoredCredentialInitiator(GatewayProvider::GP_API, $storedCredential->initiator) : null;
@@ -537,11 +537,21 @@ private function setRequestStoredCredentials(StoredCredential $storedCredential,
537537
'reason' => !empty($storedCredential->reason) ? strtoupper((string) $storedCredential->reason) : null,
538538
'sequence' => !empty($storedCredential->sequence) ? strtoupper((string) $storedCredential->sequence) : null
539539
];
540+
541+
// Add contract reference if provided in StoredCredential and both currency is MXN and country is MX (Mexico)
542+
if (
543+
!empty($storedCredential->contract_reference)
544+
&& (!empty($builder->currency) && strtoupper($builder->currency) === 'MXN')
545+
&& (!empty($config->country) && strtoupper($config->country) === 'MX')
546+
) {
547+
$request['stored_credential']['contract_reference'] = $storedCredential->contract_reference;
548+
}
540549
}
541550

542551
/**
543552
* Sets the information related to the payer
544553
*
554+
*
545555
* @param AuthorizationBuilder $builder
546556
* @return mixed
547557
*/

src/Entities/StoredCredential.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,9 @@ class StoredCredential
2626
* @var string
2727
*/
2828
public $cardBrandTransactionId;
29+
30+
/**
31+
* @var string
32+
*/
33+
public $contract_reference;
2934
}

test/Integration/Gateways/GpApiConnector/GpApiInstallmentTest.php

Lines changed: 56 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -95,19 +95,20 @@ public function setup(): void
9595
$this->storeCredentials->type = StoredCredentialType::INSTALLMENT;
9696
$this->storeCredentials->sequence = StoredCredentialSequence::SUBSEQUENT;
9797
$this->storeCredentials->reason = StoredCredentialReason::INCREMENTAL;
98+
$this->storeCredentials->contract_reference = "testshraddha";
9899

99100
$this->visaCard = new CreditCardData();
100-
$this->visaCard->number = "4915669522406071";
101-
$this->visaCard->expMonth = 04;
102-
$this->visaCard->expYear = 2026;
103-
$this->visaCard->cvn = "123";
101+
$this->visaCard->number = "4395840190010011";
102+
$this->visaCard->expMonth = 12;
103+
$this->visaCard->expYear = 2027;
104+
$this->visaCard->cvn = "840";
104105
$this->visaCard->cardPresent = false;
105106
$this->visaCard->readerPresent = false;
106107

107108
$this->masterCard = new CreditCardData();
108-
$this->masterCard->number = "5579083004810368";
109+
$this->masterCard->number = "5120350100064537";
109110
$this->masterCard->expMonth = 12;
110-
$this->masterCard->expYear = 2026;
111+
$this->masterCard->expYear = 2027;
111112
$this->masterCard->cvn = "123";
112113
$this->masterCard->cardPresent = false;
113114
$this->masterCard->readerPresent = false;
@@ -274,6 +275,40 @@ public function testReportTransactionsDetailForInstallment()
274275
}
275276

276277
/** END Reporting Test Cases **/
278+
279+
/** START Contract Reference Test Cases **/
280+
281+
public function testContractReference_Visa_Sandbox()
282+
{
283+
ServicesContainer::configureService($this->setUpConfigSandbox());
284+
$response = $this->visaCard->charge($this->amount)
285+
->withCurrency($this->currency)
286+
->withAddress($this->address)
287+
->withInstallment($this->installment)
288+
->withStoredCredential($this->storeCredentials)
289+
->withAllowDuplicates(true)
290+
->execute();
291+
292+
$this->assertNotNull($response);
293+
$this->assertEquals('SUCCESS', $response->responseCode);
294+
}
295+
296+
public function testContractReference_MC_Sandbox()
297+
{
298+
ServicesContainer::configureService($this->setUpConfigSandbox());
299+
$response = $this->masterCard->charge($this->amount)
300+
->withCurrency($this->currency)
301+
->withAddress($this->address)
302+
->withInstallment($this->installment)
303+
->withStoredCredential($this->storeCredentials)
304+
->withAllowDuplicates(true)
305+
->execute();
306+
307+
$this->assertNotNull($response);
308+
$this->assertEquals('SUCCESS', $response->responseCode);
309+
}
310+
311+
/** END Contract Reference Test Cases **/
277312

278313
public function setUpConfig(): GpApiConfig
279314
{
@@ -291,4 +326,19 @@ public function setUpConfig(): GpApiConfig
291326
$config->requestLogger = new RequestConsoleLogger();
292327
return $config;
293328
}
329+
330+
public function setUpConfigSandbox(): GpApiConfig
331+
{
332+
$config = BaseGpApiTestConfig::gpApiSetupConfig(Channel::CardNotPresent);
333+
$config->country = 'MX';
334+
$config->appId = '4gPqnGBkppGYvoE5UX9EWQlotTxGUDbs';
335+
$config->appKey = 'FQyJA5VuEQfcji2M';
336+
$config->serviceUrl = 'https://apis.sandbox.globalpay.com/ucp';
337+
$config->accessTokenInfo = new AccessTokenInfo();
338+
$config->accessTokenInfo->riskAssessmentAccountName = 'transaction_processing';
339+
$config->accessTokenInfo->transactionProcessingAccountName = 'transaction_processing';
340+
341+
$config->requestLogger = new RequestConsoleLogger();
342+
return $config;
343+
}
294344
}

0 commit comments

Comments
 (0)