Created
September 6, 2017 01:58
-
-
Save emaildano/55104766db471e865039d58bf351438b to your computer and use it in GitHub Desktop.
(Stripe) WP Simple Pay JS Implementation for multiple subscription links
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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