Created
October 21, 2019 10:51
-
-
Save gopalkildoliya/7def684eef305cea33b77a5b751911e5 to your computer and use it in GitHub Desktop.
VueJs Component for Paddle
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
<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: '[email protected]' | |
} | |
} | |
}, | |
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