Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dx 206 #40

Merged
merged 62 commits into from
Feb 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
3a474c9
Remove PHP 7.0 support
s4ddly Jan 5, 2024
22abed7
Fix api code (#39)
krzGablo Jan 5, 2024
692db32
GenericOnSite (#41)
s4ddly Jan 8, 2024
519f55b
cards_view
krzGablo Jan 8, 2024
7b7a5f6
Cleanup and fixes
s4ddly Jan 8, 2024
a619dff
SCA Related Changes
s4ddly Jan 8, 2024
f520e6b
Fix card payment method
s4ddly Jan 8, 2024
951ea92
Card logo
krzGablo Jan 9, 2024
acb1763
Card update
krzGablo Jan 10, 2024
c38730d
CS fixes and improvements
s4ddly Jan 10, 2024
b16636b
CS fixes and improvements
s4ddly Jan 10, 2024
1d1fa7b
Config fix
krzGablo Jan 11, 2024
bf2c11c
Authorize OpenApi on creation
s4ddly Jan 11, 2024
de7bf9d
Authorization
krzGablo Jan 11, 2024
8c2af33
Fix Open API configuration
s4ddly Jan 11, 2024
d7250a8
Fix card saving
s4ddly Jan 11, 2024
8e30bc0
Agreements
krzGablo Jan 12, 2024
3be9b4b
Payment limit
krzGablo Jan 12, 2024
f2a25ad
Payment limit fix
krzGablo Jan 12, 2024
9657785
Payment limit fix
krzGablo Jan 12, 2024
1684c1f
Config grouped
Jan 12, 2024
3463250
Fix config groups
krzGablo Jan 15, 2024
3c6ad08
Fix config groups
krzGablo Jan 15, 2024
9bc7c60
Fix blik lvl 0
s4ddly Jan 15, 2024
89e85d5
Constraints validation
s4ddly Jan 15, 2024
146b7fa
Fix agreements accept button disablement
s4ddly Jan 15, 2024
dd7e542
Add card group
krzGablo Jan 16, 2024
213e571
Add card group
krzGablo Jan 16, 2024
9a8bf91
Fix generic icon
krzGablo Jan 16, 2024
7e9cd37
Terms fix
krzGablo Jan 17, 2024
fcb2ff1
Blik fix
krzGablo Jan 17, 2024
a8c9531
Blik fix
krzGablo Jan 17, 2024
75f5e91
Blik fix
krzGablo Jan 17, 2024
41ad80d
Blik fix
krzGablo Jan 17, 2024
e965f34
Form fix
krzGablo Jan 19, 2024
f5d6a40
Multistore notification fix
krzGablo Jan 19, 2024
00a607b
Multistore notification fix
krzGablo Jan 19, 2024
3f99e21
Multistore notification fix
krzGablo Jan 19, 2024
4354100
Translation
krzGablo Jan 19, 2024
aeccf57
Blik zero
krzGablo Jan 19, 2024
b1a9899
Translation fix
krzGablo Jan 19, 2024
c88d1ec
Direct fix
krzGablo Jan 22, 2024
4e101f0
Direct fix
krzGablo Jan 22, 2024
0cb50d0
Blik zero fix
krzGablo Jan 22, 2024
e5ae8b6
Cosmetic changes
krzGablo Jan 23, 2024
73e84fa
Versions
Jan 23, 2024
a320f84
Version fix
krzGablo Jan 23, 2024
c5eeea4
Version fix
krzGablo Jan 23, 2024
891f480
Version fix
krzGablo Jan 23, 2024
ced024e
Version fix
krzGablo Jan 23, 2024
1773509
Version fix
krzGablo Jan 23, 2024
35e1541
Blik fix
krzGablo Jan 23, 2024
300a2aa
Sandbox fix
krzGablo Jan 23, 2024
e69d061
Sandbox blik fix
krzGablo Jan 23, 2024
35e47e4
Sandbox blik fix
krzGablo Jan 23, 2024
9417490
Sandbox blik fix
krzGablo Jan 23, 2024
bbe2c37
Rsa fix
krzGablo Jan 23, 2024
88992a0
Translation fix
krzGablo Jan 23, 2024
5e24e83
Disable card save
krzGablo Jan 23, 2024
9c2d455
Card save fix
krzGablo Jan 24, 2024
cc903bd
Card save fix
krzGablo Jan 24, 2024
7e19d13
Name fix
krzGablo Jan 24, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions .dev-tools/.php-cs-fixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,11 @@

require __DIR__.'/vendor/tpay-com/coding-standards/bootstrap.php';

$config = Tpay\CodingStandards\PhpCsFixerConfigFactory::createWithLegacyRules()
$config = Tpay\CodingStandards\PhpCsFixerConfigFactory::createWithNonRiskyRules()
->setFinder(
PhpCsFixer\Finder::create()
->ignoreDotFiles(false)
->in(__DIR__.'/..')
);

$rules = $config->getRules();

$rules['nullable_type_declaration_for_default_null_value'] = false;

return $config->setRules($rules);
return $config;
9 changes: 8 additions & 1 deletion .dev-tools/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"php-cs-fixer/shim": "^3.23",
"phpstan/phpstan": "^1.10.30",
"tpay-com/coding-standards": "^1.0.1",
"tpay-com/tpay-openapi-php": "^1.3",
"tpay-com/tpay-php": "^2.3.4",
"vimeo/psalm": "^5.15.0"
},
Expand All @@ -15,12 +16,18 @@
"url": "https://github.com/magento/magento2.git"
}
],
"scripts": {
"cs:fixer": "./vendor/bin/php-cs-fixer fix -vvv --diff",
"cs:phpstan": "./vendor/bin/phpstan",
"cs:psalm": "./vendor/bin/psalm"
},
"config": {
"allow-plugins": {
"ergebnis/composer-normalize": true,
"kubawerlos/composer-smaller-lock": true,
"magento/composer-dependency-version-audit-plugin": false,
"magento/magento-composer-installer": false
"magento/magento-composer-installer": false,
"php-http/discovery": false
}
}
}
1,384 changes: 782 additions & 602 deletions .dev-tools/composer.lock

Large diffs are not rendered by default.

6 changes: 0 additions & 6 deletions .dev-tools/phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,4 @@ parameters:
paths:
- ../
excludePaths:
- ../Controller/tpay/Notification.php
- ../vendor/
ignoreErrors:
- '#^Call to an undefined method tpaycom\\magento2basic\\Controller\\Tpaycom::getFormatAmount\(\)\.$#'
- '# invalid type Magento\\Sales\\Model\\OrderFactory\.$#'
- '# invalid type tpaycom\\magento2basic\\Model\\TransactionModelFactory\.$#'
- '# return statement is missing\.$#'
1 change: 0 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ jobs:
fail-fast: false
matrix:
include:
- php-version: '7.0'
- php-version: '7.1'
- php-version: '7.2'
- php-version: '7.3'
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/sca.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ jobs:
run: composer normalize --diff --dry-run --indent-size=4 --indent-style=space ../composer.json

- working-directory: .dev-tools
run: ./vendor/bin/php-cs-fixer fix -vvv --diff --dry-run
run: composer cs:fixer -- --dry-run

- working-directory: .dev-tools
run: ./vendor/bin/phpstan
run: composer cs:phpstan

- working-directory: .dev-tools
run: ./vendor/bin/psalm --no-progress --shepherd
run: composer cs:psalm -- --no-progress --shepherd
12 changes: 4 additions & 8 deletions Api/Sales/OrderRepositoryInterface.php
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
<?php

declare(strict_types=1);

namespace tpaycom\magento2basic\Api\Sales;

use Magento\Sales\Api\OrderRepositoryInterface as MagentoOrderRepositoryInterface;

interface OrderRepositoryInterface extends MagentoOrderRepositoryInterface
{
/**
* Return new instance of Order by increment ID
*
* @param string $incrementId
*
* @return \Magento\Sales\Api\Data\OrderInterface
*/
public function getByIncrementId($incrementId);
/** Return new instance of Order by increment ID */
public function getByIncrementId(string $incrementId): \Magento\Sales\Api\Data\OrderInterface;
}
179 changes: 89 additions & 90 deletions Api/TpayInterface.php
Original file line number Diff line number Diff line change
@@ -1,100 +1,99 @@
<?php

declare(strict_types=1);

namespace tpaycom\magento2basic\Api;

/**
* @api
*/
interface TpayInterface
{
const CODE = 'tpaycom_magento2basic';
const CHANNEL = 'group';
const BLIK_CODE = 'blik_code';
const TERMS_ACCEPT = 'accept_tos';

/**
* Return string for redirection
*
* @return string
*/
public function getRedirectURL();

/**
* Return data for form
*
* @param null|int $orderId
*
* @return array
*/
public function getTpayFormData($orderId = null);

/** @return string */
public function getApiPassword();

/** @return string */
public function getApiKey();

/** @return string */
public function getSecurityCode();

/** @return int */
public function getMerchantId();

/**
* Check that the BLIK Level 0 should be active on a payment channels list
*
* @return bool
*/
public function checkBlikLevel0Settings();

/** @return bool */
public function getBlikLevelZeroStatus();

/** @return bool */
public function onlyOnlineChannels();

/** @return bool */
public function redirectToChannel();

/**
* Return url to redirect after placed order
*
* @return string
*/
public function getPaymentRedirectUrl();

/**
* Return url for a tpay.com terms
*
* @return string
*/
public function getTermsURL();

/**
* Check if send an email about the new invoice to customer
*
* @return string
*/
public function getInvoiceSendMail();

/**
* Check if Tpay notification server IP is forwarded by proxy
*
* @return bool
*/
public function getCheckProxy();

/**
* Check Tpay notification server IP
*
* @return bool
*/
public function getCheckTpayIP();

/**
* Check if checkout amount is in range of installments payment channel
*
* @return bool
*/
public function getInstallmentsAmountValid();
public const CODE = 'tpaycom_magento2basic';
public const GROUP = 'group';
public const CHANNEL = 'channel';
public const BLIK_CODE = 'blik_code';
public const TERMS_ACCEPT = 'accept_tos';
public const CARDDATA = 'card_data';
public const CARD_SAVE = 'card_save';
public const CARD_ID = 'card_id';
public const CARD_VENDOR = 'card_vendor';
public const SHORT_CODE = 'short_code';

/** Return string for redirection */
public function getRedirectURL(): string;

/** Return data for form */
public function getTpayFormData(?string $orderId = null): array;

public function getCardTitle(): ?string;

public function isOriginApiEnabled(): bool;

public function isOpenApiEnabled(): bool;

public function isCardEnabled(): bool;

public function isOriginApiCardUse(): bool;

public function getApiPassword(): ?string;

public function getOpenApiPassword(): ?string;

public function getApiKey(): ?string;

public function getSecurityCode(?int $storeId = null): ?string;

public function getOpenApiClientId(): ?string;

public function getMerchantId(): ?int;

/** Check that the BLIK Level 0 should be active on a payment channels list */
public function checkBlikLevel0Settings(): bool;

public function getBlikLevelZeroStatus(): bool;

public function onlyOnlineChannels(): bool;

public function redirectToChannel(): bool;

/** Return url to redirect after placed order */
public function getPaymentRedirectUrl(): string;

/** Return url for a tpay.com terms */
public function getTermsURL(): string;

/** Check if send an email about the new invoice to customer */
public function getInvoiceSendMail(): string;

public function useSandboxMode(?int $storeId = null): bool;

/** Check if checkout amount is in range of installments payment channel */
public function getInstallmentsAmountValid(): bool;

public function getCardApiKey(): ?string;

public function getCardApiPassword(): ?string;

public function getCardSaveEnabled(): bool;

public function getCheckoutCustomerId(): ?string;

public function getRSAKey(): ?string;

public function isCustomerLoggedIn(): bool;

public function getHashType(): ?string;

public function getVerificationCode(): ?string;

public function isAllowSpecific(): bool;

public function getSpecificCountry(): array;

/** @param string $orderId */
public function getCustomerId($orderId);

/** @param string $orderId */
public function isCustomerGuest($orderId);
}
60 changes: 0 additions & 60 deletions Controller/Tpaycom.php

This file was deleted.

Loading