Ejemplo n.º 1
0
 public static function uninstall()
 {
     //loading data lib
     require_once self::get_base_path() . "/data.php";
     if (!GFPayPal::has_access("gravityforms_paypal_uninstall")) {
         die(__("You don't have adequate permission to uninstall the PayPal Add-On.", "gravityformspaypal"));
     }
     //droping all tables
     GFPayPalData::drop_tables();
     //removing options
     delete_option("gf_paypal_site_name");
     delete_option("gf_paypal_auth_token");
     delete_option("gf_paypal_version");
     //Deactivating plugin
     $plugin = "gravityformspaypal/paypal.php";
     deactivate_plugins($plugin);
     update_option('recently_activated', array($plugin => time()) + (array) get_option('recently_activated'));
 }
 public function get_paypal_feed($form_id, $entry)
 {
     if (!class_exists('GFPayPal')) {
         return false;
     }
     if (method_exists('GFPayPal', 'get_config_by_entry')) {
         $feed = GFPayPal::get_config_by_entry($entry);
     } else {
         if (method_exists('GFPayPal', 'get_config')) {
             $feed = GFPayPal::get_config($form_id);
         } else {
             $feed = false;
         }
     }
     return $feed;
 }
Ejemplo n.º 3
0
 private static function get_paypal_config($form_id, $entry)
 {
     if (!class_exists('GFPayPal')) {
         return false;
     }
     if (method_exists("GFPayPal", "get_config_by_entry")) {
         return GFPayPal::get_config_by_entry($entry);
     } else {
         return GFPayPal::get_config($form_id);
     }
 }
Ejemplo n.º 4
0
 public static function get_config($form_id)
 {
     $paypal = GFPayPal::get_instance();
     $feed = $paypal->get_feeds($form_id);
     //Ignore IPN messages from forms that are no longer configured with the PayPal add-on
     if (!$feed) {
         return false;
     }
     return $feed[0];
     //only one feed per form is supported (left for backwards compatibility)
 }
Ejemplo n.º 5
0
function gf_paypal()
{
    return GFPayPal::get_instance();
}
Ejemplo n.º 6
0
 public static function handle_form_submission($entry, $form)
 {
     if (class_exists('GFPayPal')) {
         $paypal_config = GFPayPal::get_config($form['id']);
         //don't send SMS if PayPal delay twilio setting is ON
         if (rgget('delay_twilio', $paypal_config['meta'])) {
             $order_total = GFCommon::get_order_total($form, $entry);
             if ($order_total != 0) {
                 return;
             }
         }
     }
     self::export($entry, $form);
 }