diff --git a/docs/hooks/hook_civicrm_postIPNProcess.md b/docs/hooks/hook_civicrm_postIPNProcess.md new file mode 100644 index 0000000000000000000000000000000000000000..023b9b16f2955ffe3678596956278c0f01d698ee --- /dev/null +++ b/docs/hooks/hook_civicrm_postIPNProcess.md @@ -0,0 +1,34 @@ +# hook_civicrm_postIPNProcess + +## Summary + +This hook allows you to do custom processing of IPN Data following CiviCRM processing. + +## Notes + +This hook as present only calls when CiviCRM has successfully processed the IPN. + +With this hook you can take any of the data including custom data stored via hook_civicrm_alterPaymentProcessorParms into the IPN. + +## Definition + + hook_civicrm_postIPNProcess(&$IPNData); + +## Parameters + +- $IPNData - Array of IPN data recieved from a payment processor. + +## Returns + +## Example + +```php + function civitest_civicrm_postIPNProcess(&$IPNData) { + if (!empty($IPNData['custom'])) { + $customParams = json_decode($IPNData['custom'], TRUE); + if (!empty($customParams['gaid'])) { + // trigger GA event id for e-commerce tracking. + } + } + } +``` diff --git a/mkdocs.yml b/mkdocs.yml index f97339eb7277c95aeddba11bfc48abfbd21dbdf3..5f812bfd89d2f78af0d0c15686dee9cdd06dd964 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -180,6 +180,7 @@ pages: - hook_civicrm_membershipTypeValues: hooks/hook_civicrm_membershipTypeValues.md - hook_civicrm_notePrivacy: hooks/hook_civicrm_notePrivacy.md - <del>hook_civicrm_optionValues</del>: hooks/hook_civicrm_optionValues.md + - hook_civicrm_postIPNProcess: hooks/hook_civicrm_postIPNProcess.md - hook_civicrm_queryObjects: hooks/hook_civicrm_queryObjects.md - hook_civicrm_recent: hooks/hook_civicrm_recent.md - hook_civicrm_tokens: hooks/hook_civicrm_tokens.md