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

Release 2.4.0 #304

Merged
merged 26 commits into from
Jan 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
c29b37c
chore: add develop tag to module core (#277)
mateus-picoloto Nov 23, 2023
7b08e32
:bug: changes the function to check the size correctly
phaelfp Oct 30, 2023
8d29919
feat: add 3ds functionality (#285)
fabiano-mallmann Dec 15, 2023
d82de24
fix: remove call to newer magento versions functionalities (#286)
mateus-picoloto Dec 15, 2023
d091686
fix: admin 3ds status in order page and e-mail in tdsdata
Dec 19, 2023
584dd3c
fix: admin user edit save (#288)
mateus-picoloto Dec 19, 2023
2220b36
fix: admin 3ds status in order page and e-mail in tdsdata
fabiano-mallmann Jan 5, 2024
b596b4b
fix: remove card switch
fabiano-mallmann Jan 5, 2024
42ed5ac
fix: remove card switch
fabiano-mallmann Jan 5, 2024
deeef50
fix: json_decode for non 3ds order in admin (#293)
mateus-picoloto Jan 12, 2024
4570c79
fix: remove 3ds on debit and wrong array call (#296)
fabiano-mallmann Jan 17, 2024
97e9492
tests: unit setup tests (#295)
fabiano-mallmann Jan 17, 2024
51e2284
fix: remove Tds on debitcard
fabiano-mallmann Jan 17, 2024
5683b54
fix: remove Tds on debitcard
fabiano-mallmann Jan 18, 2024
d94e8f3
fix: prevent non unsigned integer value in cvv input (#298)
mateus-picoloto Jan 18, 2024
655c74a
Release/2.3.1 (#299)
mateus-picoloto Jan 18, 2024
5fc8800
Master -> stg (#300)
mateus-picoloto Jan 18, 2024
d7a2f2a
improve: enable the order_with_tds_refused option by default (#301)
fabiano-mallmann Jan 18, 2024
82c4b02
fix: resolve merge conflit and change url to tds (#302)
fabiano-mallmann Jan 22, 2024
76c8d39
feat: added min value to 3ds
RafaMelazzo Jan 24, 2024
72f8ac9
feat: added min value to 3ds (#303)
RafaMelazzo Jan 26, 2024
71f574c
release 2.4.0
RafaMelazzo Jan 29, 2024
7eb7c2f
small fixes
RafaMelazzo Jan 29, 2024
94cf907
removed google from whitelist
RafaMelazzo Jan 29, 2024
7053a49
add 3ds to whitelist
RafaMelazzo Jan 29, 2024
628d2a1
Merge branch 'master' into stg
RafaMelazzo Jan 29, 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
72 changes: 72 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,19 +58,91 @@ jobs:
-
name: Check PHP sintax
run: find . -name \*.php -exec php -l "{}" \;
phpunit:
name: PHP Unit
runs-on: ubuntu-latest
steps:
- name: Create Folder
run: ls -la && mkdir magento && cd magento && ls -la

- name: Install Magento
uses: php-actions/composer@v6
with:
php_version: 8.1
command: "create-project --repository-url=https://repo.magento.com/ magento/project-community-edition:2.4.5 ."
args: "--ignore-platform-reqs"
working_dir: /app/magento
env:
COMPOSER_AUTH: '{"http-basic": { "repo.magento.com": { "username": "${{ secrets.MAGENTO_KEY }}", "password": "${{secrets.MAGENTO_SECRET}}"}}}'

- name: Change minimum stable to Dev
uses: php-actions/composer@v6
with:
php_version: 8.1
command: "config minimum-stability dev"
working_dir: /app/magento

- name: Download Module
uses: php-actions/composer@v6
with:
php_version: 8.1
command: require pagarme/pagarme-magento2-module:dev-${{ github.head_ref }}
args: "--ignore-platform-reqs"
working_dir: /app/magento
env:
COMPOSER_AUTH: '{"http-basic": { "repo.magento.com": { "username": "${{ secrets.MAGENTO_KEY }}", "password": "${{secrets.MAGENTO_SECRET}}"}}}'

- name: Download Mockery
uses: php-actions/composer@v6
with:
php_version: 8.1
command: require mockery/mockery
args: "--ignore-platform-reqs"
working_dir: /app/magento
env:
COMPOSER_AUTH: '{"http-basic": { "repo.magento.com": { "username": "${{ secrets.MAGENTO_KEY }}", "password": "${{secrets.MAGENTO_SECRET}}"}}}'

- name: Run PHP Unit Tests
uses: php-actions/phpunit@v3
env:
XDEBUG_MODE: coverage
with:
bootstrap: "/app/magento/vendor/autoload.php"
configuration: "/app/magento/vendor/pagarme/pagarme-magento2-module/phpunit.xml"
version: 9.5.28
php_version : 8.1
php_extensions: "xdebug"

- name: Upload coverage artifact
uses: actions/upload-artifact@master
with:
name: mage-coverage-${{ github.sha }}
path: magento/vendor/pagarme/pagarme-magento2-module/clover.xml

sonar:
name: SonarCloud
runs-on: ubuntu-latest
needs: phpunit
steps:
-
name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
-
name: Download coverage artifact
uses: actions/download-artifact@master
with:
name: mage-coverage-${{ github.sha }}
path: coverage
-
name: Run Sonar
uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
- name: Delete coverage artifact
uses: geekyeggo/delete-artifact@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
name: mage-coverage-${{ github.sha }}
11 changes: 11 additions & 0 deletions Api/TdsTokenInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

namespace Pagarme\Pagarme\Api;

interface TdsTokenInterface
{
/**
* @return string
*/
public function getToken();
}
7 changes: 2 additions & 5 deletions Block/Adminhtml/Form/Field/CreditCardPspField.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
use Magento\Backend\Block\Template\Context;
use Magento\Config\Block\System\Config\Form\Field;
use Magento\Framework\Data\Form\Element\AbstractElement;
use Magento\Framework\View\Helper\SecureHtmlRenderer;
use Pagarme\Pagarme\Model\Account;
use Pagarme\Pagarme\Model\PagarmeConfigProvider;

Expand All @@ -20,15 +19,13 @@ class CreditCardPspField extends Field
* @param Context $context
* @param Account $account
* @param array $data
* @param SecureHtmlRenderer|null $secureRenderer
*/
public function __construct(
Context $context,
Account $account,
array $data = [],
?SecureHtmlRenderer $secureRenderer = null
array $data = []
) {
parent::__construct($context, $data, $secureRenderer);
parent::__construct($context, $data);
$this->account = $account;
}

Expand Down
7 changes: 2 additions & 5 deletions Block/Adminhtml/Form/Field/GatewayField.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
use Magento\Backend\Block\Template\Context;
use Magento\Config\Block\System\Config\Form\Field;
use Magento\Framework\Data\Form\Element\AbstractElement;
use Magento\Framework\View\Helper\SecureHtmlRenderer;
use Pagarme\Pagarme\Model\Account;

class GatewayField extends Field
Expand All @@ -25,16 +24,14 @@ class GatewayField extends Field
* @param Account $account
* @param string $paymentMethodName
* @param array $data
* @param SecureHtmlRenderer|null $secureRenderer
*/
public function __construct(
Context $context,
Account $account,
string $paymentMethodName = '',
array $data = [],
?SecureHtmlRenderer $secureRenderer = null
array $data = []
) {
parent::__construct($context, $data, $secureRenderer);
parent::__construct($context, $data);
$this->account = $account;
$this->paymentMethodName = $paymentMethodName;
}
Expand Down
7 changes: 2 additions & 5 deletions Block/Adminhtml/Form/Field/InstallmentsNumber.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
use Magento\Config\Block\System\Config\Form\Field;
use Magento\Config\Model\ResourceModel\Config\Data\CollectionFactory;
use Magento\Framework\Data\Form\Element\AbstractElement;
use Magento\Framework\View\Helper\SecureHtmlRenderer;
use Pagarme\Pagarme\Model\Account;
use Pagarme\Pagarme\Model\PagarmeConfigProvider;

Expand All @@ -22,16 +21,14 @@ class InstallmentsNumber extends Field
* @param CollectionFactory $configCollectionFactory
* @param Account $account
* @param array $data
* @param SecureHtmlRenderer|null $secureRenderer
*/
public function __construct(
Context $context,
CollectionFactory $configCollectionFactory,
Account $account,
array $data = [],
?SecureHtmlRenderer $secureRenderer = null
array $data = []
) {
parent::__construct($context, $data, $secureRenderer);
parent::__construct($context, $data);
$this->configCollectionFactory = $configCollectionFactory;
$this->account = $account;
}
Expand Down
7 changes: 2 additions & 5 deletions Block/Adminhtml/Form/Field/SoftDescriptor.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
use Magento\Backend\Block\Template\Context;
use Magento\Config\Block\System\Config\Form\Field;
use Magento\Framework\Data\Form\Element\AbstractElement;
use Magento\Framework\View\Helper\SecureHtmlRenderer;
use Pagarme\Pagarme\Model\Account;

class SoftDescriptor extends Field
Expand All @@ -25,16 +24,14 @@ class SoftDescriptor extends Field
* @param Account $account
* @param string $paymentMethodName
* @param array $data
* @param SecureHtmlRenderer|null $secureRenderer
*/
public function __construct(
Context $context,
Account $account,
string $paymentMethodName = '',
array $data = [],
?SecureHtmlRenderer $secureRenderer = null
array $data = []
) {
parent::__construct($context, $data, $secureRenderer);
parent::__construct($context, $data);
$this->account = $account;
$this->paymentMethodName = $paymentMethodName;
}
Expand Down
7 changes: 2 additions & 5 deletions Block/Adminhtml/Form/Fieldset/CreditCardGatewayFieldset.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
use Magento\Config\Block\System\Config\Form\Fieldset;
use Magento\Framework\Data\Form\Element\AbstractElement;
use Magento\Framework\View\Helper\Js;
use Magento\Framework\View\Helper\SecureHtmlRenderer;
use Pagarme\Pagarme\Model\Account;
use Pagarme\Pagarme\Model\PagarmeConfigProvider;

Expand All @@ -24,17 +23,15 @@ class CreditCardGatewayFieldset extends Fieldset
* @param Js $jsHelper
* @param Account $account
* @param array $data
* @param SecureHtmlRenderer|null $secureRenderer
*/
public function __construct(
Context $context,
Session $authSession,
Js $jsHelper,
Account $account,
array $data = [],
?SecureHtmlRenderer $secureRenderer = null
array $data = []
) {
parent::__construct($context, $authSession, $jsHelper, $data, $secureRenderer);
parent::__construct($context, $authSession, $jsHelper, $data);
$this->account = $account;
}

Expand Down
7 changes: 2 additions & 5 deletions Block/Adminhtml/Form/Fieldset/CustomPaymentFieldset.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
use Magento\Config\Block\System\Config\Form\Fieldset;
use Magento\Framework\Data\Form\Element\AbstractElement;
use Magento\Framework\View\Helper\Js;
use Magento\Framework\View\Helper\SecureHtmlRenderer;
use Pagarme\Pagarme\Model\Account;

class CustomPaymentFieldset extends Fieldset
Expand All @@ -29,18 +28,16 @@ class CustomPaymentFieldset extends Fieldset
* @param Account $account
* @param string $paymentMethodName
* @param array $data
* @param SecureHtmlRenderer|null $secureRenderer
*/
public function __construct(
Context $context,
Session $authSession,
Js $jsHelper,
Account $account,
string $paymentMethodName = '',
array $data = [],
?SecureHtmlRenderer $secureRenderer = null
array $data = []
) {
parent::__construct($context, $authSession, $jsHelper, $data, $secureRenderer);
parent::__construct($context, $authSession, $jsHelper, $data);
$this->account = $account;
$this->paymentMethodName = $paymentMethodName;
}
Expand Down
6 changes: 2 additions & 4 deletions Block/Adminhtml/System/Config/Form/Field/HubIntegration.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
use Magento\Config\Block\System\Config\Form\Field;
use Magento\Framework\Data\Form\Element\AbstractElement;
use Magento\Framework\Phrase;
use Magento\Framework\View\Helper\SecureHtmlRenderer;
use Pagarme\Core\Hub\Services\HubIntegrationService;
use Pagarme\Pagarme\Concrete\Magento2CoreSetup;
use Pagarme\Pagarme\Model\Account;
Expand All @@ -22,11 +21,10 @@ class HubIntegration extends Field
public function __construct(
Account $account,
Context $context,
array $data = [],
?SecureHtmlRenderer $secureRenderer = null
array $data = []
) {
$this->account = $account;
parent::__construct($context, $data, $secureRenderer);
parent::__construct($context, $data);
}

/**
Expand Down
25 changes: 15 additions & 10 deletions Block/Payment/Info/CreditCard.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
use Magento\Framework\Exception\LocalizedException;
use Magento\Payment\Block\Info\Cc;
use Pagarme\Core\Kernel\Aggregates\Charge;
use Pagarme\Core\Kernel\Aggregates\Order;
use Pagarme\Core\Kernel\Exceptions\InvalidParamException;
use Pagarme\Core\Kernel\Services\OrderService;
use Pagarme\Core\Kernel\ValueObjects\Id\OrderId;
use Pagarme\Core\Payment\Aggregates\Payments\Authentication\AuthenticationStatusEnum;
use Pagarme\Pagarme\Concrete\Magento2CoreSetup;
use Pagarme\Pagarme\Concrete\Magento2PlatformOrderDecorator;

Expand All @@ -42,14 +42,6 @@ public function getCcType()
return $this->getCcTypeName();
}

/**
* @return string
*/
public function getCardNumber()
{
return '**** **** **** ' . $this->getInfo()->getCcLast4();
}

/**
* @return string
*/
Expand Down Expand Up @@ -82,6 +74,19 @@ public function getInstallments()
return $this->getInfo()->getAdditionalInformation('cc_installments');
}

public function getThreeDSStatus()
{
$authenticationAdditionalInformation = $this->getInfo()->getAdditionalInformation('authentication');
if (empty($authenticationAdditionalInformation)) {
return '';
}

$authentication = json_decode($authenticationAdditionalInformation, true);
return AuthenticationStatusEnum::statusMessage(
$authentication['trans_status'] ?? ''
);
}

/**
* @return array
* @throws InvalidParamException
Expand Down Expand Up @@ -109,7 +114,7 @@ public function getTransactionInfo()
}

$charge = current($orderObject->getCharges());

return array_merge(
$charge->getAcquirerTidCapturedAndAutorize(),
['tid' => $this->getTid($charge)]
Expand Down
4 changes: 1 addition & 3 deletions Block/Payment/Info/Debit.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

namespace Pagarme\Pagarme\Block\Payment\Info;

use Magento\Payment\Block\Info\Cc;

class Debit extends Cc
class Debit extends CreditCard
{

}
Loading
Loading