Magento
Accept payments for your e-commerce through Magento
Magento (also known as Adobe Commerce) is an open source e-commerce platform written in PHP. Magento Open Source source code is distributed under Open Software License v3.0.
Because of these reasons, Kushki looked to integrate their payment methods by creating a plugin that allows card payments. You will find the details of the installation and administration below.
Accept ✅ | Does not accept ❌ |
---|---|
Credit and debit card payments | Recurring charges |
Cash payments | Authorization and capture |
Transfers | |
OTP and 3DS authentication | |
Full refunds |
Requirements
- Magento 2.3.x and up to 2.4.2 for optimal compatibility.
Installation and setup
The plugin source code can be downloaded from our official repository:
Download1. Installation
Requirements:
- You must download the Kushki payment module in .zip format.
- You must have Magento installed and configured with the type of currency you will use.
- You must have access to the Magento administration section.
Follow these instructions to install the Kushki plugin on your Magento store:
1.1. Extract the content of the .zip file.
1.2. In the Adobe Commerce installation directory, go to app > code (in case it does not exist, you must create the code folder) and paste the folder extracted from step 1. The final path should be app > code > Kushki > Payment.
1.3. Upgrade Magento. Using an SSH terminal, run the following command in the Magento 2 root directory: php bin/magento setup:upgrade
.
1.4. Compile the setup by running the following command: php bin/magento setup:di:compile
.
1.5. Deploy the static content. Run the following command in the Magento 2 root directory: php bin/magento setup:static-content:deploy
.
1.6. Finally, clear the cache by running the command: php bin/magento cache:flush
.
2. Configuration
2.1. Enable Kushki in your Magento store
2.1.1. Go to Store > Configuration > Sales > Payment Methods > Kushki Payment, enable the Kushki payment plugin by changing to Yes on the Enabled section.
Once you have enabled the Kushki payment method, the credentials fields and other options will be displayed.
2.1.2. Add the payment title that will be displayed at the customer’s front-end.
2.1.3. Add the public and private keys. These credentials can be found in the Kushki administration console, in the Developers section, Credentials option.
2.1.4. Define the environment for the requests to be sent to the Kushki server with the option Enable Test Mode
:
- For test environment select
YES
- For production environment select
NO
2.1.5. Allow customers to pay from any country in the Payment from Applicable Countries section or restrict to the list of countries in the Payment from Specific Countries section.
2.1.6. Enter the minimum and maximum value to restrict payment based on the total amount (Optional)
2.1.7. In the Sort order option, adjust the position of the checkout that will be displayed on your website when making a payment (Optional)
2.2. Configure your Magento credentials in the Kushki Console
For the payments you receive by transfer or cash to work properly, it is necessary to configure the credentials that Magento provides you with in the Integrations section.
2.2.1. Obtain the Magento credentials.
Follow these instructions to get the Magento integration credentials:
2.2.1.1. From your Magento store, go to System > integrations.
2.2.1.2. Once logged in, click on the Add New Integration button to generate a new integration. A new window will open to enter the integration information.
2.2.1.3. Add a name for the new integration (for example, Kushki) and click the Save button to save the new integration. The system will return you to the screen with the list of all available integrations.
2.2.1.4. Click on Activate and then click on the Allow button. You will see on the screen the credentials required to configure within the Kushki console.
2.2.1.5. Finally, click Done to finish the activation.
The following GIF will show you the process of how to get your Magento credentials:
2.2.2. Enter your Magento credentials in the Kushki Console
2.2.2.1. Login to your Kushki console.
2.2.2.2. Go to Settings > Integrations > Plugins. The available e-commerce plugins will be displayed.
2.2.2.3. Select Magento and proceed to customize the content and style of your form.
2.2.2.4. In the form, in the enter your credentials section, you must enter the Consumer key
, Consumer secret
, Access token
and Access token secret
generated by Magento (step 2.2.2) for authentication purposes OAuth between Magento and Kushki. In the domain
field, enter your merchant’s domain.
2.2.2.5. Click on the Verify tokens button to validate the credentials.
2.2.2.6. If the credentials provided are correct, and you have finished configuring the other fields of the payment form, click on the Save form button located at the left bottom of your screen next to the cancel button.
2.3. Customize your payment form on the Kushki Console
When you link your Magento store with Kushki, it will add our payment form in default version with predefined colors and styles. To customize your payment form (Kajita) in your Magento store, please follow these steps:
2.3.1. Log in to your Administration console and go to the Settings section.
Navigate the page until you find the Integrations section.
2.3.2. Click on Plugins.
2.3.3. Select Magento. A message will be displayed.
2.3.4.Click on the Customize the content and style of your form message. Your Kajita for Magento will appear.
Follow the instructions given in Customize your payment form to customize the payment form for your Magento store.
3. Plugin operation
Now that the plugin is installed and configured, it’s time to see how to operate with it.
3.1. Magento order statuses
In Magento we can have different states for an order. Below are the possible states of an order with the plugin:
- Pending: The status of new orders that have not been processed yet.
- Processing: It means that the order has been billed or shipped, but not both.
- Complete: Orders marked as complete have been billed and shipped fully.
- Canceled: Payment of the order has not been made.
- Closed: Payment for the order has been refunded.
3.2. Process one-time card payments
To process one-time payments with credit and debit cards , you need to have the One-time payments option selected at the top and the Credit and Debit Card option selected in the Payment Options > Payment Methods section within the Kushki console on the following path: Settings > Integrations > Plugins > Magento > Customize your form content and style.
Once a new order is generated, you will see the transaction in the order list (Sales > Orders) with the status Processing, which indicates that the payment has been completed.
When the ship is completed, the order status will change to Complete which indicates that both ship and payment have been successfully completed.
3.3.Process payments with transfer
To process transfer payments, you need to have the One-time payment option selected at the top, and the Transfer option selected in the Payment options > Payment methods section within the Kushki console in the following path: Settings > Integrations > Plugins > Magento > Customize your form content and style.
Once a new order is generated, you will see the transaction in the order list (Sales > Orders) with the status Pending, which indicates that the payment is waiting to be processed. Once the money transfer has been successfully completed, the order status will change to Processing, indicating that the transaction was successfully completed.
3.4. Process cash payments
To process cash payments, you need to have the One-time payment option selected at the top and the Cash option selected in the Payment options > Payment methods section within the Kushki console at the following path: Settings > Integrations > Plugins > Magento > Customize your form content and style.
Once a new order is generated, we can see the transaction in the Magento store in the order list (Sales > Orders) with the status Pending, which indicates that the payment is waiting to be processed. Once the payment has been successfully made, the order status will change to Processing, indicating that the transaction was successfully completed.
3.5. Request a refund
Follow these instructions to request a refund for approved transactions made with debit and credit card .
3.5.1. Log in to Magento with your merchant credentials.
3.5.2. Click on the Sales > Orders option in the left side menu.
3.5.3. Click View on the order to be refunded. The transaction must be in Processing status for the refund to be made.
3.5.4. Click on the Credit Memo section in the top menu.
3.5.5. Click the Refund Offline button to complete the refund. The transaction status will change to Closed, stating that the refund was requested.
Refunds can be of two kinds, depending on the day and time the original transaction and the cancellation request are processed:
- Cancellation (void): When the refund request is made on the same day of the transaction before the deadline, which varies by country, the cancellation occurs immediately.
- Refund: When the refund request is made after the deadline. The process may take up to 45 days to be reflected as a credit note on the customer’s account.
These are the cancellation deadlines by country:
Chile | Colombia | Ecuador | México | Perú |
---|---|---|---|---|
Up to 3 hours after the transaction is approved. | 20:59 hours on the day of the transaction. | 21:00 hours on the day of the transaction. | 23:59 hours on the day of the transaction. | 20:59 hours on the day of the transaction. |
4. Uninstallation
4.1. In the Magento installation directory, go to app > code and remove the folder that contains the Kushki source code.
4.2. Find the module named Kushki_Payment
and remove the module entry from the setup_module
database table.
4.3. The Kushki_Payment
module must be removed from app > etc > config.php as well.
4.4. Upgrade Magento. From an SSH terminal, run the following command in the root of the Magento2 directory: php bin/magento setup:upgrade.
4.5. Compile the installation by executing the following command: php bin/magento setup:di:compile
4.6. Deploy the static content. Run the following command in the Magento2 root directory: php bin/magento setup:static-content:deploy.
4.7. Finally, clear the cache by executing the command: php bin/magento cache:flush.
5. Test your integration
There are test cards that you can use in test mode to make sure your integration is ready. Use them with any CVC and an expiration date higher than the current one.
- Approved transaction:
5451951574925480
- Declined transaction on token request (front-end):
4574441215190335
- Declined transaction on collection request (back-end):
4349003000047015