Integration: WP Affiliate Platform + Formidable Pro

I have a site that collects information via a Formidable Pro form and publishes it as a post. The site also uses Tips & Tricks HQ's WP Affiliate Platform + eStore to process payments and affiliate tracking.

I recently learned that Formidable has a Paypal add-on capable of publishing the post automatically when payment is received. Any chance to remove steps from the process is most welcome indeed! I would like to use this instead of eStore, but I need help integrating WP Affiliate Platform with Formidable Pro.

WP Affiliate Platform has a built-in option to integrate with Gravity Forms. Is it possible to create a filter that substitutes Formidable Forms for Gravity Forms? Then, all I need to do is add this code to the functions.php file and check the Gravity Integration box in WP Affiliate Platform.

Formidable's Paypal Add-on hooks - frm_payment_paypal_ipn | formidable_paypal_url

The integration code from wp_aff_includes_3rd_party_integration.php is as follows:

/* * * Gravity Forms PayPal addon ** */
//add_filter('gform_paypal_query', 'wp_aff_gf_update_paypal_query', 10, 3);//gform_paypalpro_query

add_action('gform_after_submission', 'wp_aff_gf_save_ap_id', 10, 3);//Save the ap_id after a form entry is submitted.

function wp_aff_gf_save_ap_id($entry, $form) {
    $aff_id = wp_affiliate_get_referrer();
    wp_affiliate_log_debug("GF integration... adding ap_id meta data to entry (".$entry['id'].") with value: " . $aff_id, true);
    gform_update_meta($entry['id'], 'ap_id', $aff_id);
}

add_action('gform_paypal_post_ipn', 'wp_aff_gf_track_affiliate_commission', 10, 4);
add_action('gform_paypalpro_post_ipn', 'wp_aff_gf_track_affiliate_commission', 10, 4);

function wp_aff_gf_track_affiliate_commission($ipn_data, $entry, $config, $cancel) {
    wp_affiliate_log_debug("GF integration - received IPN notification. Checking details...", true);
    $wp_aff_platform_config = WP_Affiliate_Platform_Config::getInstance();
    if ($wp_aff_platform_config->getValue('wp_aff_enable_gf_paypal') != '1') {
        wp_affiliate_log_debug("GF PayPal AddOn tracking feature is disabled! No commission will be awarded for this sale.", true);
        return;
    }
    wp_affiliate_log_debug("GF integration - IPN processing. Retrieving ap_id data for entry ID: ".$entry['id'], true);
    $referrer = gform_get_meta($entry['id'], 'ap_id');
    if (!empty($referrer)) {
        $sale_amount = $ipn_data['mc_gross'];
        $txn_id = $ipn_data['txn_id'];
        $item_id = $entry['id'];
        $buyer_email = $ipn_data['payer_email'];
        $clientip = $entry['ip'];
        $buyer_name = $ipn_data['first_name'] . " " . $ipn_data['last_name'];
        $payment_status = $ipn_data['payment_status'];

        $debug_data = "GF integration - Commission tracking debug data from PayPal transaction: " . $referrer . "|" . $sale_amount . "|" . $buyer_email . "|" . $txn_id . "|" . $item_id . "|" . $buyer_name . "|" . $payment_status;
        wp_affiliate_log_debug($debug_data, true);

        if ($sale_amount < 0) {// This is a refund or reversal
            wp_affiliate_log_debug('This is a refund. Refund amount: ' . $sale_amount, true);
            $parent_txn_id = $ipn_data['parent_txn_id'];
            wp_aff_handle_refund($parent_txn_id);
            wp_affiliate_log_debug('Calling Automatic Commission Reversal API. Parent transaction ID: ' . $parent_txn_id, true);
            return true;
        }

        wp_aff_award_commission_unique($referrer, $sale_amount, $txn_id, $item_id, $buyer_email, $clientip, '', $buyer_name);
    }else{
        wp_affiliate_log_debug("GF integration - Affiliate ID is not present. This user was not sent by an affiliate.", true);
    }
}

Does this give enough information to create the integration I am seeking? What else needs to be known?

Thanks,
Chris