- Google Address Autocomplete
- Flatsome UX Builder
- ActiveCampaign
- Paypal Reference Transactions
- How PaypPal/Stripe Works
- Enabling Enfold Avia Layout Builder
- Setting Up Authorize.net for Upsell & Downsell
- Supported Payment Gateways
- Setting Up A/B Testing with Google Optimize
- Setting Quantity and Discount for Products on the Checkout Page
- Adding Custom Support for Payment Gateways in One-Click Upsell & Downsell
- Creating Subscription Products in WooCommerce for CartFlows Pages
- Supported Multi-Currency Plugins
- Enabling/Disabling Shipping Fields and Ship to Different Address
- Enabling/Adding Coupons on the Checkout Page
- Displaying Account Creation Fields on the Checkout Page
- Setting Up Square Gateway for Upsell & Downsell
- CartFlows Elementor Widgets
- CartFlows Beaver Builder Modules
- CartFlows Block Editor Blocks
- Importing Divi Templates
- Bricks Builder
- SureTriggers
- Connecting Stripe Payment Gateway
- LearnDash
- Facebook Pixel
- Using CartFlows with Custom Templates
- Using CartFlows with Beaver Builder
- Hiding Checkout Fields on the Checkout Page
- Global Checkout
- Using WooCommerce
- Installing WooCommerce
- General Settings Overview
- Using Your Theme's Header & Footer in a Step
- Embedding a Checkout Form on the CartFlows Checkout Page
- Hiding WooCommerce Pages and Products
- CartFlows Dynamic Offers aka Rule Engine.
- CartFlows Instant Layout for Checkout & Thank You Step
- How to Add the Products on the Checkout Page via URL
- How to A/B Test the CartFlows Steps?
- How to create Google Address API Key
- How to Delete the Plugin’s Data While Un-Installing the Plugin
- How to Import the Ready-Made Templates for Flows and Steps in CartFlows?
- How To Import/Export Funnels & Individual Page Builder Templates?
- URL Parameters
- How to Replace the Main Checkout Order with the Upsell/Downsell?
- 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
- Setting Up WooCommerce Cart Abandonment Recovery
- Flow In Test Mode
- How to Troubleshoot a Conflict with the Plugin & Theme?
- Resolving the "Please select a Simple, Virtual and Free product" Error
- 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?
- 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.