File tree 1 file changed +12
-13
lines changed 1 file changed +12
-13
lines changed Original file line number Diff line number Diff line change @@ -104,6 +104,17 @@ export default defineComponent({
104
104
})
105
105
})
106
106
107
+ const = pay () => {
108
+ // Get stripe element
109
+ const cardElement = card.stripeElement
110
+
111
+ // Access instance methods, e.g. createToken()
112
+ elms.instance.createToken(cardElement).then((result: object) => {
113
+ // Handle result.error or result.token
114
+ console.log(result)
115
+ })
116
+ },
117
+
107
118
return {
108
119
stripeKey,
109
120
stripeLoaded,
@@ -112,21 +123,9 @@ export default defineComponent({
112
123
cardOptions,
113
124
card,
114
125
elms,
126
+ pay
115
127
}
116
128
},
117
-
118
- methods: {
119
- pay() {
120
- // Get stripe element
121
- const cardElement = this.card.stripeElement
122
-
123
- // Access instance methods, e.g. createToken()
124
- this.elms.instance.createToken(cardElement).then((result: object) => {
125
- // Handle result.error or result.token
126
- console.log(result)
127
- })
128
- },
129
- },
130
129
})
131
130
</script>
132
131
You can’t perform that action at this time.
0 commit comments