Skip to content
Snippets Groups Projects
Commit 032970f0 authored by Joshua Walker's avatar Joshua Walker
Browse files

Merge pull request #58 from Swingline0/better-webhook-paths

Customize webhook alert on enable to use UF relative path
parents 59eb00b4 f658d918
No related branches found
No related tags found
No related merge requests found
......@@ -69,9 +69,20 @@ function stripe_civicrm_uninstall() {
* Implementation of hook_civicrm_enable().
*/
function stripe_civicrm_enable() {
$UF_webhook_paths = array(
"Drupal" => "/civicrm/stripe/webhook",
"Drupal6" => "/civicrm/stripe/webhook",
"Joomla" => "/index.php/component/civicrm/?task=civicrm/stripe/webhook",
"WordPress" => "/?page=CiviCRM&q=civicrm/stripe/webhook"
);
// Use Drupal path as default if the UF isn't in the map above
$webookhook_path = (array_key_exists(CIVICRM_UF, $UF_webhook_paths)) ?
CIVICRM_UF_BASEURL . $UF_webhook_paths[CIVICRM_UF] :
CIVICRM_UF_BASEURL . "civicrm/stripe/webhook";
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>
<br />Webhook path to enter in Stripe:<br/><em>$webookhook_path</em>
<br />");
return _stripe_civix_civicrm_enable();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment