From f15c764dd38d6b02c8824d2f6b35abff995353eb Mon Sep 17 00:00:00 2001 From: securesubmit-buildmaster Date: Thu, 8 Oct 2020 08:50:49 -0400 Subject: [PATCH] 20201008 deployment --- .../Gateways/PorticoConnector/CreditTest.php | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/test/Integration/Gateways/PorticoConnector/CreditTest.php b/test/Integration/Gateways/PorticoConnector/CreditTest.php index b0ffd081..a9082ad5 100644 --- a/test/Integration/Gateways/PorticoConnector/CreditTest.php +++ b/test/Integration/Gateways/PorticoConnector/CreditTest.php @@ -10,6 +10,7 @@ use GlobalPayments\Api\ServicesContainer; use PHPUnit\Framework\TestCase; use GlobalPayments\Api\Entities\Enums\StoredCredentialInitiator; +use GlobalPayments\Api\Entities\Transaction; class CreditTest extends TestCase { @@ -339,4 +340,25 @@ public function testCreditAuthorizationWithCOF() $this->assertNotNull($captureResponse); $this->assertEquals('00', $captureResponse->responseCode); } + + public function testCreditReverseViaClientTxnId() + { + $clientTxnId = time(); + + $authorization = $this->card->charge(420.69) + ->withClientTransactionId($clientTxnId) + ->withCurrency('USD') + ->withAllowDuplicates(true) + ->execute(); + + $this->assertNotNull($authorization); + $this->assertEquals('00', $authorization->responseCode); + + $reverse = Transaction::fromClientTransactionId($clientTxnId) + ->reverse(420.69) + ->execute(); + + $this->assertNotNull($reverse); + $this->assertEquals('00', $reverse->responseCode); + } }