razorpay / magento
Razorpay Magento 2.0 plugin for accepting payments.
Installs: 61 645
Dependents: 1
Suggesters: 0
Security: 0
Stars: 28
Watchers: 184
Forks: 38
Type:magento2-module
Requires
- php: 7.*|^8.1
- razorpay/razorpay: 2.*
Suggests
- magento/module-checkout-agreements: 100.0.*
- dev-master-2.x
- 4.1.6
- 4.1.5
- 4.1.4
- 4.1.3
- 4.1.2
- 4.1.1
- 4.1.0
- 4.0.5
- 4.0.4
- 4.0.3
- 4.0.2
- 4.0.1
- 4.0.0
- 3.8.6-beta
- 3.8.5-beta
- 3.8.4-beta
- 3.8.3-beta
- 3.8.2-beta
- 3.8.1-beta
- 3.8.0-beta
- 3.7.5
- 3.7.4
- 3.7.3
- 3.7.2
- 3.7.1
- 3.7.0
- 3.6.4
- 3.6.3
- 3.6.2
- 3.6.1
- 3.6.0
- 3.5.3
- 3.5.2
- 3.5.1
- 3.5.0
- 3.4.1
- 3.4.0
- 3.3.1
- 3.3.0
- 3.2.3
- 3.2.2
- 3.2.1
- 3.2.0
- 3.1.3
- 3.1.2
- 3.1.1
- 3.1.0
- 3.0.0
- 2.9.4
- 2.9.3
- 2.9.2
- 2.9.1
- 2.9.0
- 2.8.1
- 2.8.0
- 2.7.1
- 2.7.0
- 2.6.1
- 2.6.0
- 2.5.0
- 2.4.0
- 2.3.0
- v2.2.0
- 2.1.1
- 2.1.0
- 2.0.4
- 2.0.3
- 2.0.2
- 1.1.24
- dev-magic_integration_latest_vanilla
- dev-po-187
- dev-po-240
- dev-magic_integration_latest
- dev-add_magic_integration_param
- dev-feature/gift-card-support-for-underarmour
- dev-magic_cod_engine_support
- dev-bugfix/fix-synchronous-order-placement
- dev-update_readme_column_not_found
- dev-magic_integration
- dev-version_bump_4.1.6
- dev-tabe_setup_notification_bug_fix
- dev-test-workflow
- dev-test_semgrep
- dev-get_order_webhook_data_bug_fix
- dev-version_bump_4.1.5
- dev-cancel_cron_om_bug_fix
- dev-version_bump_4.1.4
- dev-db_upgrade_fix
- dev-add_callback_url
- dev-magento_magic_demo_1
- dev-magento_magic_mini_cart
- dev-version_bump_4.1.3
- dev-check_for_paid_order_cancel_cron
- dev-table_setup_notification
- dev-add_debug_mode
- dev-fix_rzp_multi_order
- dev-version_bump_4.1.2
- dev-order_notes_addition
- dev-version_bump_4.1.1
- dev-security_akto_integration_1699637472
- dev-block_KWD_OMR_BHD_currencies
- dev-readme-add-faq
- dev-version_bump_4.1.0
- dev-reduce_db_latency
- dev-php8.2_support
- dev-remove_webhook_dependency
- dev-version_bump_4.0.5
- dev-reset_cart_graphql_increment_id_fix
- dev-graphql_rzp_undefined_fix
- dev-hosted_checkout_referer_option_additon
- dev-rzp-ut-final
- dev-ut-feat-cron-update-order_test_changes
- dev-ut-feat-cron_cancel_pending_order_test_changes
- dev-ut-feat-set_rzp_payment_details_for_order_resolver_test_changes
- dev-ut-feat-track_plugin_instrumentation_model_test_changes
- dev-ut-feat-cron-update-order_changes
- dev-ut-feat-track_plugin_instrumentation_model_changes
- dev-ut-feat-reset_cart_resolver_changes
- dev-ut-feat-reset_cart_resolver_test_changes
- dev-ut-feat-set_rzp_payment_details_for_order_resolver_changes
- dev-ut-feat-place_razorpay_order_resolver_test_changes
- dev-ut-feat-config_provider_model_test_changes
- dev-ut-feat-webhook_events_model_test_changes
- dev-ut-feat-payment_action_model_test_changes
- dev-ut-feat-paymentmethod_model_test_changes
- dev-ut-feat-paymentmethod_model_changes
- dev-ut-feat-order_controller_test_changes
- dev-ut-feat-order_controller_changes
- dev-ut-feat-config_model_test_changes
- dev-ut-feat-form_data_analytics_changes
- dev-ut-feat-form_data_analytics_controller_test_changes
- dev-ut-feat-validate_controller_test_changes
- dev-ut-feat-validate_controller_changes
- dev-ut-feat-base_controller_test_changes
- dev-ut-feat-callback_changes
- dev-ut-feat-callback_controller_test_changes
- dev-ut-feat-reset_cart_controller_test_changes
- dev-ut-feat-reset_cart_controller_changes
- dev-version_bump_4.0.4
- dev-readme-update-reset-cart-graphql
- dev-reset-cart-4.0.3
- dev-graphql_reset_cart
- dev-risk_referrer_url_addition
- dev-ut-code-changes
- dev-version_bump_4.0.3
- dev-dummy_20feb
- dev-PLUG-1355-reset-cart-cron
- dev-ut-feat-controller-mockapi
- dev-ut-feat-sonarqube
- dev-ut-feat-apimock
- dev-ut-feat-orderController
- dev-ut-feat-github-actions
- dev-onepage_checkout_redirect_issue
- dev-ut-test-3
- dev-ut-test-2
- dev-ut-test-1
- dev-rzp-ut-1
- dev-changes-in-pull_request_template
- dev-PLUG-1165-magento-order-email-issue
- dev-version_bump_4.0.2
- dev-TrackPluginInstrumentation_require_error
- dev-PLUG-1095-magento-setup-di-compile-command-giving-error
- dev-merchant-defined-status-for-completed-payment
- dev-fix-abstract-class
- dev-fix-abstract-class-issue
- dev-checkout_instrumentation_for_plugin
- dev-easy_signup_link
- dev-lumberjack-url
- dev-remove-php5.x-support
- dev-version_bump_4.0.1
- dev-instrumentation-datalake
- dev-test-segment-track
- dev-plugin-instrumentation-track
- dev-white-listing-lumberjack
- dev-php-support-for-version-8.1
- dev-version_bump_4.0.0
- dev-merge-3.8.6-beta-to-master
- dev-create_order_before_payment
- dev-version_bump_3.8.6-beta
- dev-mtest-2.x
- dev-release_update_notification
- dev-readme-cronjob-info
- dev-webhook_cron_order_status
- dev-fix-removal-of-webhook_secret
- dev-m-2.x
- dev-update-magento-cronjob-command
- dev-version_bump_beta-3.8.5
- dev-version_bump_3.8.4-beta
- dev-fix-cancel-rzp-order-only
- dev-version_bump_3.7.5
- dev-fix-razorpay-api-500-error
- dev-version_bump_3.7.4
- dev-version_bump_3.8.3-beta
- dev-beta-php-version-update
- dev-php-version-update
- dev-vas_checkout
- dev-version_bump_3.8.2-beta
- dev-auto_webhook_pagination
- dev-version_bump_3.8.1-beta
- dev-fix-webhook-for-order-not-confirm
- dev-create_auto_webhook
- dev-version_bump_3.8.0-beta
- dev-version_bump_beta-3.8.0
- dev-version_bump_beta-3.5.2
- dev-move_pending_orders_to_cancel
- dev-version_bump_beta-3.5.1
- dev-fix-order-confirmation-emails
- dev-fix-graphql-transactions
- dev-version_bump_beta-3.5.0
- dev-feature_graphql
- dev-version_bump_beta-3.4.1
- dev-test_version_bump_beta-3.4.2
- dev-test_version_bump_beta-3.4.1
- dev-OBP_fix_reset_cart
- dev-version_bump_beta-3.4.0
- dev-setup_upgrade_remove_default_config
- dev-fix_rzp_logger
- dev-fix_radio_and_logo
- dev-OBP_webhook_fix_authorize_only
- dev-quickfix_js_alert
- dev-api_namespace_check
- dev-code-owners_setup
- dev-OBP_refund_feature_addition
- dev-OBP_webhook_feature_addition_updated
- dev-OBP_auto_webhook_setup_on_RZP
- dev-OBP_webhook_feature_addition
- dev-fix_authorise_comments
- dev-semgrep_integration_1642755547
- dev-semgrep_integration_1641900519
- dev-disable_webhook_setting_multisite
- dev-semgrep_integration_1641830646
- dev-semgrep_integration_1641817051
- dev-subscription_resume_pause
- dev-callback_active_quote_check
- dev-version_bump_3.7.2
- dev-quote_1to1_map_with_same_order_amount
- dev-order_with_payment_review_status
- dev-add_webhook_at_frontent
- dev-version_bump_3.7.1
- dev-custom_cron_addition
- dev-fix_redirect_callback
- dev-added_cron_url
- dev-version_bump_3.7.0
- dev-addition_payment.authorized_webhook
- dev-webhook_cron_addition
- dev-version_bump_3.6.4
- dev-verify_paymentId_In_paymentMethod
- dev-refund_addition
- dev-webhook_amount_validation_with_order
- dev-updating_readme_disclaimer
- dev-version_bump_3.6.3
- dev-fix_unwanted_api_call
- dev-add_upgrade_notification
- dev-multi-gitter-branch
- dev-removed_currency_display_version_bump_3.6.3
- dev-webhook_localhost_validation_fix_version_bump_3.6.2
- dev-skip_addressvalidation_in_webhook
- dev-graphql_webhook_fix
- dev-version_bump_3.6.0
- dev-GraphQL_addition
- dev-webhook_signature_fix_version_bump_3.5.3
- dev-version_bump_3.5.2
- dev-fix_amount_paid_mismatch
- dev-fix_composer_bump_3.5.1
- dev-version_bump_3.5.0
- dev-adding_rzp_webhook
- dev-feature/magento-subscription
- dev-ver_bump_3.4.1
- dev-fixed_duplicate_quote_in_razorpay_table
- dev-webhook_addition
- dev-fix_logger_with2.4
- dev-ver_bump_3.4.0
- dev-new_order_link_table_addition
- dev-version_bump_3.3.1
- dev-bind_rzp_order_with_quote_shipping
- dev-fix_display_amount
- dev-fixed_cature_amount_mismatch_version_bump_3.3.0
- dev-fix_shipingSaveForVirtual_version_bump_3.2.3
- dev-added_delay_avoid_duplicate_version_bump_3.2.2
- dev-Add_shipping_prosessor_in_global
- dev-webhook_multistore_id_fix_version_bump_3.2.1
- dev-fix_shipping_billing_address
- dev-version_bump_3.2.0
- dev-webhook_event_dispatcher_addition
- dev-fix_optional_address_fields_version_bump_3.1.3
- dev-fix_new_shipping_address_version_bump_3.1.2
- dev-fix_new_shipping_address_version_bump_3.1.1
- dev-version_bump_3.1.0
- dev-fix_order_item_original_price
- dev-add_log_handler
- dev-fixed_webhook_paymentId
- dev-VAS_checkout_bug_fix
- dev-version_bump_3.0.0
- dev-VAS_checkout_support
- dev-pay_by_cred_addition
- dev-add_pending_status
- dev-hosted_checkout
- dev-fix_webhook_duplicate_order
- dev-fixed_duplicate_order_version_bump_2.9.3
- dev-fixed_csrfValidation_version_bump_2.9.2
- dev-fixed_csrfValidation_version_bump_2.9.1
- dev-update_version_2.9.0
- dev-add_webhook_feature
- dev-update_version_2.8.1
- dev-update_order_currency
- dev-add-phpunit-test
- dev-fix_order_in_rzp_dash
- dev-add_travis_ci
- dev-fix_auth_capture_sig
- dev-fix-composer-magento-dependency
- dev-master-2.x-redirect
- dev-js-fixes
- dev-master-2.x-redirectflow
- dev-order_Status
- dev-magento2.2-support
- dev-redirect_plugin
- dev-order_id
- dev-webhooks
- dev-multiple_address_order_fix
- dev-invoice_manual
- dev-admin_order
- dev-auto_invoice
- dev-add_final_order_status
This package is auto-updated.
Last update: 2024-12-03 05:16:10 UTC
README
This extension utilizes Razorpay API and provides seamless integration with Magento, allowing payments for Indian merchants via Credit Cards, Debit Cards, Net Banking, Wallets and EMI without redirecting away from the magento site.
Installation
Install through the "code.zip" file
bin/magento
is executable command, this is to be executed from Magento installation directory.
- Extract the attached code.zip
- Go to the "app" folder
- Overwrite content of the "code" folder with step one "code" folder (Note: if the code folder does not exist just place the code folder from step 1).
- Run following command to enable Razorpay Magento module:
bin/magento module:enable Razorpay_Magento
- Run following command to install Magento cron jobs :
bin/magento cron:install
- Run
bin/magento setup:di:compile
to compile dependency code. - Run
bin/magento setup:upgrade
to upgrade the Razorpay Magento module from the Magento installation folder. - On the Magento admin dashboard, open Razorpay payment method settings and click on the Save Config button. Note: If you see this message highlighted in yellow (One or more of the Cache Types are invalidated: Page Cache. Please go to Cache Management and refresh cache types.) on top of the Admin page, please follow the steps mentioned and refresh the cache.
- Run
bin/magento cache:flush
once again.
OR
Install the extension through composer package manager.
composer require razorpay/magento
bin/magento module:enable Razorpay_Magento
You can check if the module has been installed using bin/magento module:status
You should be able to see Razorpay_Magento
in the module list
Execute following commands from Magento installation directory:
bin/magento setup:di:compile
bin/magento setup:upgrade
bin/magento cache:flush
Go to Admin -> Stores -> Configuration -> Payment Method -> Razorpay
to configure Razorpay
If you do not see Razorpay in your gateway list, please clear your Magento Cache from your admin panel (System -> Cache Management).
Setting up the cron with Magento
Setup cron with Magento to execute Razorpay cronjobs for following actions:
Cancel pending orders
It will cancel order created by Razorpay as per timeout saved in configuration if Cancel Pending Order is enabled.
Update order to processing
Accepts response from Razorpay Webhook for events payment.authorized
and order.paid
and updates pending order to processing.
Magento cron can be installed using following command:
bin/magento cron:install
Working with GraphQL
Razorpay GraphQL Support added with Magento ver. 2.3.6
Order flow for placing Magento Order using Razorpay as payment method with GraphQL
- set Payment Method on Cart
mutation {
setPaymentMethodOnCart(input: {
cart_id: "{{cart_ID}}"
payment_method: {
code: "razorpay"
}
}) {
cart {
selected_payment_method {
code
}
}
}
}
- Place Magento Order
mutation {
placeOrder(input: {cart_id: "{{cart_ID}}"}) {
order {
order_number
}
}
}
- Create Razorpay Order ID against the Magento Order ID and the checkout page URL as referrer.
mutation {
placeRazorpayOrder (
order_id: "{{order_ID}}"
referrer: "{{referrer}}"
){
success
rzp_order_id
order_id
amount
currency
message
}
}
-
Use Razorpay Order ID
rzp_order_id
and other details from step-3 and create frontend form using razorpay's checkout.js , complete the payment and obtain razorpay_payment_id & razorpay_signature https://razorpay.com/docs/payment-gateway/web-integration/standard/ -
Save Razorpay Response Details against Cart after payment success with Magento orderID, RZP paymentId , orderId and signature
mutation {
setRzpPaymentDetailsForOrder (
input: {
order_id: "{{order_ID}}"
rzp_payment_id: "{{RAZORPAY_PAYMENT_ID}}"
rzp_signature: "{{RAZORPAY_SIGNATURE}}"
}
){
order{
order_id
}
}
}
- Pass the Magento Order ID to reset the cart.
mutation {
resetCart (
order_id: "{{order_ID}}"
){
success
}
}
Upgrade Razorpay plugin through composer
If you are an existing user, you can upgrade the Magento extension using the composer. Enter the command given below:
composer update razorpay/magento
bin/magento setup:upgrade
Using Custom Order Status in Razorpay Magento
Step 1: Create Custom Order Status
- On the Magento Admin Dashboard, Stores > Settings > Order Status.
- In the upper-right corner, click on Create New Status.
- Under Order Status Information section, Insert a Status Code for the internal reference. This field required to contain letters (a-z), the number (0-9) and the underscore, it is required to use letters at first character and the rest can be a combination of letters and numbers.
- Set the Status Label for Admin and storefront.
- Set the Store View specific labels for each store view on your store.
- Save status to complete.
Step 2: Un-assign existing status
- Un-assign existing status code which is in use.
- If State Code and Title is
processing[Processing]
, thenprocessing
status is already in use for stateprocessing
. - Un-assign this status from existing state code
processing
, so that state will be available for your custom status code.
- If State Code and Title is
Step 3: Assign an order status to a state
- Go to the Order Status page, click on Assign Status to State button.
- In the Assign Order Status to State section,
- From the existing list of the order status, select the Order Status to assign.
- Choose the Order State to include the order status you’ve just assigned. Use Order state as
processing
- Accept the order status as a default status, tick the Use Order Status as Default checkbox.
- Enable the order status on the storefront, please tick the Visible On Storefront checkbox.
- Click on
Save Status Assignment
to complete.
Step 4: Using Custom order status for Razorpay Magento
- On the Magento admin dashboard, open Razorpay payment method settings.
- At field
Custom Paid Order Status
selectYes
to enable custom order status, selectNo
to disable custom order status. - Insert Custom Paid Order Status value at input field provided with same value which has been used as Status Code while creating custom status.
- Save configuration & refresh the cache.
Uninstall OR Rollback to older versions
To rollback, you will be required to uninstall existing version and install a new version again. Following are actions used for rollback & reinstall:
Uninstall Razorpay Magento
If composer is used for installation, use following commands from Magento installation directory to uninstall Razorpay Magento module
php bin/magento module:disable Razorpay_Magento
php bin/magento module:uninstall Razorpay_Magento
If code.zip is used for installation, to uninstall following steps can be used: Disabled Razorpay Magento module
php bin/magento module:disable Razorpay_Magento
To remove module directory, execute following command from Magento install directory
rm -rf app/code/Razorapy
Remove module schema from MYSQL database
DELETE FROM `setup_module` WHERE `setup_module`.`module` = 'Razorpay_Magento';
Re-Install Razorpay Magento
To install Razorpay Magento module, follow installation steps provided at this release document. Following are previously released versions 3.7.5 and 4.0.4.
FAQ
How to upgrade plugin using code.zip?
Download the latest code.zip and replace all the contents of the code folder with the new code.zip content. Then follow the same steps which are there for installation through code.zip.
I am getting the following error message "Column not found: 1054 Unknown column 'main_table.rzp_webhook_notified_at' in 'field list', query was: SELECT main_table.entity_id, main_table.rzp_webhook_notified_at FROM sales_order AS main_table."
If you encounter this error message, update the plugin to the latest version to resolve the issue.
Support
Visit https://razorpay.com for support requests or email contact@razorpay.com.