Skip to content

Instantly share code, notes, and snippets.

@Apdlrcjafg19
Created October 5, 2024 10:37
Show Gist options
  • Save Apdlrcjafg19/620492dd61ad85ce92a6f91ac220213a to your computer and use it in GitHub Desktop.
Save Apdlrcjafg19/620492dd61ad85ce92a6f91ac220213a to your computer and use it in GitHub Desktop.
Javascript API playground
<!-- Puts Fundraise Up into test mode so that you can experiement with the donationComplete event. -->
<script>
window.fundraiseup_livemode = false;
</script>
<!-- End test mode code -->
<div class="container">
<ul class="list">
<li class="list-item">
<span class="list-title">JavaScript events demo</span>
<span class="list-description">Select the Donate button to launch Checkout. Fired JavaScript events will appear in the console. Remember to clear the console as you try different events.</span>
<div class="loading fade-out"><i class="fa-solid fa-spinner-third fa-spin" style="--fa-animation-duration: 1s"></i> Preparing example...</div>
<div class="example fade-in">
<a href="#XTGWFZFR" style="display: none"></a>
</div>
</li>
</ul>
</div>
/* Events to try:
1. checkoutOpen -> Fires whenever Checkout is opened
2. checkoutClose -> Fires whenever Checkout is closed, regardless of whether a conversion occurs.
3. donationComplete -> Fires at the point of conversion in Checkout.
*/
FundraiseUp.on('checkoutOpen', function(details) {
console.log(details);
});
<link href="https://codepen.io/fundocs/pen/XWYqQKZ.css" rel="stylesheet" />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment