public function webHookPut($identifier, $urlToAdd, $handshakeKey, $metadata = false)
 {
     $wrapper = new WufooApiWrapper($this->apiKey, $this->subdomain, $this->domain);
     return $wrapper->webHookPut($identifier, $urlToAdd, $handshakeKey, $metadata = false);
 }
Пример #2
0
<?php

require_once 'includes/WufooApiWrapper.php';
$apiKey = 'xxxx-xxxx-xxxx-xxxx';
//Enter here your Wufoo API
$subdomain = 'example';
//Enter here your subdomain(group name)
$identifier = 'xxxxxxxxxxxxx';
//Enter here your form id (Hash)
$wrapper = new WufooApiWrapper($apiKey, $subdomain);
$wufooSubmitFields = [new WufooSubmitField('Field3', $fname), new WufooSubmitField('Field4', $lname), new WufooSubmitField('Field7', $branch), new WufooSubmitField('Field150', $addressOne), new WufooSubmitField('Field151', $addressTwo), new WufooSubmitField('Field152', $city), new WufooSubmitField('Field153', $state), new WufooSubmitField('Field154', $zip), new WufooSubmitField('Field155', $country)];
/***************** from here manage you *************/
$wrapper->entryPost($identifier, $wufooSubmitFields);
//or
$wrapper->getForms($identifier);
//or
$wrapper->getFields($identifier);
//or
$wrapper->getEntries($identifier);
//or
$wrapper->getEntryCount($identifier);
//and so on, see README.md file
 public function getComments($identifier)
 {
     $wrapper = new WufooApiWrapper($this->apiKey, $this->subdomain, $this->domain);
     return $wrapper->getComments($identifier);
 }
Пример #4
0
<?php

require_once 'wufoo/WufooApiWrapper.php';
$first_name = $_POST['first_name'];
$last_name = $_POST['last_name'];
$email = $_POST['email'];
$api_key = 'V74Z-27TA-V3Q4-FTJO';
$form_hash = 'w1xgfito09xcmku';
$wufoo_id = 'louisat14th';
$api = new WufooApiWrapper($api_key, $wufoo_id);
$postArray = array(new WufooSubmitField('Field1', $first_name), new WufooSubmitField('Field2', $last_name), new WufooSubmitField('Field3', $email));
$response = $api->entryPost($form_hash, $postArray);
header('Content-Type: application/json');
exit(json_encode($response));
Пример #5
0
<?php

if (isset($_POST['WuPhooey-username']) && isset($_POST['WuPhooey-api_key'])) {
    $username = $_POST['WuPhooey-username'];
    $api_key = $_POST['WuPhooey-api_key'];
    if (empty($username) || empty($api_key)) {
        echo 'Failed!';
    } else {
        include 'wufoo-api/WufooApiWrapper.php';
        $wrapper = new WufooApiWrapper($api_key, $username);
        try {
            $login = $wrapper->login($api_key);
            echo 'Success!';
        } catch (Exception $e) {
            echo 'Failed!';
        }
    }
} else {
    echo 'Failed!';
}
 public function __construct($apiKey, $subdomain, $domain = 'wufoo.com')
 {
     parent::__construct($apiKey, $subdomain, $domain);
 }
 /**
  * Action hook to process forms from AJAX request
  *
  * @access public
  * @return void
  */
 public function action_wp_ajax_wufoo_post()
 {
     //look up the index of the hash of the form we're processing
     $index = $this->get_hash_by_label($_POST["form_type"]);
     //sanitize the data using wufoo's helpers
     $data = $this->_wufoo_sanitize($_POST['fields']);
     //set the hash
     $hash = $this->_hashes[$index];
     //create an API wrapper object
     $api = new WufooApiWrapper($this->_api_key, $this->_wufoo_id);
     //make the API call
     $response = $api->entryPost($hash, $data);
     //record the response in JSON
     header('Content-Type: application/json');
     echo json_encode($response);
     wp_die();
 }
Пример #8
0
function wufoo_login($echo = true)
{
    if (!get_option('WuPhooey-api_key') || !get_option('WuPhooey-username')) {
        if ($echo) {
            echo '<div id="wuphooey-message" class="updated">Make sure you have filled in all the fields on the <a href="' . wufoo_link('settings') . '">Settings Page</a>.</div>';
        }
        return false;
    } else {
        $api_key = get_option('WuPhooey-api_key');
        $username = get_option('WuPhooey-username');
        $wrapper = new WufooApiWrapper($api_key, $username);
        if ($login_data = wufoo_cache_get('login', 60 * 60 * 24 * 30)) {
            if ($login_data['username'] == $username && $login_data['api_key'] == $api_key) {
                return $wrapper;
            } else {
                wufoo_cache_set('login', array('api_key' => $api_key, 'username' => $username));
            }
        }
        try {
            $login = $wrapper->login($api_key);
            wufoo_cache_set('login', array('api_key' => $api_key, 'username' => $username));
        } catch (Exception $e) {
            if ($echo) {
                echo '<div id="wuphooey-message" class="updated">Make sure you have added the right API Key on the <a href="' . wufoo_link('settings') . '">Settings Page</a>.</div>';
            }
            return false;
        }
        return $wrapper;
    }
}