Skip to content

Instantly share code, notes, and snippets.

@gopalkildoliya
Created October 21, 2019 10:51
Show Gist options
  • Save gopalkildoliya/7def684eef305cea33b77a5b751911e5 to your computer and use it in GitHub Desktop.
Save gopalkildoliya/7def684eef305cea33b77a5b751911e5 to your computer and use it in GitHub Desktop.
VueJs Component for Paddle
<template>
<div>
<div class="content has-text-centered" v-if="user">
<button @click="subscribe">Checkout</button>
</div>
</div>
</template>
<script
import {db, firebase} from "../db";
export default {
name: "Account",
data(){
return {
user: {
id: 'user_id',
email: 'user@email.com'
}
}
},
methods: {
subscribe(){
let that = this;
Paddle.Checkout.open({
product: 1123,
email: this.user.email,
passthrough: this.user.id,
successCallback: function(data) {
console.log(data);
alert('Checkout Success');
},
closeCallback: function(data) {
console.log(data);
alert('Failed to checkout');
}
});
}
}
}
</script>
<style scoped>
</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment