Skip to content

Commit

Permalink
Removed unused files. (#76)
Browse files Browse the repository at this point in the history
* Removed unused files.

* Removed unused files.
  • Loading branch information
tikohov20 authored May 24, 2023
1 parent 4b449b4 commit 06be0f8
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 293 deletions.
83 changes: 0 additions & 83 deletions Gateway/Http/Client/ClientMock.php

This file was deleted.

29 changes: 0 additions & 29 deletions Gateway/Http/TransferFactory.php

This file was deleted.

50 changes: 0 additions & 50 deletions Gateway/Request/AuthorizationRequest.php

This file was deleted.

32 changes: 0 additions & 32 deletions Gateway/Request/MockDataRequest.php

This file was deleted.

38 changes: 0 additions & 38 deletions Gateway/Response/FraudHandler.php

This file was deleted.

29 changes: 0 additions & 29 deletions Gateway/Response/TxnIdHandler.php

This file was deleted.

22 changes: 12 additions & 10 deletions Model/Request/Transactions.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ public function __construct(
public function request($_params = []): array
{
try {
if(@$_params['email']) {
if (@$_params['email']) {
$this->fallbackEmail = $_params['email'];
}
$params = $this->getRequestParams();

if($_params['payment_method'] === 'direct_debit' || $_params['payment_method'] === 'installment') {
if ($_params['payment_method'] === 'direct_debit' || $_params['payment_method'] === 'installment') {
$params['payment_method'] = $_params['payment_method'];
}

Expand All @@ -62,7 +62,7 @@ public function request($_params = []): array
$data = json_decode($result, true);
$this->_checkoutSession->setMonduid(@$data['order']['uuid']);

if(!@$data['order']['uuid']) {
if (!@$data['order']['uuid']) {
return [
'error' => 1,
'body' => json_decode($result, true),
Expand All @@ -75,7 +75,7 @@ public function request($_params = []): array
'message' => __('Success')
];
}
} catch(\Exception $e) {
} catch (\Exception $e) {
return [
'error' => 1,
'body' => null,
Expand All @@ -84,7 +84,8 @@ public function request($_params = []): array
}
}

protected function getRequestParams() {
protected function getRequestParams()
{
$quote = $this->_checkoutSession->getQuote();
$quote->collectTotals();
$requiresShipping = $quote->getShippingAddress() !== null ? 1 : 0;
Expand Down Expand Up @@ -129,7 +130,7 @@ private function getBillingAddressParams(Quote $quote): array
if (($billing = $quote->getBillingAddress()) !== null) {
$address = (array) $billing->getStreet();
$line1 = (string) array_shift($address);
if($billing->getStreetNumber()) {
if ($billing->getStreetNumber()) {
$line1 .= ', '. $billing->getStreetNumber();
}
$line2 = (string) implode(' ', $address);
Expand All @@ -140,7 +141,7 @@ private function getBillingAddressParams(Quote $quote): array
'address_line1' => $line1,
'address_line2' => $line2,
];
if($billing->getRegion()) {
if ($billing->getRegion()) {
$params['state'] = (string) $billing->getRegion();
}
}
Expand All @@ -155,7 +156,7 @@ private function getShippingAddressParams(Quote $quote): array
if (($shipping = $quote->getShippingAddress()) !== null) {
$address = (array) $shipping->getStreet();
$line1 = (string) array_shift($address);
if($shipping->getStreetNumber()) {
if ($shipping->getStreetNumber()) {
$line1 .= ', '. $shipping->getStreetNumber();
}
$line2 = (string) implode(' ', $address);
Expand All @@ -167,7 +168,7 @@ private function getShippingAddressParams(Quote $quote): array
'address_line2' => $line2,
];

if($shipping->getRegion()) {
if ($shipping->getRegion()) {
$params['state'] = (string) $shipping->getRegion();
}
}
Expand All @@ -180,7 +181,8 @@ private function getShippingAddressParams(Quote $quote): array
* @return mixed|string|null
* @throws \Exception
*/
public function getExternalReferenceId(Quote $quote) {
public function getExternalReferenceId(Quote $quote)
{
$reservedOrderId = $quote->getReservedOrderId();
if (!$reservedOrderId) {
$quote->reserveOrderId()->save();
Expand Down
4 changes: 0 additions & 4 deletions Model/Ui/ConfigProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,6 @@ public function getConfig()
'payment' => [
self::CODE => [
'sdkUrl' => $this->getSdkUrl(),
'transactionResults' => [
ClientMock::SUCCESS => __('Success'),
ClientMock::FAILURE => __('Fraud'),
],
'monduCheckoutTokenUrl' => $this->urlBuilder->getUrl('mondu/payment_checkout/token'),
'description' => $descriptionMondu,
'title' => __($this->scopeConfig->getValue('payment/mondu/title', ScopeInterface::SCOPE_STORE))
Expand Down
Loading

0 comments on commit 06be0f8

Please sign in to comment.