예제 #1
0
/**
 * Implementation of hook_civicrm_install
 */
function stripe_civicrm_install()
{
    //Create required tables for Stripe
    require_once "CRM/Core/DAO.php";
    CRM_Core_DAO::executeQuery("\n\tCREATE TABLE IF NOT EXISTS `civicrm_stripe_customers` (\n\t\t`email` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL,\n\t\t`id` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,\n\t\tUNIQUE KEY `email` (`email`)\n\t\t) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;\n\t");
    CRM_Core_DAO::executeQuery("\n\tCREATE TABLE IF NOT EXISTS `civicrm_stripe_plans` (\n\t\t`plan_id` varchar(255) COLLATE utf8_unicode_ci NOT NULL,\n\t\tUNIQUE KEY `plan_id` (`plan_id`)\n\t\t) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;\n\t");
    CRM_Core_DAO::executeQuery("\n\tCREATE TABLE IF NOT EXISTS `civicrm_stripe_subscriptions` (\n\t\t`customer_id` varchar(255) COLLATE utf8_unicode_ci NOT NULL,\n\t\t`invoice_id` varchar(255) COLLATE utf8_unicode_ci NOT NULL,\n\t\t`end_time` int(11) NOT NULL DEFAULT '0',\n\t\t`is_live` tinyint(4) NOT NULL COMMENT 'Whether this is a live or test transaction',\n\t\tKEY `end_time` (`end_time`)\n\t\t) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;\n\t");
    return _stripe_civix_civicrm_install();
}
/**
 * Implementation of hook_civicrm_install
 */
function stripe_civicrm_install()
{
    //Create required tables for Stripe
    require_once "CRM/Core/DAO.php";
    CRM_Core_DAO::executeQuery("\n\tCREATE TABLE IF NOT EXISTS `civicrm_stripe_customers` (\n\t\t`email` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL,\n\t\t`id` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,\n\t\tUNIQUE KEY `email` (`email`)\n\t\t) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;\n\t");
    CRM_Core_DAO::executeQuery("\n\tCREATE TABLE IF NOT EXISTS `civicrm_stripe_plans` (\n\t\t`plan_id` varchar(255) COLLATE utf8_unicode_ci NOT NULL,\n\t\tUNIQUE KEY `plan_id` (`plan_id`)\n\t\t) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;\n\t");
    CRM_Core_DAO::executeQuery("\n\tCREATE TABLE IF NOT EXISTS `civicrm_stripe_subscriptions` (\n\t\t`customer_id` varchar(255) COLLATE utf8_unicode_ci NOT NULL,\n\t\t`invoice_id` varchar(255) COLLATE utf8_unicode_ci NOT NULL,\n\t\t`end_time` int(11) NOT NULL DEFAULT '0',\n\t\t`is_live` tinyint(4) NOT NULL COMMENT 'Whether this is a live or test transaction',\n\t\tKEY `end_time` (`end_time`)\n\t\t) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;\n\t");
    CRM_Core_Session::setStatus("Stripe Payment Processor Message: <br />Don't forget to set up Webhooks in Stripe so that recurring contributions are ended! <br />Webhook path to enter in Stripe: <strong>yoursite.com/civicrm/stripe/webhook</strong>");
    return _stripe_civix_civicrm_install();
}