Skip to content

Instantly share code, notes, and snippets.

@xxswingxx
Created July 26, 2018 09:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xxswingxx/289d648aeca1480c73e6acab103d6732 to your computer and use it in GitHub Desktop.
Save xxswingxx/289d648aeca1480c73e6acab103d6732 to your computer and use it in GitHub Desktop.
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script src="https://billing.quaderno.io/billing.js"></script>
</head>
<body>
<a href="#" id="billing1"> Customer 1 </a>
<a href="#" id="billing2"> Customer 2 </a>
<script>
jQuery(function($) {
var handler
$('#billing1').on('click', function(e) {
e.preventDefault();
// Unload any other previous customer by invoking close()
if (typeof handler.close !== "undefined") { handler.close(); }
// Load the new customer
handler = QuadernoBilling.configure({key: 'QUADERNO_PUBLISHABLE_KEY', customer_id: 'CUSTOMER_ID_1', editable: false});
// Open the modal
handler.open();
});
$('#billing2').on('click', function(e) {
e.preventDefault();
if (typeof handler.close !== "undefined") { handler.close(); }
handler = QuadernoBilling.configure({key: 'QUADERNO_PUBLISHABLE_KEY', customer_id: 'CUSTOMER_ID_2', editable: false});
handler.open();
});
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment