Advertisement
DataCCIW

Conditional Obsidian Registration Redirect

Feb 27th, 2023 (edited)
974
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //- Redirect to the Obsidian Registration Block based on Gateway tied to Registration Template
  2.  
  3. {% assign registrationInstanceId = PageParameter['RegistrationInstanceId'] | SanitizeSql %}
  4. {% assign eventOccurrenceId = PageParameter['EventOccurrenceID'] | SanitizeSql %}
  5. {% assign slug = PageParameter['Slug'] | SanitizeSql %}
  6. {% assign registrationId = PageParameter['RegistrationId'] | SanitizeSql %}
  7. {% assign redirect = false %}
  8.  
  9. //- Handle redirects for individuals in process of registering
  10.  
  11. {% if registrationInstanceId and registrationInstanceId != empty %}
  12.     //- Fetching Registration Instance Based in registrationInstanceId <BR>
  13.     //- securityenabled:'false' the end user might not have access to this object
  14.     {% registrationinstance id:'{{registrationInstanceId}}' securityenabled:'false' %}
  15.     {% assign gatewayid = registrationinstance.RegistrationTemplate.FinancialGatewayId %}
  16.     //- MyWell Gateway = 4
  17.     {% if gatewayid == 4 %}
  18.         {% assign redirect = true %}
  19.         {% capture urlRedirect %}{{ 'Global' | Attribute:'PublicApplicationRoot' }}page/811?RegistrationInstanceId={{registrationInstanceId}}&EventOccurrenceID={{eventOccurrenceId}}&Slug={{slug}}{% endcapture %}
  20.        
  21.     {% endif %}
  22.     {% endregistrationinstance %}
  23. {% endif %}
  24.  
  25. //- Handle redirect for individuals who have already registered and are returing to submit payment
  26. {% if registrationId and registrationId != empty %}
  27.     //-Fetching Registration Instance Based in registrationId <BR>
  28.     //- securityenabled:'false' the end user might not have access to this object  
  29.     {% registration id:'{{registrationId}}' securityenabled:'false' %}
  30.     {% assign gatewayid = registration.RegistrationInstance.RegistrationTemplate.FinancialGatewayId %}
  31.     //- MyWell Gateway = 4
  32.     {% if gatewayid == 4 %}
  33.         {% assign redirect = true %}
  34.         //- Obsidian Registration Page = 811
  35.         {% capture urlRedirect %}{{ 'Global' | Attribute:'PublicApplicationRoot' }}page/811?RegistrationId={{registrationId}}{% endcapture %}
  36.     {% endif %}
  37.     {% endregistration %}
  38. {% endif %}
  39.  
  40. {% if redirect == true %}
  41.     //- RockAdmin
  42.     {% assign isInRole = CurrentPerson | IsInSecurityRole: 2 %}
  43.     {% if isInRole == true %}
  44.         Redirecting to: <pre>{{ urlRedirect }}</pre>
  45.     {% else %}
  46.         {{ urlRedirect | PageRedirect }}
  47.     {% endif %}
  48. {% endif %}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement