Skip to content

Commit 50b0122

Browse files
cedrancontardiThiago ContardiGabrielAntalcarolineesteves
authored
Adaptar módulo Vindi/VP para compatibilidade com PHP 7 (#21)
* feat: added new credit card form * feat: added setup for old settings and minor bugfixes * fix: error with 1i18n on setting's page * fix: allow all countris by default * i18n: add new terms for language file * feat: added max installments and minum installment value * feat: added reseller token to transactions * feat: added reseller token to transactions * feat: send tracking code to Vindi * fix: mask also reseller token and token account * fix: when the card number comes with 4 digits, don't add 20 before it * fix: when the card number comes with 4 digits, don't add 20 before it * doc: added pull request template * fix: observer to bankslippix * fix: cancel unapproved orders without config * feat: adjust with phpstan * fix: error monitoring transactions * fix: worng price additional * fix: update terms to ask for a CPF on checkout * feat: don't auto select TaxVat when is not a CPF number * feat: don't auto select TaxVat when is not a CPF number * Payment link functionality created * Vindi payment method verification to send the payment link has been added * The payment link email template changed and made an email configuration to set the template * Template Id changed * Email path and list fixed * feat/VINDI-143: estilo da pagina de link de pagamento com boleto, pix, bolepix e cartao * feat/VINDI-143: estilizacao pagina link de pagamento * Use strict added to js file * ko library added * float cast removed * Applying the requested changes on payment link files * adding the vindi_customer_taxvat to additionalInformation * Fixing the bugs about payment link * VP module version has been updated * payment link email template has been changed * Deleting the payment link when it is expired * Fixing the payment link summary details * Adding a discount verification * Making the discount value positive * fix: change fingerprint loader * VINDI-143: pagina de sucesso * VINDI-143: mensagem de desconto no link de pagamento * Remove linha comentada * The payment link delete has been removed from the payment link page * fix: add fingerprint method in define * fix: customer without taxvat * fix: preventing conflict with the vindi recurrence module * feat: adding security validations and better payment link management * fix: phpstan fix * feat: creating mass sending of payment link * fix: remove await vindi fingerprint * feat: add translate * feat: automatically cancels orders whose payment link has expired more than 30 days ago * feat: custom email template * fix: remove await vindi fingerprint * fix: remove await vindi fingerprint * refactor: adding validation on payment methods and payment link success page * fix: change form with get status * feat: implementing single view system on success page * feat: translate * fix: remove await vindi fingerprint * fix: remove await vindi fingerprint * feat: expire_at field * update * update * update * update * fix: processing payment link when canceling * fix: Adjust payment data displays if the order has already been invoiced * feat: added refund functionality * fix: allow to refund * fix: remove default consumer-key, consumer secret * fix: remove default consumer-key, consumer secret * fix: remove default consumer-key, consumer secret * feat: create authentication button * refactor: add logging in refund flow * fix: address saving repeated * fix: address saving repeated * fix: logger in helper * fix: logger in helper * fix: logger in helper * refactor: add log in RefundRequest * refactor: add log in RefundRequest * refactor: add log in RefundRequest * fix: correcting the way the access_token is taken * fix: generate new access_token * refactor: refactoring duplicate code and creating tests * refactor: refactoring duplicate code and creating tests * refactor: refactoring duplicate code and creating tests * fix: call fingerprint script in all pages * fix: regenerate acces_token * v1.4.1 * fix: refresh token error * fix: it should not be possible to generate payment link via the frontend * feat: added text to return URL * fix: round the discount tag * Update composer.json * fix: floating point error * feat: Add PHP 7.4+ compatibility to Vindi VP module - Remove PHP 8.0+ specific features for backward compatibility - Replace union types with untyped parameters and PHPDoc annotations - Convert arrow functions to anonymous functions - Remove property type declarations in favor of PHPDoc comments - Maintain all existing functionality and business logic - Ensure compatibility with both PHP 7.4+ and PHP 8.x versions This change makes the module compatible with PHP 7.4+ environments while preserving full functionality for payment link creation, validation, email sending, and payment processing workflows. Files modified: - PaymentLinkService and related service classes - Block components for admin and frontend - Controllers for checkout and admin operations - Observers and plugins for order integration - Repository and model classes - Console commands and cron jobs No breaking changes to existing APIs or functionality. --------- Co-authored-by: Thiago Contardi <thiagocontardi@hotmail.com> Co-authored-by: Thiago Contardi <thiago@bizcommerce.com.br> Co-authored-by: Contardi <contardi@users.noreply.github.com> Co-authored-by: Gabriel Antal <gabrielantalsilva@gmail.com> Co-authored-by: Caroline Esteves <carol@bizcommerce.com.br> Co-authored-by: Antal <gabriel.antal@bizcommerce.com.br> Co-authored-by: Antal <44688111+GabrielAntal@users.noreply.github.com> Co-authored-by: carolineesteves <131886821+carolineesteves@users.noreply.github.com> Co-authored-by: Iago Cedran <iago@bizcommerce.com.br>
1 parent c525ef7 commit 50b0122

24 files changed

+106
-87
lines changed

Block/Adminhtml/Order/LinkField.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class LinkField extends Template
2828
/**
2929
* @var PaymentLinkService
3030
*/
31-
private PaymentLinkService $paymentLinkService;
31+
private $paymentLinkService;
3232

3333
/**
3434
* @param Context $context

Block/Custom/PaymentLink.php

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,42 +40,42 @@ class PaymentLink extends Template
4040
/**
4141
* @var PaymentLinkService
4242
*/
43-
private PaymentLinkService $paymentLinkService;
43+
private $paymentLinkService;
4444

4545
/**
4646
* @var ConfigProvider
4747
*/
48-
private ConfigProvider $configProvider;
48+
private $configProvider;
4949

5050
/**
5151
* @var FormKey
5252
*/
53-
private FormKey $formKey;
53+
private $formKey;
5454

5555
/**
5656
* @var Helper
5757
*/
58-
private Helper $helper;
58+
private $helper;
5959

6060
/**
6161
* @var StoreManagerInterface
6262
*/
63-
private StoreManagerInterface $storeManager;
63+
private $storeManager;
6464

6565
/**
6666
* @var CustomerRepositoryInterface
6767
*/
68-
private CustomerRepositoryInterface $customerRepository;
68+
private $customerRepository;
6969

7070
/**
7171
* @var PriceHelper
7272
*/
73-
private PriceHelper $priceHelper;
73+
private $priceHelper;
7474

7575
/**
7676
* @var TaxConfigProvider
7777
*/
78-
public TaxConfigProvider $taxConfigProvider;
78+
public $taxConfigProvider;
7979

8080
/**
8181
* @param Context $context
@@ -182,8 +182,10 @@ public function isSandbox()
182182
/**
183183
* @throws NoSuchEntityException
184184
* @throws LocalizedException
185+
* @param int|string $customerId
186+
* @return \Magento\Customer\Api\Data\CustomerInterface
185187
*/
186-
public function getCustomerById(string|int $customerId)
188+
public function getCustomerById($customerId)
187189
{
188190
return $this->customerRepository->getById($customerId);
189191
}

Block/Custom/PaymentLinkSuccess.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,17 @@ class PaymentLinkSuccess extends Template
2828
/**
2929
* @var PaymentLinkService
3030
*/
31-
private PaymentLinkService $paymentLinkService;
31+
private $paymentLinkService;
3232

3333
/**
3434
* @var FormKey
3535
*/
36-
private FormKey $formKey;
36+
private $formKey;
3737

3838
/**
3939
* @var Helper
4040
*/
41-
private Helper $helper;
41+
private $helper;
4242

4343
/**
4444
* @param Context $context

Console/Command/ClearOldAccessTokensCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class ClearOldAccessTokensCommand extends Command
1515
/**
1616
* @var ClearOldAccessTokens
1717
*/
18-
private ClearOldAccessTokens $clearOldAccessTokens;
18+
private $clearOldAccessTokens;
1919

2020
/**
2121
* Constructor.

Console/Command/RunCancelOrdersWithExpiredLinks.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ class RunCancelOrdersWithExpiredLinks extends Command
1515
/**
1616
* @var CancelOrdersWithExpiredLinks
1717
*/
18-
private CancelOrdersWithExpiredLinks $cancelOrdersWithExpiredLinks;
18+
private $cancelOrdersWithExpiredLinks;
1919

2020
/**
2121
* @var LoggerInterface
2222
*/
23-
private LoggerInterface $logger;
23+
private $logger;
2424

2525
/**
2626
* @param CancelOrdersWithExpiredLinks $cancelOrdersWithExpiredLinks

Console/Command/RunUpdateExpiredLinks.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ class RunUpdateExpiredLinks extends Command
1515
/**
1616
* @var UpdateExpiredLinks
1717
*/
18-
private UpdateExpiredLinks $updateExpiredLinks;
18+
private $updateExpiredLinks;
1919

2020
/**
2121
* @param UpdateExpiredLinks $updateExpiredLinks
2222
* @param string|null $name
2323
*/
2424
public function __construct(
2525
UpdateExpiredLinks $updateExpiredLinks,
26-
string $name = null
26+
$name = null
2727
) {
2828
$this->updateExpiredLinks = $updateExpiredLinks;
2929
parent::__construct($name);

Controller/Adminhtml/PaymentLink/MassSend.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,27 +20,27 @@ class MassSend extends Action
2020
/**
2121
* @var JsonFactory
2222
*/
23-
private JsonFactory $resultJsonFactory;
23+
private $resultJsonFactory;
2424

2525
/**
2626
* @var PaymentLinkService
2727
*/
28-
private PaymentLinkService $paymentLinkService;
28+
private $paymentLinkService;
2929

3030
/**
3131
* @var LoggerInterface
3232
*/
33-
private LoggerInterface $logger;
33+
private $logger;
3434

3535
/**
3636
* @var Validator
3737
*/
38-
private Validator $formKeyValidator;
38+
private $formKeyValidator;
3939

4040
/**
4141
* @var OrderRepositoryInterface
4242
*/
43-
private OrderRepositoryInterface $orderRepository;
43+
private $orderRepository;
4444

4545
/**
4646
* Maximum number of orders allowed for processing at once.

Controller/Adminhtml/PaymentLink/Send.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,22 +31,22 @@ class Send extends Action implements HttpPostActionInterface
3131
/**
3232
* @var JsonFactory
3333
*/
34-
private JsonFactory $resultJsonFactory;
34+
private $resultJsonFactory;
3535

3636
/**
3737
* @var PaymentLinkService
3838
*/
39-
private PaymentLinkService $paymentLinkService;
39+
private $paymentLinkService;
4040

4141
/**
4242
* @var LoggerInterface
4343
*/
44-
private LoggerInterface $logger;
44+
private $logger;
4545

4646
/**
4747
* @var Validator
4848
*/
49-
private Validator $formKeyValidator;
49+
private $formKeyValidator;
5050

5151
/**
5252
* @param Context $context

Controller/Checkout/Index.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,37 +35,37 @@ class Index implements HttpGetActionInterface
3535
/**
3636
* @var PageFactory
3737
*/
38-
protected PageFactory $resultPageFactory;
38+
protected $resultPageFactory;
3939

4040
/**
4141
* @var PaymentLinkService
4242
*/
43-
private PaymentLinkService $paymentLinkService;
43+
private $paymentLinkService;
4444

4545
/**
4646
* @var RequestInterface
4747
*/
48-
private RequestInterface $request;
48+
private $request;
4949

5050
/**
5151
* @var RedirectFactory
5252
*/
53-
private RedirectFactory $redirectFactory;
53+
private $redirectFactory;
5454

5555
/**
5656
* @var ManagerInterface
5757
*/
58-
private ManagerInterface $messageManager;
58+
private $messageManager;
5959

6060
/**
6161
* @var CustomerSession
6262
*/
63-
private CustomerSession $customerSession;
63+
private $customerSession;
6464

6565
/**
6666
* @var OrderRepositoryInterface
6767
*/
68-
private OrderRepositoryInterface $orderRepository;
68+
private $orderRepository;
6969

7070
/**
7171
* @param PageFactory $resultPageFactory

Controller/Checkout/SendTransaction.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,32 +34,32 @@ class SendTransaction implements HttpPostActionInterface
3434
/**
3535
* @var JsonFactory
3636
*/
37-
private JsonFactory $resultJsonFactory;
37+
private $resultJsonFactory;
3838

3939
/**
4040
* @var PaymentLinkService
4141
*/
42-
private PaymentLinkService $paymentLinkService;
42+
private $paymentLinkService;
4343

4444
/**
4545
* @var RequestInterface
4646
*/
47-
private RequestInterface $httpRequest;
47+
private $httpRequest;
4848

4949
/**
5050
* @var OrderRepositoryInterface
5151
*/
52-
private OrderRepositoryInterface $orderRepository;
52+
private $orderRepository;
5353

5454
/**
5555
* @var ManagerInterface
5656
*/
57-
private ManagerInterface $messageManager;
57+
private $messageManager;
5858

5959
/**
6060
* @var HelperOrder
6161
*/
62-
private HelperOrder $helperOrder;
62+
private $helperOrder;
6363

6464
/**
6565
* @param JsonFactory $resultJsonFactory

0 commit comments

Comments
 (0)