Skip to content

Instantly share code, notes, and snippets.

@emaildano
Created September 6, 2017 01:58
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 emaildano/55104766db471e865039d58bf351438b to your computer and use it in GitHub Desktop.
Save emaildano/55104766db471e865039d58bf351438b to your computer and use it in GitHub Desktop.
(Stripe) WP Simple Pay JS Implementation for multiple subscription links
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>WP Simple Pay JS</title>
</head>
<body>
<a href="#" class="amimoto-plan" data-plan-id="123">Sign Up</a>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
<script type="text/javascript">
$('.amimoto-plan').each( function() {
$(this).on('click', function (e) {
e.preventDefault();
var $id = '#simpay-form-' + $(this).data('plan-id');
$($id).find( '.simpay-payment-btn' ).click();
console.log($id);
});
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment