Charge Anywhere is a PrestaShop extension that enables merchants to accept payments from their customers through various payment gateways. In this article, we will discuss the features, benefits, and installation of Charge Anywhere.
Features of Charge Anywhere:
- Integration with multiple payment methods: Charge Anywhere supports various payment methods like debit and credit cards (Visa, Mastercard, Amex, Discover, Union Pay, and JCB) and electronic fund transfer (ACH).
- Customizable checkout page: Merchants can customize the checkout page to match the look and feel of their online store, or they can add custom fields to collect additional information from customers.
- Recurring payments: Merchants can set up recurring payment plans for customers who want to make regular purchases.
- Security: Charge Anywhere uses industry-standard encryption and authentication protocols to ensure that all payment data is transmitted securely.
Benefits of Charge Anywhere:
- Easy mode switching: The extension can be configured for both sandbox and production accounts, making it easy to switch between modes.
- Gateway email option: The extension provides a gateway email option for both the vendor and customer, ensuring seamless communication.
- No private SSL required: The extension does not require a private SSL, reducing the hassle and cost of acquiring one.
- Transaction types: The extension supports both authorization and capture transaction types, providing flexibility to users.
- Refund option: The extension provides a refund option, allowing users to customize the refund status.
- Capture option: The extension provides a capture option, allowing users to customize the capture status.
- Easy to install and configure: Charge Anywhere is very easy to install and configure, and it can be set up in just a few minutes.
- Fast and reliable: Charge Anywhere allows merchants to accept payments from their customers in a fast, secure, and reliable manner.
Installation of Charge Anywhere:
To install the Charge Anywhere PrestaShop extension, please follow these steps:
- Download the Charge Anywhere extension module file and unzip (decompress) it on your computer.
- Once the extension has been downloaded, log in to your PrestaShop admin panel.
- Navigate to Modules -> Module Manager, from the left sidebar. You will find a blue button, “Upload a module”(in the top right corner). Simply upload the zip file, which was recently downloaded in step 1.
Configure the Extension
- On the Module Manager page, from the left sidebar. Click on the ‘Configure’ button next to Payments by Charge Anywhere to configure it with your desired settings.
- Enter your Charge Anywhere account details, including your Merchant ID, Terminal ID, and Secret. You can also configure other settings such as API mode and Capture Status.
- If you do not possess the necessary API credentials, refer to this comprehensive configuration guide on obtaining Charge Anywhere Plugin credentials through a step-by-step approach.
- Charge Anywhere Payment Gateway Settings
- The table lists the attributes that can be configured for the Charge Anywhere Payment Gateway.
- Each attribute comes with a description and available options.
- The attributes can be customized based on business requirements and preferences.
- The customization helps to provide a smooth and secure payment experience for customers.
Attributes | Description |
---|---|
Merchant ID | Unique identification number provided by Charge Anywhere. |
Terminal ID | Unique identification number provided by Charge Anywhere. |
Secret | The payment status of the initial transaction. |
API Mode | Allows you to select the API Mode. Choose between Sandbox/Developer API Mode and Live/Production API Mode. |
Transaction Mode | Allows you to select authorized only, or captured immediately. If you are not sure what to use, set it to Authorize. |
Initial Payment Status | The payment status of the authorize transaction. |
Capture Payment Status | The payment status of the captured transaction. |
Refund Payment Status | Payment status of the refunded transaction. |
Email To Customer | Enables or disables sending a default email to the customer from Charge Anywhere. |
Email To Merchant | Enables or disables sending a default email to the merchant from Charge Anywhere. |
Accept Credit | Enables or disables accepting credit cards as a payment method. |
Accept ACH | Enables or disables accepting ACH payments as a payment method. |
- If credit card payments are enabled you will see the following options:
Attribute | Description |
---|---|
Add Service Fee | This attribute allows you to enable or disable adding a service fee to the payment amount. |
Service Fee Label | This attribute allows you to set the label for the service fee. |
SF | This attribute allows you to set the default service fee percentage. |
Service Fee Percentage (%) | This attribute allows you to set the service fee percentage for a specific transaction. |
Include Tax Amount in Service Fee Calculation | This attribute allows you to include the tax amount in the service fee calculation. |
Refund Service Fee on a Return | This attribute allows you to enable or disable refunding the service fee in case of a return. |
Add Convenience Fee | This attribute allows you to enable or disable adding a convenience fee to the payment amount. |
Convenience Fee Label | This attribute allows you to set the label for the convenience fee. |
Convenience Fee Amount ($) | This attribute allows you to set the convenience fee amount for a specific transaction. |
Refund Convenience Fee on a Return | This attribute allows you to enable or disable refunding the convenience fee in case of a return. |
- If ACH payments are enabled you will see the following options:
Attribute | Description |
---|---|
Add Service fee | This attribute allows you to add a service fee for ACH payments. |
Service Fee Label | This attribute requires you to enter the label for the Service Fee. |
Service Fee Percentage (%) | This attribute requires you to enter the percentage amount of the Service Fee for ACH payments. |
Include Tax Amount in Service Fee Calculation | This attribute allows you to include the tax amount in the Service Fee calculation. |
Refund Service Fee on a Return | This attribute allows you to enable or disable refunding the Service Fee when a return is made. |
Add Convenience Fee | This attribute allows you to add a convenience fee for ACH payments. |
Convenience Fee Label | This attribute requires you to enter the label for the Convenience Fee. |
Convenience Fee Amount ($) | This attribute requires you to enter the fixed amount of the Convenience Fee for ACH payments. |
Refund Convenience Fee on a Return | This attribute allows you to enable or disable refunding the Convenience Fee when a return is made. |
- Once the configuration is complete, it is important to test the module immediately to confirm that it functions as planned.
Additional Steps
Service Fee & Convenience Fee in Email attachment and Invoice
File 1: classes/pdf/HTMLTemplateInvoice.php
- Locate the method
getContent()
within the fileHTMLTemplateInvoice.php
. - Insert the following code snippet above the line
$footer = [ 'products_before_discounts_tax_excl' => $this->order_invoice->total_products, 'product_discounts_tax_excl' => $product_discounts_tax_excl,
// Charge anywhere fee to be shown in the email pdf file
$result = Db::getInstance()->executeS(‘SELECT * FROM ‘.DB_PREFIX.’chargeanywhere_sales_order WHERE cart_id = ‘.(int) $this->order->id_cart);
$chargeanywhere_fee = 0;
$fee_label = ”;
$chargeanywhere_conv_fee = 0;
$conv_label = ”;
$type_method = ”;
// Charge anywhere fee to be shown in the email pdf file
$result = Db::getInstance()->executeS('SELECT * FROM '._DB_PREFIX_.'chargeanywhere_sales_order WHERE cart_id = '.(int) $this->order->id_cart);
$chargeanywhere_fee = 0;
$fee_label = '';
$chargeanywhere_conv_fee = 0;
$conv_label = '';
$type_method = '';
if (count($result) > 0) {
$result = $result[0];
if ($result['fee'] != 0) {
$fee_label = $result['fee_label'];
$chargeanywhere_fee = $result['fee'];
}
if ($result['conv_fee'] != 0) {
$conv_label = $result['conv_label'];
$chargeanywhere_conv_fee = $result['conv_fee'];
}
$type_method = 'chargeanywhere';
$this->order_invoice->total_paid_tax_incl += $chargeanywhere_fee + $chargeanywhere_conv_fee;
}
- Scroll down within the same
getContent()
method. - Insert the following code snippet below the line
$data = [ 'order' => $this->order, 'order_invoice' => $this->order_invoice, 'order_details' => $order_details,
'fee_label' => $fee_label,
'conv_label' => $conv_label,
'chargeanywhere_service_charges' => $chargeanywhere_fee,
'chargeanywhere_conv_charges' => $chargeanywhere_conv_fee,
File 2: themes/[theme-dir]/pdf/invoice.total-tab.tpl
- Copy the file
invoice.total-tab.tpl
to thethemes/[theme-dir]/pdf/
directory.
- Ensure that you’ve made the necessary changes as mentioned above for the
HTMLTemplateInvoice.php
file before proceeding with this step. - Once you’ve completed the above instructions, the Prestashop code should include the additional fields and the
invoice.total-tab.tpl
template file should be copied to the appropriate location.
Please note that modifying Prestashop code directly may have implications for future updates and compatibility. It is recommended to back up your code and test thoroughly before deploying these changes in a production environment.
Cookies settings
If you’re facing a problem where users get logged out after making a payment in Prestashop, follow these steps to resolve it:
- Access Prestashop Backend: Start by logging into your Prestashop backend using your admin credentials.
- Navigate to Configuration: Once logged in, go to the “Configure” section. You can usually find this in the left-hand sidebar menu.
- Access Advanced Parameters: Within the “Configure” section, look for and click on “Advanced Parameters.”
- Access Administration Settings: Under “Advanced Parameters,” you’ll see various configuration options. Click on “Administration” to access settings related to your Prestashop administration.
- Configure Cookie SameSite: You’ll find a sub-menu labeled “General”. Look for the setting named “Cookie SameSite.” By default, this setting is often set to “Lax,” which can sometimes cause login issues after payments. Change it to “NONE.”
- Save Changes: After selecting “NONE” for the “Cookie SameSite” setting, make sure to save your changes.
- Test the Solution: To ensure the issue is resolved, have a user make a payment and verify that they are not logged out after completing the transaction.
That’s it! The Charge Anywhere extension is now installed and ready to use in your PrestaShop store.
Capture or Refund
To capture (force) or refund payment in PrestaShop, start by accessing the Main Menu, then go to Sell, select Orders, and click on View for the specific order you want to process. Here, you can set the order status to either “Refunded” or “Payment Accepted” to initiate the desired action.
Please keep in mind that the exact steps may slightly vary depending on your payment gateway configuration. It’s important to note that payments that are authenticated only cannot be refunded, and setting the status as “complete” for a payment that has already been captured won’t affect the ledger. Always ensure accuracy and transparency when managing payment transactions in PrestaShop.