Skip to content

Commit

Permalink
OctopusDeploy release: 6.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
securesubmit-buildmaster committed Feb 14, 2023
1 parent 4738c30 commit 676658c
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 2 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,14 @@
# Changelog

## Latest Version
#### Enhancements:
- GP-API: BNPL unit tests update

## v6.1.1 (02/09/2023)
#### Bug Fixes:
- Portico Gateway: fix DigitalPaymentToken handling

## v6.0.6 (02/02/2023)
## v6.1.0 (02/02/2023)
#### Enhancements:
- GP-API: add risk assessment feature
- Refacto the Secure3DBuilder
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>6.1.1</releaseNumber>
<releaseNumber>6.1.2</releaseNumber>
</xml>
80 changes: 80 additions & 0 deletions test/Integration/Gateways/GpApiConnector/GpApiBNPLTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,46 @@ public function testBNPL_KlarnaProvider()
$this->assertEquals(TransactionStatus::CAPTURED, $captureTrn->responseMessage);
}

public function testBNPL_KlarnaProvider_Refund()
{
$this->paymentMethod->bnplType = BNPLType::KLARNA;
$customer = $this->setCustomerData();
$products = $this->setProductList();

$transaction = $this->paymentMethod->authorize(550)
->withCurrency($this->currency)
->withProductData($products)
->withAddress($this->shippingAddress, AddressType::SHIPPING)
->withAddress($this->billingAddress, AddressType::BILLING)
->withCustomerData($customer)
->execute();

$this->assertNotNull($transaction);
$this->assertEquals('SUCCESS', $transaction->responseCode);
$this->assertEquals(TransactionStatus::INITIATED, $transaction->responseMessage);
$this->assertNotNull($transaction->bnplResponse->redirectUrl);

fwrite(STDERR, print_r($transaction->bnplResponse->redirectUrl, TRUE));

sleep(45);

$captureTrn = $transaction->capture()->execute();

$this->assertNotNull($captureTrn);
$this->assertEquals('SUCCESS', $captureTrn->responseCode);
$this->assertEquals(TransactionStatus::CAPTURED, $captureTrn->responseMessage);

sleep(15);

$trnRefund = $captureTrn->refund(100)
->withCurrency($this->currency)
->execute();

$this->assertNotNull($trnRefund);
$this->assertEquals('SUCCESS', $trnRefund->responseCode);
$this->assertEquals(TransactionStatus::CAPTURED, $trnRefund->responseMessage);
}

public function testBNPL_ClearPayProvider()
{
$this->paymentMethod->bnplType = BNPLType::CLEARPAY;
Expand Down Expand Up @@ -403,6 +443,46 @@ public function testBNPL_ClearPayProvider_MultipleCapture()
$this->assertEquals(TransactionStatus::CAPTURED, $captureTrn->responseMessage);
}

public function testBNPL_ClearPayProvider_Refund()
{
$this->paymentMethod->bnplType = BNPLType::CLEARPAY;
$customer = $this->setCustomerData();
$products = $this->setProductList();

$transaction = $this->paymentMethod->authorize(550)
->withCurrency($this->currency)
->withProductData($products)
->withAddress($this->shippingAddress, AddressType::SHIPPING)
->withAddress($this->billingAddress, AddressType::BILLING)
->withCustomerData($customer)
->execute();

$this->assertNotNull($transaction);
$this->assertEquals('SUCCESS', $transaction->responseCode);
$this->assertEquals(TransactionStatus::INITIATED, $transaction->responseMessage);
$this->assertNotNull($transaction->bnplResponse->redirectUrl);

fwrite(STDERR, print_r($transaction->bnplResponse->redirectUrl, TRUE));

sleep(45);

$captureTrn = $transaction->capture()->execute();

$this->assertNotNull($captureTrn);
$this->assertEquals('SUCCESS', $captureTrn->responseCode);
$this->assertEquals(TransactionStatus::CAPTURED, $captureTrn->responseMessage);

sleep(15);

$trnRefund = $captureTrn->refund(550)
->withCurrency($this->currency)
->execute();

$this->assertNotNull($trnRefund);
$this->assertEquals('SUCCESS', $trnRefund->responseCode);
$this->assertEquals(TransactionStatus::CAPTURED, $trnRefund->responseMessage);
}

public function testBNPL_InvalidStatusForCapture_NoRedirect()
{
$customer = $this->setCustomerData();
Expand Down

0 comments on commit 676658c

Please sign in to comment.