Skip to content

Commit

Permalink
OctopusDeploy release: 9.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
securesubmit-buildmaster committed Aug 10, 2023
1 parent 93a93aa commit 666e7ce
Show file tree
Hide file tree
Showing 10 changed files with 149 additions and 137 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@

## Latest Version
#### Enhancements:
- [GP-API] Improve Open Banking and 3DS tests

#### Bug Fixes:
-[PAX Devices]: Fix PAX controller

## v9.0.1 (07/11/2023)
#### Enhancements:
- Add appsec.properties for Macroscope

## v9.0.0 (07/06/2023)
Expand Down
2 changes: 1 addition & 1 deletion metadata.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<xml>
<releaseNumber>9.0.1</releaseNumber>
<releaseNumber>9.0.2</releaseNumber>
</xml>
50 changes: 13 additions & 37 deletions src/Entities/BankPaymentResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,48 +11,24 @@ class BankPaymentResponse
{
/**
* The open banking transaction id
* @var string
*/
public $id;

public string $id;
/**
* URL to redirect the customer to
* Sent there so merchant can redirect consumer to complete the payment.
*
* @var string
*/
public $redirectUrl;

/** @var string */
public $paymentStatus;

public ?string $redirectUrl;
public ?string $paymentStatus;
/** @var BankPaymentType */
public $type;

/** @var string */
public $tokenRequestId;

/** @var string */
public $sortCode;

/** @var string */
public $accountName;

/** @var string */
public $accountNumber;

/** @var string */
public $iban;

/** @var string */
public $remittanceReferenceValue;

/** @var string */
public $remittanceReferenceType;

/** @var float */
public $amount;

/** @var string */
public $currency;
public ?string $tokenRequestId;
public ?string $sortCode;
public ?string $accountName;
public ?string $accountNumber;
public ?string $iban;
public ?string $remittanceReferenceValue;
public ?string $remittanceReferenceType;
public ?float $amount;
public ?string $currency;
public ?string $maskedIbanLast4;
}
2 changes: 2 additions & 0 deletions src/Mapping/GpApiMapping.php
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,7 @@ public static function mapTransactionSummary($response)
$summary->paymentType = PaymentMethodName::BANK_PAYMENT;
$bankPaymentResponse = new BankPaymentResponse();
$bankPaymentResponse->iban = $response->payment_method->bank_transfer->iban ?? null;
$bankPaymentResponse->maskedIbanLast4 = $response->payment_method->bank_transfer->masked_iban_last4 ?? null;
$bankPaymentResponse->accountNumber = $response->payment_method->bank_transfer->account_number ?? null;
$bankPaymentResponse->accountName = $response->payment_method->bank_transfer->bank->name ?? null;
$bankPaymentResponse->sortCode = $response->payment_method->bank_transfer->bank->code ?? null;
Expand All @@ -487,6 +488,7 @@ public static function mapTransactionSummary($response)
$bankPaymentResponse->remittanceReferenceType =
$response->payment_method->bank_transfer->remittance_reference->type ?? null;
$summary->bankPaymentResponse = $bankPaymentResponse;
$summary->accountNumberLast4 = $response->payment_method->bank_transfer->masked_account_number_last4 ?? null;
} else { /** map APMs (Paypal) response info */
$apm = $response->payment_method->apm;
$alternativePaymentResponse = new AlternativePaymentResponse();
Expand Down
2 changes: 1 addition & 1 deletion src/Mapping/OpenBankingMapping.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public static function mapResponse($response)
$obResponse = new BankPaymentResponse();
$obResponse->redirectUrl = $response->redirect_url ?? null;
$obResponse->paymentStatus = $response->status ?? null;
$obResponse->id = $response->ob_trans_id ?? null;
$obResponse->id = $response->ob_trans_id;
$obResponse->amount = $response->order->amount ?? null;
$obResponse->currency = $response->order->currency ?? null;
$transaction->bankPaymentResponse = $obResponse;
Expand Down
6 changes: 6 additions & 0 deletions src/Terminals/PAX/PaxController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace GlobalPayments\Api\Terminals\PAX;

use GlobalPayments\Api\Terminals\Abstractions\IDeviceCommInterface;
use GlobalPayments\Api\Terminals\Builders\TerminalAuthBuilder;
use GlobalPayments\Api\Terminals\Builders\TerminalManageBuilder;
use GlobalPayments\Api\Terminals\Builders\TerminalReportBuilder;
Expand Down Expand Up @@ -440,4 +441,9 @@ private function doEBT($transactionType, $amounts, $accounts, $trace, $cashier,
$response = $this->doTransaction($commands);
return new EBTResponse($response);
}

public function configureConnector(): IDeviceCommInterface
{
// TODO: Implement configureConnector() method.
}
}
1 change: 0 additions & 1 deletion src/Terminals/PAX/Responses/PaxBaseResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ public function __construct($rawResponse, $messageId)

public function parseResponse($messageReader)
{
$code = $messageReader->readCode();
$this->status = $messageReader->readToCode(ControlCodes::FS);
$this->command = $messageReader->readToCode(ControlCodes::FS);
$this->version = $messageReader->readToCode(ControlCodes::FS);
Expand Down
16 changes: 16 additions & 0 deletions test/Integration/Gateways/GpApiConnector/GpApi3DSecureTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,14 @@ public function testFrictionlessFullCycle_v2($cardNumber, $status)
$this->assertEquals($status, $secureEcom->status);
$this->assertEquals('YES', $secureEcom->liabilityShift);

$response = $this->card->verify()
->withCurrency($this->currency)
->execute();

$this->assertNotNull($response);
$this->assertEquals('SUCCESS', $response->responseCode);
$this->assertEquals('VERIFIED', $response->responseMessage);

$response = $this->card->charge($this->amount)->withCurrency($this->currency)->execute();
$this->assertNotNull($response);
$this->assertEquals('SUCCESS', $response->responseCode);
Expand Down Expand Up @@ -377,6 +385,14 @@ public function testFullCycle_WithCardTokenization_v2()
$this->assertEquals('YES', $secureEcom->liabilityShift);

$tokenizedCard->threeDSecure = $secureEcom;

$response = $tokenizedCard->verify()
->withCurrency($this->currency)
->execute();
$this->assertNotNull($response);
$this->assertEquals('SUCCESS', $response->responseCode);
$this->assertEquals('VERIFIED', $response->responseMessage);

$response = $tokenizedCard->charge($this->amount)->withCurrency($this->currency)->execute();
$this->assertNotNull($response);
$this->assertEquals('SUCCESS', $response->responseCode);
Expand Down
32 changes: 13 additions & 19 deletions test/Integration/Gateways/GpApiConnector/GpApiOpenBankingTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@

class GpApiOpenBankingTest extends TestCase
{
private $currency = 'GBP';
private $amount = 10.99;
private $startDate;
private $endDate;
private string $currency = 'GBP';
private float $amount = 10.99;
private \DateTime $startDate;
private \DateTime $endDate;

public function setup(): void
{
Expand Down Expand Up @@ -86,8 +86,6 @@ public function testFasterPaymentsCharge()
->execute();

$this->assertOpenBankingResponse($trn);

fwrite(STDERR, print_r($trn->bankPaymentResponse->redirectUrl, true));
sleep(2);

/** @var TransactionSummary $response */
Expand All @@ -98,7 +96,7 @@ public function testFasterPaymentsCharge()
$this->assertEquals($trn->transactionId, $response->transactionId);
$this->assertNotNull($response->bankPaymentResponse->sortCode);
$this->assertNull($response->bankPaymentResponse->iban);
$this->assertNotNull($response->bankPaymentResponse->accountNumber);
$this->assertEquals(substr($bankPayment->accountNumber, -4), substr($response->accountNumberLast4,-4));
}

public function testSEPACharge()
Expand All @@ -111,15 +109,18 @@ public function testSEPACharge()
->execute();

$this->assertOpenBankingResponse($trn);
fwrite(STDERR, print_r($trn->bankPaymentResponse->redirectUrl, TRUE));
sleep(2);

/** @var TransactionSummary $response */
$response = ReportingService::transactionDetail($trn->transactionId)
->execute();

$this->assertNotNull($response);
$this->assertEquals($trn->transactionId, $response->transactionId);
$this->assertNotNull($response->bankPaymentResponse->iban);
$this->assertEquals(
substr($bankPayment->iban, -4),
substr($response->bankPaymentResponse->maskedIbanLast4, -4)
);
$this->assertNull($response->bankPaymentResponse->sortCode);
$this->assertNull($response->bankPaymentResponse->accountNumber);
}
Expand Down Expand Up @@ -214,19 +215,12 @@ public function testFasterPaymentsMissingRemittanceReferenceType()
{
$bankPayment = $this->fasterPaymentsConfig();

$errorFound = false;
try {
$bankPayment->charge($this->amount)
$trn = $bankPayment->charge($this->amount)
->withCurrency($this->currency)
->withRemittanceReference(null, 'Nike Bounce Shoes')
->execute();
} catch (GatewayException $e) {
$errorFound = true;
$this->assertEquals('Status Code: SYSTEM_ERROR_DOWNSTREAM - Unable to process your request due to an error with a system down stream.', $e->getMessage());
$this->assertEquals('50046', $e->responseCode);
} finally {
$this->assertTrue($errorFound);
}

$this->assertOpenBankingResponse($trn);
}

public function testFasterPaymentsMissingRemittanceReferenceValue()
Expand Down
Loading

0 comments on commit 666e7ce

Please sign in to comment.