it was an scope issue in fact, inside the token: callback() this refers the callback function itself instead of vue instance. so i just cache the vue instance in the created method and then used the variable into callback to make the ajax request with the data. That solves my problem
here is the modified code samples::
<script>
export default {
data: function(){
return {
stripeEmail: '',
stripeToken: ''
}
},
created: function(){
// caching the vue instance
var $this = this;
this.stripe_checkout = StripeCheckout.configure({
key: Laravel.stripeKey,
image:"https://stripe.com/img/documentation/checkout/marketplace.png",
locale:"auto",
token: function(token){
// using the cache version of the vue instance, insteade of this, using $this
$this.stripeEmail = token.email;
$this.stripeToken = token.id;
$this.$http.post('/purchase', $this.$data).then(function(response){
alert('Complete, Thanks for your payment !');
});
}
});
},
methods: {
buy: function(){
this.stripe_checkout.open({
amount: 2500,
name:"My Product Name",
description:"A simple test product.",
});
}
}
}
</script>