pmpro_checkLevelForPayflowCompatibility
Checks if PMPro settings are complete or if there are any errors.
Description
pmpro_checkLevelForPayflowCompatibility( (constant) $level = NULL );
Payflow currently does not support: Trial Amounts > 0.
Parameters (1)
- 0. $level — Optional. (constant) =>
NULL
- The level.
Usage
if ( !function_exists( 'pmpro_checkLevelForPayflowCompatibility' ) ) { require_once ABSPATH . PLUGINDIR . 'paid-memberships-pro/adminpages/functions.php'; } // The level. $level = NULL; // NOTICE! Understand what this does before running. $result = pmpro_checkLevelForPayflowCompatibility($level);
Defined (1)
The function is defined in the following location(s).
- /adminpages/functions.php
- function pmpro_checkLevelForPayflowCompatibility($level = NULL)
- {
- $gateway = pmpro_getOption("gateway");
- if($gateway == "payflowpro")
- {
- global $wpdb;
- //check ALL the levels
- if(empty($level))
- {
- $sqlQuery = "SELECT * FROM $wpdb->pmpro_membership_levelsORDERBY id ASC";
- $levels = $wpdb->get_results($sqlQuery, OBJECT);
- if(!empty($levels))
- {
- foreach($levels as $level)
- {
- if(!pmpro_checkLevelForPayflowCompatibility($level))
- return false;
- }
- }
- }
- else
- {
- //need to look it up?
- if(is_numeric($level))
- $level = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->pmpro_membership_levels WHERE id = %d LIMIT 1" , $level ) );
- //check this level
- if($level->trial_amount > 0)
- {
- return false;
- }
- }
- }
- return true;
- }