- 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
- How to Enable TikTok Pixel Tracking in CartFlows?
- Google Ads Pixel
- How to Enable Pinterest Pixel Tracking in CartFlows?
- How to Enable Snapchat Pixel Tracking in CartFlows?
- 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
- Dynamic Offers aka Rule Engine
- Instant Layout for Checkout and Thank You Step
- Adding Products from the URL to the Checkout Page
- Setting Up A/B Testing for Steps
- Deleting Plugin Data During Uninstallation
- Importing Ready-Made Templates for Flows and Steps
- Importing and Exporting Funnels and Individual Page Builder Templates
- URL Parameters
- Replacing the Main Checkout Order with an Upsell or Downsell
- Using the "Order Custom Field" Rule of Dynamic Offers with Custom Field Editor
- Flow in Test Mode
- Troubleshooting Plugin and Theme Conflicts
- Resolving the "Please Select a Simple, Virtual, and Free Product" Error
- Resolving the Endless Loading Issue on Checkout
- Resolving the "Order Not Found" Error on Thank You Page
- Resolving the "Checkout ID Not Found" Error
- Resolving the "Session Expired" Error
- Resolving "Order Does Not Exist" Error on Upsell/Downsell Page
- Resolving "Sorry, This Product Cannot Be Purchased" Error
- Resolving "No Product is Selected" Error
- Disabling Auto-fill of Address Fields Based on Zip Code
- Enabling Theme's Scripts & Styles Without Changing Page Template
- Disabling Auto-fill of Checkout Fields
- Allowing Cache Plugins to Cache CartFlows Pages
- Changing the "Choose a Variation" Text
- VAT Field Not Displaying for WooCommerce EU/UK VAT Compliance Plugin
- Enabling the Product Tab on Store Checkout
- Displaying 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.