Commerce Cashfree Payment integrates a Cashfree payment gateway with Drupal Commerce. This module will add a new payment method Cashfree payment under payment methods settings(admin/commerce/config/payment-methods).
This module has a Test as well as a Live transaction mechanism.

Note that this module just redirects the customers to the Cashfree site where the user can make the payment and redirects to our site.

Project link

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

Git instructions

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

Comments

drupal.ramesh created an issue. See original summary.

phthlaap’s picture

Title: commerce cashfree payment » [D8] Commerce Cashfree Payment

Update application title

harishh’s picture

Issue summary: View changes

Updated "Git instructions".

harishh’s picture

Status: Needs review » Needs work

Hi @drupal.ramesh,

1. Better to replace $_POST with Drupal request.
src/Plugin/Commerce/PaymentGateway/CashfreeRedirect.php

    $orderId = $_POST["orderId"];
    $orderAmount = $_POST["orderAmount"];
    $referenceId = $_POST["referenceId"];
    $txStatus = $_POST["txStatus"];
    $paymentMode = $_POST["paymentMode"];
    $txMsg = $_POST["txMsg"];
    $txTime = $_POST["txTime"];
    $signature = $_POST["signature"];
    $merchant_reference = $_POST["referenceId"];

2. Please check the Drupal coding standards.
/commerce_cashfree_payment/src/PluginForm/CashfreeRedirect/PaymentCashfreeForm.php
--------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES
--------------------------------------------------------------------------------------------------------------------
24 | WARNING | Unused variable $redirect_method.
25 | WARNING | Unused variable $parameters.
40 | WARNING | Unused variable $product_id.
--------------------------------------------------------------------------------------------------------------------

/commerce_cashfree_payment/src/Plugin/Commerce/PaymentGateway/CashfreeRedirect.php
--------------------------------------------------------------------------------------------------------------------
FOUND 10 ERRORS AND 2 WARNINGS AFFECTING 11 LINES
--------------------------------------------------------------------------------------------------------------------
91 | WARNING | Unused variable $order_status.
92 | ERROR | The $_POST super global must not be accessed directly; inject the request.stack service and use
| | $stack->getCurrentRequest()->request instead
92 | WARNING | Unused variable $responseParams.
94 | ERROR | The $_POST super global must not be accessed directly; inject the request.stack service and use
| | $stack->getCurrentRequest()->request->get("orderId") instead
95 | ERROR | The $_POST super global must not be accessed directly; inject the request.stack service and use
| | $stack->getCurrentRequest()->request->get("orderAmount") instead
96 | ERROR | The $_POST super global must not be accessed directly; inject the request.stack service and use
| | $stack->getCurrentRequest()->request->get("referenceId") instead
97 | ERROR | The $_POST super global must not be accessed directly; inject the request.stack service and use
| | $stack->getCurrentRequest()->request->get("txStatus") instead
98 | ERROR | The $_POST super global must not be accessed directly; inject the request.stack service and use
| | $stack->getCurrentRequest()->request->get("paymentMode") instead
99 | ERROR | The $_POST super global must not be accessed directly; inject the request.stack service and use
| | $stack->getCurrentRequest()->request->get("txMsg") instead
100 | ERROR | The $_POST super global must not be accessed directly; inject the request.stack service and use
| | $stack->getCurrentRequest()->request->get("txTime") instead
101 | ERROR | The $_POST super global must not be accessed directly; inject the request.stack service and use
| | $stack->getCurrentRequest()->request->get("signature") instead
102 | ERROR | The $_POST super global must not be accessed directly; inject the request.stack service and use
| | $stack->getCurrentRequest()->request->get("referenceId") instead
-------------------------------------------------------------------------------------------------------

avpaderno’s picture

drupal-ramesh’s picture

Hi kiamlaluno

Thank you for your valuable feedback. Above warnings and errors are fixed.

pavnish’s picture

Readme file should need more clear:
Need to follow :
Introduction
Requirements
Installation
Configuration
Maintainers

drupal-ramesh’s picture

Hi pavnish.

Thanks for your input. I have moved the updated readme file.

drupal-ramesh’s picture

Status: Needs work » Needs review
pinesh’s picture

Thank you for the contribution!

Please fix the Drupal coding standards.

FILE: C:\xampp\htdocs\drupal_commrence\modules\commerce_cashfree_payment\commerce_cashfree_payment.module
---------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------------
 1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
---------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------


FILE: C:\xampp\htdocs\drupal_commrence\modules\commerce_cashfree_payment\README.txt
-----------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------
 43 | ERROR | [x] Expected 1 newline at end of file; 0 found
-----------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------


FILE: C:\xampp\htdocs\drupal_commrence\modules\commerce_cashfree_payment\src\Plugin\Commerce\PaymentGateway\CashfreeRedirect.php
--------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------------------------
 1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
--------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------------------


FILE: C:\xampp\htdocs\drupal_commrence\modules\commerce_cashfree_payment\src\PluginForm\CashfreeRedirect\PaymentCashfreeForm.php
--------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------------------------
 1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
--------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------------------

Time: 239ms; Memory: 8MB
pinesh’s picture

Status: Needs review » Needs work
drupal-ramesh’s picture

Hi pinesh

Thanks for your valuable feedback.

When i run the command i found only 2 warnings. I have fixed those warnings.Kindly let me know how to get these errors. i have used below url as reference to check coding standards.
https://www.drupal.org/docs/8/modules/code-review-module/php-codesniffer...

pinesh’s picture

Status: Needs work » Needs review
avpaderno’s picture

Priority: Normal » Major

I am changing priority as per https://www.drupal.org/node/539608.

drupal-ramesh’s picture

Priority: Major » Critical
VishalSN’s picture

Hi Harish

Getting this when I tried to test the Deprecated module command.

------ -----------------------------------------------------------------------------------
Line commerce_cashfree_payment/src/Plugin/Commerce/PaymentGateway/CashfreeRedirect.php
------ -----------------------------------------------------------------------------------
Class
Drupal\commerce_payment\Plugin\Commerce\PaymentGateway\OffsitePayment
GatewayBase not found.
💡 Learn more at https://phpstan.org/user-guide/discovering-symbols
22 Class
Drupal\commerce_payment\Plugin\Commerce\PaymentGateway\OffsitePayment
GatewayBase not found.
💡 Learn more at https://phpstan.org/user-guide/discovering-symbols
------ -----------------------------------------------------------------------------------

------ -----------------------------------------------------------------------------------
Line commerce_cashfree_payment/src/PluginForm/CashfreeRedirect/PaymentCashfreeForm.php
------ -----------------------------------------------------------------------------------
Class Drupal\commerce_payment\PluginForm\PaymentOffsiteForm not
found.
💡 Learn more at https://phpstan.org/user-guide/discovering-symbols
15 Class Drupal\commerce_payment\PluginForm\PaymentOffsiteForm not
found.
💡 Learn more at https://phpstan.org/user-guide/discovering-symbols
------ -----------------------------------------------------------------------------------

Thanks

drupal-ramesh’s picture

Hi vishal

I have checked deprecated code using drupal check .No error in commerce cashfree and both the classes available in commerce payment.
Kindly give me more details about this error.

avpaderno’s picture

Assigned: Unassigned » avpaderno
Priority: Critical » Normal
Issue tags: -PAreview: single application approval

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.

avpaderno’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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