Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
(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