- Flatsome UX Builder?
- How To Enable ActiveCampaign With CartFlows?
- How to Enable Paypal Reference Transactions?
- How Does Paypal/Stripe Work in the Case of Cartflows?
- How to Enable Enfold Avia Layout Builder in CartFlows Steps?
- How to Setup Authorize.net Gateway for the Cartflows Upsell & Downsell?
- List of all the Supported Payment Gateways by CartFlows
- How to Setup A/B Testing with Google Optimize for CartFlows?
- How to Set Quantity and Discount for Product on the Checkout Page.
- How to Add the Custom Support of any Payment Gateway for One-Click Upsell & Downsell in the CartFlows?
- How to Create the Subscription Product in WooCommerce & Assign it on CartFlows Pages?
- Which Multi-Currency Plugin does CartFlows Support?
- How to Enable/Disable the Shipping Fields & Ship to Different Address on CartFlows Checkout Page?
- How to Enable/Insert Coupons on the CartFlows Checkout page?
- How to Display the “Account Creation Fields” on CartFlows Checkout Page?
- How to Setup Square Gateway for the Cartflows Upsell & Downsell?
- Elementor Widgets of CartFlows
- Beaver Builder Modules of CartFlows
- Introduction to Gutenberg Blocks of CartFlows
- How to import Divi templates?
- How To Use CartFlows With Your Own Template?
- How To Use CartFlows With Beaver Builder?
- How To Use CartFlows With Thrive Architect?
- How to Hide Checkout Fields from the Checkout Page?
- Global Checkout
- How To Use WooCommerce?
- How To Install WooCommerce?
- General Settings Overview
- How To Use Your Themes Header & Footer In A Step?
- How To Embed A Checkout Form on the CartFlows Checkout page?
- How to Enable Webhooks in WooCommerce Cart Abandonment Recovery Plugin?
- Shortcode Reference for Email Fields in Cart Abandonment
- Filters to Customize Product Table
- Cart Recovery Emails not Sending [Cart Abandonment]
- Abandoned Orders Not Capturing [Cart Abandonment]
- How to Resolve the Recovery Email Going to Spam?
- Cart Abandonment Cookies/GDPR Compliance
- Configuring WooCommerce Cart Abandonment Recovery Settings
- Flow In Test Mode
- How to Troubleshoot a Conflict with the Plugin & Theme?
- How to Solve the Never-Ending Loading Issue on the Checkout Page?
- How to Solve the “Order Not Found” Error Message on the Thank You Page?
- How to resolve “Checkout ID not Found” Error message?
- How to Resolve “Session Expired” Error message?
- How to Resolve “Order Does not Exist Error” on Upsell & Downsell Page?
- How to Resolve “Sorry this product cannot be purchased” Error Message?
- How to Resolve “No product is selected…” error message?
- What to Do if the Order Status is Stuck at MainOrderAccepted?
- How to Turn Off the Auto-fill of Address Fields on Entering Zip-Code?
- How to Enable the Theme’s Scripts & Styles without Changing the Page Template?
- How to Turn Off the Auto-fill of Checkout Fields?
- How to Allow Cache Plugins to Cache the CartFlows Pages?
- How to Change the “Choose A variation” text?
- VAT Field of WooCommerce EU/UK VAT Compliance (Premium) plugin is not displaying.
- How to enable the product tab on store checkout
- How to show the order summary open on mobile devices
How to Add the Custom Support of any Payment Gateway for One-Click Upsell & Downsell in the CartFlows?
In this article, we will see the step-by-step guide to add your Custom Support for your Payment Gateway in the CartFlows for the Upsell & Downsell.
To add the custom support of your Payment Gateway below are the few simple steps to follow –
Step 1: Adding the Class & file name in the CartFlows gateway’s library.
In this step, you need to decide the file name and the Class name which you want to use in the Custom Support for your Payment Gateway. After deciding the name of the file & class you need to add those names in the CartFlows Gateway library.
To add it navigate to the CartFlows Pro’s directory then into Classes folder and open a class-cartflows-pro-gateways.php file.
Now, find the function named as “get_supported_gateways” and add your class & files name in the already provided array. OR you can use the following filter to add your class & file name without touching the CartFlows Code.
add_filter( 'cartflows_offer_supported_payment_gateways', 'your_function_name' );
/**
* Add new payment gateway in Supported Gateways.
*
* @param array $supported_gateways Supported Gateways by CartFlows.
* @return array.
*/
function your_function_name( $supported_gateways ){
$supported_gateways['payment_gateway_slug'] = array(
'file' => 'yourfilename.php', // Your Custom code's file name
'class' => 'YourClassName', // Class name used in the Custom Code's file.
'path' => 'FullDirectoryPathofTheFile', // Full directory path of the custom code's file.
);
return $supported_gateways; // Adding the payment gateway name.
}
Note: The path variable should only be used if you want to add custom support for the gateway from your theme or plugin. If you are adding your custom code file in the CartFlows Pro directory then follow Step 3.
Step 2: What to write in the custom code’s file
Create a function named as “process_offer_payment”. This function will be called automatically by the CartFlows in order to process the charge for Upsell & Downsell if they are accepted by the user.
So, all your business logic should be added in this function.
Step 3: Add your custom code’s file at the right place
To add the custom code’s file where you have written the code to add the support for Upsell & Downsell. So navigate to the cartflows-pro/modules/gateways directory and place your file.
For the reference on what is written in the “process_offer_payment” function you can take a look at the other payment gateway files that are currently available in the cartflows-pro/modules/gateways directory.
In this way you can add your payment gateway’s Custom Support in the CartFlows so that you can add the support for Upsell & Downsell.
Note: We have a sample plugin for your reference to add a custom integration of payment gateways of your choice, you can download the sample plugin from Here.
We don't respond to the article feedback, we use it to improve our support content.