Skip to content

Commit

Permalink
CC-730 : Rename class
Browse files Browse the repository at this point in the history
  • Loading branch information
m-xhixha committed Mar 4, 2024
1 parent dae1e14 commit 98b7ecb
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use UnzerSDK\Traits\CanAuthorize;
use UnzerSDK\Traits\CanDirectCharge;

class ClickToPay extends BasePaymentType
class Clicktopay extends BasePaymentType
{

use CanDirectCharge;
Expand All @@ -32,11 +32,6 @@ public function __construct(
$this->brand = $brand;
}

public static function getResourceName(): string
{
return 'clicktopay';
}


public function getMcCorrelationId() : ?string
{
Expand Down
4 changes: 2 additions & 2 deletions src/Services/ResourceService.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
use UnzerSDK\Exceptions\UnzerApiException;
use UnzerSDK\Resources\Config;
use UnzerSDK\Resources\PaymentTypes\Applepay;
use UnzerSDK\Resources\PaymentTypes\ClickToPay;
use UnzerSDK\Resources\PaymentTypes\Clicktopay;
use UnzerSDK\Resources\PaymentTypes\Googlepay;
use UnzerSDK\Resources\PaymentTypes\Klarna;
use UnzerSDK\Resources\PaymentTypes\PaylaterDirectDebit;
Expand Down Expand Up @@ -826,7 +826,7 @@ public static function getTypeInstanceFromIdString($typeId): BasePaymentType
$paymentType = new Googlepay();
break;
case IdStrings::CLICK_TO_PAY:
$paymentType = new ClickToPay();
$paymentType = new Clicktopay();
break;
case IdStrings::HIRE_PURCHASE_DIRECT_DEBIT:
case IdStrings::INSTALLMENT_SECURED:
Expand Down
16 changes: 8 additions & 8 deletions test/integration/PaymentTypes/ClickToPayTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use UnzerSDK\Resources\EmbeddedResources\CardTransactionData;
use UnzerSDK\Resources\Payment;
use UnzerSDK\Resources\PaymentTypes\BasePaymentType;
use UnzerSDK\Resources\PaymentTypes\ClickToPay;
use UnzerSDK\Resources\PaymentTypes\Clicktopay;
use UnzerSDK\Resources\TransactionTypes\Authorization;
use UnzerSDK\Resources\TransactionTypes\Charge;
use UnzerSDK\test\BaseIntegrationTest;
Expand All @@ -34,7 +34,7 @@ public function clickToPayShouldBeCreatable(): BasePaymentType

$this->unzer->createPaymentType($clickToPay);

$this->assertInstanceOf(ClickToPay::class, $clickToPay);
$this->assertInstanceOf(Clicktopay::class, $clickToPay);
$this->assertNotNull($clickToPay->getId());
$this->assertSame($this->unzer, $clickToPay->getUnzerObject());

Expand All @@ -58,7 +58,7 @@ public function googlepayCanBeFetched($type): void
{
$this->assertNotNull($type->getId());

/** @var ClickToPay $fetchedClickToPay */
/** @var Clicktopay $fetchedClickToPay */
$fetchedClickToPay = $this->unzer->fetchPaymentType($type->getId());
$this->assertNotNull($fetchedClickToPay->getId());
}
Expand Down Expand Up @@ -181,7 +181,7 @@ public function canPerformCharge($type): void
public function partialChargeAfterAuthorization(): void
{
$clickToPay = $this->createClickToPayObject();
/** @var ClickToPay $clickToPay */
/** @var Clicktopay $clickToPay */
$clickToPay = $this->unzer->createPaymentType($clickToPay);
$authorization = $this->getUnzerObject()
->performAuthorization(
Expand Down Expand Up @@ -217,7 +217,7 @@ public function partialChargeAfterAuthorization(): void
public function exceptionShouldBeThrownWhenChargingMoreThenAuthorized(): void
{
$clickToPay = $this->createClickToPayObject();
/** @var ClickToPay $clickToPay */
/** @var Clicktopay $clickToPay */
$clickToPay = $this->unzer->createPaymentType($clickToPay);
$authorization = $this->getUnzerObject()
->performAuthorization(
Expand All @@ -244,7 +244,7 @@ public function exceptionShouldBeThrownWhenChargingMoreThenAuthorized(): void
public function fullCancelAfterCharge(): void
{
$clickToPay = $this->createClickToPayObject();
/** @var ClickToPay $clickToPay */
/** @var Clicktopay $clickToPay */
$clickToPay = $this->unzer->createPaymentType($clickToPay);
$charge = $this->getUnzerObject()
->performCharge(
Expand Down Expand Up @@ -286,9 +286,9 @@ protected function getLvpChargeObject()
}


protected function createClickToPayObject(): ClickToPay
protected function createClickToPayObject(): Clicktopay
{
$clickToPay = (new ClickToPay());
$clickToPay = (new Clicktopay());
$this->assertNull($clickToPay->getId());

$geoLocation = $clickToPay->getGeoLocation();
Expand Down
8 changes: 4 additions & 4 deletions test/unit/Resources/PaymentTypes/ClickToPayTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace UnzerSDK\test\unit\Resources\PaymentTypes;

use UnzerSDK\Resources\PaymentTypes\ClickToPay;
use UnzerSDK\Resources\PaymentTypes\Clicktopay;
use UnzerSDK\Resources\PaymentTypes\Googlepay;
use UnzerSDK\test\BasePaymentTest;
use UnzerSDK\test\Fixtures\JsonProvider;
Expand All @@ -22,7 +22,7 @@ public function constructorShouldSetParameters(): void
$mcCxFlowId = '34f4a04b.5ab95e32-30f7-483f-846f-a08230a6d2ed.1618397078';
$mcMerchantTransactionId = "0a4e0d3.34f4a04b.894125b16ddd1f1b3a58273d63a0894179ac3535";

$clickToPay = new ClickToPay($correlationId, $mcCxFlowId, $mcMerchantTransactionId, $brand);
$clickToPay = new Clicktopay($correlationId, $mcCxFlowId, $mcMerchantTransactionId, $brand);


$this->assertEquals($correlationId, $clickToPay->getMcCorrelationId());
Expand All @@ -38,7 +38,7 @@ public function constructorShouldSetParameters(): void
*/
public function jsonSerialization(): void
{
$clickToPayObject = new ClickToPay("corr12345",
$clickToPayObject = new Clicktopay("corr12345",
"34f4a04b.5ab95e32-30f7-483f-846f-a08230a6d2ed.1618397078",
"0a4e0d3.34f4a04b.894125b16ddd1f1b3a58273d63a0894179ac3535",
"mastercard"
Expand All @@ -55,7 +55,7 @@ public function jsonSerialization(): void
*/
public function clickToPayAuthorizationShouldBeMappedCorrectly(): void
{
$clickToPay = new ClickToPay(null, null, null, null);
$clickToPay = new Clicktopay(null, null, null, null);

$jsonResponse = JsonProvider::getJsonFromFile('clicktopay/fetchResponse.json');

Expand Down

0 comments on commit 98b7ecb

Please sign in to comment.