Hi,
Been looking for a way to get value of items within a handler object. From the below i would need to call the value of the image with console.log(this.image);. I doubt that is the way to do it. but I cannot find something that can point me in the right direction. Everthing i try comes up and undefined on 6th line.
<script>
var handler = StripeCheckout.configure({
key: "pk_test_6pRNASCoBOKtIshFeQd4XMUh",
image: "images/admin_imgs/podcastpilot.jpg",
token: function(token) {
console.log(this.image);
var stripeToken = token.id;
var stripeEmail = token.email;
$.post(
"/stripe.php", /* your route here */
{ stripeToken: token.id, stripeEmail: stripeEmail },
function(data) {
console.log(data);
}
);
}
});
$("body").on("click", "button#customForm", function(e) {
// Open Checkout with further options
handler.open({
name: $(this).attr("data-name"),
description: $(this).attr("data-desc")+\' ($\'+$(this).attr("data-price")/100+\')\',
amount: parseInt($(this).attr("data-price"))
});
e.preventDefault();
});
</script>