Example #1
0
 public static function admin_edit_payment_status($payment_status, $form_id, $lead)
 {
     //allow the payment status to be edited when for paypal, not set to Approved, and not a subscription
     $payment_gateway = gform_get_meta($lead["id"], "payment_gateway");
     require_once self::get_base_path() . "/data.php";
     //get the transaction type out of the feed configuration, do not allow status to be changed when subscription
     $paypal_feed_id = gform_get_meta($lead["id"], "paypal_feed_id");
     $feed_config = GFPayPalData::get_feed($paypal_feed_id);
     $transaction_type = rgars($feed_config, "meta/type");
     if ($payment_gateway != "paypal" || strtolower(rgpost("save")) != "edit" || $payment_status == "Approved" || $transaction_type == "subscription") {
         return $payment_status;
     }
     //create drop down for payment status
     $payment_string = gform_tooltip("paypal_edit_payment_status", "", true);
     $payment_string .= '<select id="payment_status" name="payment_status">';
     $payment_string .= '<option value="' . $payment_status . '" selected>' . $payment_status . '</option>';
     $payment_string .= '<option value="Approved">Approved</option>';
     $payment_string .= '</select>';
     return $payment_string;
 }
Example #2
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'));
 }