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.
bin/magento
is executable command, this is to be executed from Magento installation directory.bin/magento module:enable Razorpay_Magento
bin/magento cron:install
bin/magento setup:di:compile
to compile dependency code. bin/magento setup:upgrade
to upgrade the Razorpay Magento module from the Magento installation folder.bin/magento cache:flush
once again.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
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).
Setup cron with Magento to execute Razorpay cronjobs for following actions:
It will cancel order created by Razorpay as per timeout saved in configuration if Cancel Pending Order is enabled.
Accepts response from Razorpay Webhook for events payment.authorized
and order.paid
and updates pending order to processing.
bin/magento cron:install
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
}
}
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
processing[Processing]
, then processing
status is already in use for state processing
.processing
, so that state will be available for your custom status code.processing
Save Status Assignment
to complete.Custom Paid Order Status
select Yes
to enable custom order status, select No
to disable custom order status.To rollback, you will be required to uninstall existing version and install a new version again. Following are actions used for rollback & reinstall:
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';
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.
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.
If you encounter this error message, update the plugin to the latest version to resolve the issue.
Visit https://razorpay.com for support requests or email contact@razorpay.com.