Overview

The module integrates Drupal Commerce with Secure Hosting's payment services.
It provides both on-site and off-site payment integrations.

Dependencies

Th Drupal Commerce module.

Project link

https://www.drupal.org/project/commerce_securehosting

Git instructions

git clone --branch 8.x-1.x https://git.drupalcode.org/project/commerce_securehosting.git

PAReview checklist

https://pareview.sh/pareview/https-git.drupal.org-project-commerce_secur...

Comments

codebymikey created an issue. See original summary.

avpaderno’s picture

Issue summary: View changes

Thank you for applying! I added the Git instructions for non-maintainer users and the PAReview checklist link. Reviewers will check the project and post comments to list what should be changed.

If you haven't done it, yet, please check the PAReview report and fix what needs to be fixed. There could be some false positives; verify that what reported is correct, before making any change.

Remember also to change status, when the project is ready to be reviewed. The current status is telling users not to review the project.

rksyravi’s picture

Status: Active » Needs work

Hi @codebymikey,

Thank you for contribution!!!!

Below are some issues need to resolve.

Line   src/Plugin/Commerce/PaymentGateway/SecureHostingGatewayTrait.php (in context of class Drupal\commerce_securehosting\Plugin\Commerce\PaymentGateway\SecureHostingOffsiteGateway)                                               
 ------ ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ 
  25     Property Drupal\commerce_securehosting\Plugin\Commerce\PaymentGateway\SecureHostingOffsiteGateway::$currencyRepository has unknown class CommerceGuys\Intl\Currency\CurrencyRepositoryInterface as its type.                  
  97     Call to an undefined method Drupal\commerce\PurchasableEntityInterface::getSku().                                                                                                                                             
  126    Parameter $billing_profile of method Drupal\commerce_securehosting\Plugin\Commerce\PaymentGateway\SecureHostingOffsiteGateway::getSecureHostingOrderData() has invalid typehint type Drupal\profile\Entity\ProfileInterface.  
  126    Parameter $billing_profile of method Drupal\commerce_securehosting\Plugin\Commerce\PaymentGateway\SecureHostingOffsiteGateway::getSecureHostingOrderData() has invalid typehint type Drupal\profile\Entity\ProfileInterface.  
  154    Call to method hasField() on an unknown class Drupal\profile\Entity\ProfileInterface.                                                                                                                                         
  157    Call to method get() on an unknown class Drupal\profile\Entity\ProfileInterface.                                                                                                                                              
  157    PHPDoc tag @var for variable $address contains unknown class Drupal\address\Plugin\Field\FieldType\AddressItem.                                                                                                               
  158    If condition is always true.                                                                                                                                                                                                  
  159    Call to method getFamilyName() on an unknown class Drupal\address\Plugin\Field\FieldType\AddressItem.                                                                                                                         
  159    Call to method getGivenName() on an unknown class Drupal\address\Plugin\Field\FieldType\AddressItem.                                                                                                                          
  160    Call to method getOrganization() on an unknown class Drupal\address\Plugin\Field\FieldType\AddressItem.                                                                                                                       
  161    Call to method getAddressLine1() on an unknown class Drupal\address\Plugin\Field\FieldType\AddressItem.                                                                                                                       
  162    Call to method getAddressLine2() on an unknown class Drupal\address\Plugin\Field\FieldType\AddressItem.                                                                                                                       
  163    Call to method getLocality() on an unknown class Drupal\address\Plugin\Field\FieldType\AddressItem.                                                                                                                           
  164    Call to method getAdministrativeArea() on an unknown class Drupal\address\Plugin\Field\FieldType\AddressItem.                                                                                                                 
  165    Call to method getPostalCode() on an unknown class Drupal\address\Plugin\Field\FieldType\AddressItem.                                                                                                                         
  166    Call to method getCountryCode() on an unknown class Drupal\address\Plugin\Field\FieldType\AddressItem.                                                                                                                        
  293    Call to method get() on an unknown class CommerceGuys\Intl\Currency\CurrencyRepositoryInterface.                                                                                                                              
 ------ ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ 

 ------ ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 
  Line   src/Plugin/Commerce/PaymentGateway/SecureHostingGatewayTrait.php (in context of class Drupal\commerce_securehosting\Plugin\Commerce\PaymentGateway\SecureHostingOnsiteGateway)                                               
 ------ ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 
  25     Property Drupal\commerce_securehosting\Plugin\Commerce\PaymentGateway\SecureHostingOnsiteGateway::$currencyRepository has unknown class CommerceGuys\Intl\Currency\CurrencyRepositoryInterface as its type.                  
  97     Call to an undefined method Drupal\commerce\PurchasableEntityInterface::getSku().                                                                                                                                            
  126    Parameter $billing_profile of method Drupal\commerce_securehosting\Plugin\Commerce\PaymentGateway\SecureHostingOnsiteGateway::getSecureHostingOrderData() has invalid typehint type Drupal\profile\Entity\ProfileInterface.  
  126    Parameter $billing_profile of method Drupal\commerce_securehosting\Plugin\Commerce\PaymentGateway\SecureHostingOnsiteGateway::getSecureHostingOrderData() has invalid typehint type Drupal\profile\Entity\ProfileInterface.  
  154    Call to method hasField() on an unknown class Drupal\profile\Entity\ProfileInterface.                                                                                                                                        
  157    Call to method get() on an unknown class Drupal\profile\Entity\ProfileInterface.                                                                                                                                             
  157    PHPDoc tag @var for variable $address contains unknown class Drupal\address\Plugin\Field\FieldType\AddressItem.                                                                                                              
  158    If condition is always true.                                                                                                                                                                                                 
  159    Call to method getFamilyName() on an unknown class Drupal\address\Plugin\Field\FieldType\AddressItem.                                                                                                                        
  159    Call to method getGivenName() on an unknown class Drupal\address\Plugin\Field\FieldType\AddressItem.                                                                                                                         
  160    Call to method getOrganization() on an unknown class Drupal\address\Plugin\Field\FieldType\AddressItem.                                                                                                                      
  161    Call to method getAddressLine1() on an unknown class Drupal\address\Plugin\Field\FieldType\AddressItem.                                                                                                                      
  162    Call to method getAddressLine2() on an unknown class Drupal\address\Plugin\Field\FieldType\AddressItem.                                                                                                                      
  163    Call to method getLocality() on an unknown class Drupal\address\Plugin\Field\FieldType\AddressItem.                                                                                                                          
  164    Call to method getAdministrativeArea() on an unknown class Drupal\address\Plugin\Field\FieldType\AddressItem.                                                                                                                
  165    Call to method getPostalCode() on an unknown class Drupal\address\Plugin\Field\FieldType\AddressItem.                                                                                                                        
  166    Call to method getCountryCode() on an unknown class Drupal\address\Plugin\Field\FieldType\AddressItem.                                                                                                                       
  293    Call to method get() on an unknown class CommerceGuys\Intl\Currency\CurrencyRepositoryInterface.                                                                                                                             
 ------ ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 

 ------ ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ 
  Line   src/Plugin/Commerce/PaymentGateway/SecureHostingOffsiteGateway.php                                                                                                                                                                  
 ------ ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ 
  133    Parameter $currency_repository of method Drupal\commerce_securehosting\Plugin\Commerce\PaymentGateway\SecureHostingOffsiteGateway::__construct() has invalid typehint type CommerceGuys\Intl\Currency\CurrencyRepositoryInterface.  
  133    Parameter $currency_repository of method Drupal\commerce_securehosting\Plugin\Commerce\PaymentGateway\SecureHostingOffsiteGateway::__construct() has invalid typehint type CommerceGuys\Intl\Currency\CurrencyRepositoryInterface.  
  140    Property Drupal\commerce_securehosting\Plugin\Commerce\PaymentGateway\SecureHostingOffsiteGateway::$httpClient (GuzzleHttp\Client) does not accept GuzzleHttp\ClientInterface.                                                      
  148    Unsafe usage of new static().                                                                                                                                                                                                       
         💡 Consider making the class or the constructor final.                                                                                                                                                                               
  223    Class Drupal\entity\Form\EntityDuplicateFormTrait not found and could not be autoloaded.                                                                                                                                            
  225    Left side of && is always true.                                                                                                                                                                                                     
  466    Access to deprecated property $entityId of class Drupal\commerce_payment\Plugin\Commerce\PaymentGateway\PaymentGatewayBase:                                                                                                         
         in commerce:8.x-2.16 and is removed from commerce:3.x.                                                                                                                                                                              
         Use $this->parentEntity->id() instead.                                                                                                                                                                                              
  531    Strict comparison using === between Psr\Http\Message\StreamInterface and false will always evaluate to false.                                                                                                                       
 ------ ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ 

 ------ ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 
  Line   src/Plugin/Commerce/PaymentGateway/SecureHostingOnsiteGateway.php                                                                                                                                                                  
 ------ ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 
  132    Parameter $currency_repository of method Drupal\commerce_securehosting\Plugin\Commerce\PaymentGateway\SecureHostingOnsiteGateway::__construct() has invalid typehint type CommerceGuys\Intl\Currency\CurrencyRepositoryInterface.  
  132    Parameter $currency_repository of method Drupal\commerce_securehosting\Plugin\Commerce\PaymentGateway\SecureHostingOnsiteGateway::__construct() has invalid typehint type CommerceGuys\Intl\Currency\CurrencyRepositoryInterface.  
  148    Property Drupal\commerce_securehosting\Plugin\Commerce\PaymentGateway\SecureHostingOnsiteGateway::$httpClient (GuzzleHttp\Client) does not accept GuzzleHttp\ClientInterface.                                                      
  156    Unsafe usage of new static().                                                                                                                                                                                                      
         💡 Consider making the class or the constructor final.                                                                                                                                                                              
  290    Property Drupal\commerce_payment\Entity\PaymentMethodInterface::$card_number (Drupal\Core\Field\FieldItemListInterface) does not accept string.                                                                                    
  476    Multiple PHPDoc @var tags above single variable assignment are not supported.                                                                                                                                                      
  548    Parameter $billing_profile of method Drupal\commerce_securehosting\Plugin\Commerce\PaymentGateway\SecureHostingOnsiteGateway::getTransactionXml() has invalid typehint type Drupal\profile\Entity\ProfileInterface.                
  548    Parameter $billing_profile of method Drupal\commerce_securehosting\Plugin\Commerce\PaymentGateway\SecureHostingOnsiteGateway::getTransactionXml() has invalid typehint type Drupal\profile\Entity\ProfileInterface.                
 ------ ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 

 ------ ------------------------------------------------------------------------------------------------------------------------------------- 
  Line   src/PluginForm/OffsiteRedirect/SecureHostingRedirectForm.php                                                                         
 ------ ------------------------------------------------------------------------------------------------------------------------------------- 
  25     Multiple PHPDoc @var tags above single variable assignment are not supported.                                                        
  28     Call to an undefined method Drupal\commerce_payment\Plugin\Commerce\PaymentGateway\PaymentGatewayInterface::buildFormData().         
  31     Call to an undefined method Drupal\commerce_payment\Plugin\Commerce\PaymentGateway\PaymentGatewayInterface::getGatewayUrl().         
  33     Call to an undefined method Drupal\commerce_payment\Plugin\Commerce\PaymentGateway\PaymentGatewayInterface::isTest().                
  34     Call to an undefined method Drupal\commerce_payment\Plugin\Commerce\PaymentGateway\PaymentGatewayInterface::helpRenderArray().       
  43     Call to an undefined method Drupal\commerce_payment\Plugin\Commerce\PaymentGateway\PaymentGatewayInterface::autoSubmits().           
  44     Call to an undefined method Drupal\commerce_payment\Plugin\Commerce\PaymentGateway\PaymentGatewayInterface::getAutoSubmitTimeout().  
 ------ ------------------------------------------------------------------------------------------------------------------------------------- 

 ------ ------------------------------------------------------------------------------------------------------------------------------------------------ 
  Line   src/PluginForm/Onsite/PaymentAddForm.php                                                                                                        
 ------ ------------------------------------------------------------------------------------------------------------------------------------------------ 
  56     Call to an undefined method Drupal\commerce_securehosting\Plugin\Commerce\PaymentGateway\SecureHostingOnsiteGatewayInterface::createPayment().  
 ------ ------------------------------------------------------------------------------------------------------------------------------------------------ 

 ------ ------------------------------------------------------------------------------------------------------------------------------------------------- 
  Line   src/PluginForm/Onsite/PaymentCaptureForm.php                                                                                                     
 ------ ------------------------------------------------------------------------------------------------------------------------------------------------- 
  41     Call to an undefined method Drupal\commerce_securehosting\Plugin\Commerce\PaymentGateway\SecureHostingOnsiteGatewayInterface::capturePayment().  
 ------ ------------------------------------------------------------------------------------------------------------------------------------------------- 

 ------ ------------------------------------------------------------------------------------------------------------------------------------------------ 
  Line   src/PluginForm/Onsite/PaymentRefundForm.php                                                                                                     
 ------ ------------------------------------------------------------------------------------------------------------------------------------------------ 
  41     Call to an undefined method Drupal\commerce_securehosting\Plugin\Commerce\PaymentGateway\SecureHostingOnsiteGatewayInterface::refundPayment().
shaktik’s picture

Issue summary: View changes
FILE: ...es/contrib/commerce_securehosting/commerce_securehosting.api.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 29 | ERROR | Inline doc block comments are not allowed; use "/*
    |       | Comment */" or "// Comment" instead
----------------------------------------------------------------------


FILE: ...rk/drupal-8/web/modules/contrib/commerce_securehosting/README.md
----------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
----------------------------------------------------------------------
 19 | WARNING | Line exceeds 80 characters; contains 85 characters
 47 | WARNING | Line exceeds 80 characters; contains 142 characters
----------------------------------------------------------------------


FILE: ...ing/src/PluginForm/OffsiteRedirect/SecureHostingRedirectForm.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 21 | ERROR | Inline doc block comments are not allowed; use "/*
    |       | Comment */" or "// Comment" instead
----------------------------------------------------------------------


FILE: ...c/Plugin/Commerce/PaymentGateway/SecureHostingOffsiteGateway.php
----------------------------------------------------------------------
FOUND 12 ERRORS AFFECTING 6 LINES
----------------------------------------------------------------------
 347 | ERROR | [ ] Doc comment short description must start with a
     |       |     capital letter
 347 | ERROR | [x] Doc comment short description must end with a full
     |       |     stop
 354 | ERROR | [ ] Doc comment short description must start with a
     |       |     capital letter
 354 | ERROR | [x] Doc comment short description must end with a full
     |       |     stop
 361 | ERROR | [ ] Doc comment short description must start with a
     |       |     capital letter
 361 | ERROR | [x] Doc comment short description must end with a full
     |       |     stop
 368 | ERROR | [ ] Doc comment short description must start with a
     |       |     capital letter
 368 | ERROR | [x] Doc comment short description must end with a full
     |       |     stop
 375 | ERROR | [ ] Doc comment short description must start with a
     |       |     capital letter
 375 | ERROR | [x] Doc comment short description must end with a full
     |       |     stop
 479 | ERROR | [ ] Doc comment short description must start with a
     |       |     capital letter
 479 | ERROR | [x] Doc comment short description must end with a full
     |       |     stop
----------------------------------------------------------------------
PHPCBF CAN FIX THE 6 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: ...rc/Plugin/Commerce/PaymentGateway/SecureHostingOnsiteGateway.php
----------------------------------------------------------------------
FOUND 15 ERRORS AFFECTING 8 LINES
----------------------------------------------------------------------
 235 | ERROR | [ ] Doc comment short description must start with a
     |       |     capital letter
 235 | ERROR | [x] Doc comment short description must end with a full
     |       |     stop
 242 | ERROR | [ ] Doc comment short description must start with a
     |       |     capital letter
 242 | ERROR | [x] Doc comment short description must end with a full
     |       |     stop
 253 | ERROR | [ ] Doc comment short description must start with a
     |       |     capital letter
 253 | ERROR | [x] Doc comment short description must end with a full
     |       |     stop
 366 | ERROR | [ ] Doc comment short description must start with a
     |       |     capital letter
 366 | ERROR | [x] Doc comment short description must end with a full
     |       |     stop
 396 | ERROR | [ ] Doc comment short description must start with a
     |       |     capital letter
 396 | ERROR | [x] Doc comment short description must end with a full
     |       |     stop
 447 | ERROR | [ ] Doc comment short description must start with a
     |       |     capital letter
 447 | ERROR | [x] Doc comment short description must end with a full
     |       |     stop
 472 | ERROR | [ ] Inline doc block comments are not allowed; use "/*
     |       |     Comment */" or "// Comment" instead
 491 | ERROR | [ ] Doc comment short description must start with a
     |       |     capital letter
 491 | ERROR | [x] Doc comment short description must end with a full
     |       |     stop
----------------------------------------------------------------------
PHPCBF CAN FIX THE 7 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

Time: 315ms; Memory: 12Mb
codebymikey’s picture

I've pushed the latest code changes addressing the coding standards and reran the scan on PAReview.

@kiamlaluno
I think the version of pareview.sh / coder on the https://pareview.sh/ site is out of date as some of the flagged warnings are false-positives and have been addressed in the latest coder version. I've updated it nonetheless to use @inheritdoc to keep parity with Drupal's coding standards.

@rksyravi
The majority of the errors are related to missing vendor code typically pulled in from the commerce module through composer install, and are false-positives from type-hinted variables.

What tool did you use to generate them?

codebymikey’s picture

Status: Needs work » Needs review
avpaderno’s picture

Status: Needs review » Reviewed & tested by the community

I didn't see any security issue in the code. Since the OP was quick to respond to comments and evaluate what actually needed to be changed, I am going to approve this application.

avpaderno’s picture

Status: Reviewed & tested by the community » Fixed

Thank you for your contribution! I am going to update your account.

These are some recommended readings to help with excellent maintainership:

You can find more contributors chatting on the IRC #drupal-contribute channel. So, come hang out and stay involved.
Thank you, also, for your patience with the review process.
Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.

I thank all the dedicated reviewers as well.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.