Skip to content

Instantly share code, notes, and snippets.

@bmax
Last active March 28, 2017 01:46
Show Gist options
  • Save bmax/24ed819efb42294faf495e0b5ec9d5c8 to your computer and use it in GitHub Desktop.
Save bmax/24ed819efb42294faf495e0b5ec9d5c8 to your computer and use it in GitHub Desktop.
<template>
<div class="container">
Order: {{$route.params.id}}
<div id="tabs">
<ul class="nav-pills">
<li role="presentation" v-on:click="cc = !cc; paypal=false">Credit Card</li>
<li role="presentation" v-on:click="paypal = !paypal; cc = false">Paypal</li>
</ul>
</div>
<Paypal v-if="paypal"></Paypal>
<CreditCard v-if="cc" v-on:order="order(id)"></CreditCard>
</div>
</template>
<script>
import auth from '../api/auth'
import CreditCard from './PayOptions/CreditCard'
import Paypal from './PayOptions/Paypal'
export default {
data() {
return {
user: auth.user,
paypal: false,
cc: false,
}
},
components: {
CreditCard,
Paypal,
},
methods: {
order ( id ) {
console.log('yo', id);
// auth.order( id, this );
}
}
}
</script>
<script>
import braintree from 'braintree-web'
// We generated a client token for you so you can test out this code
// immediately. In a production-ready integration, you will need to
// generate a client token on your server (see section below).
var authorization = process.env.BRAINTREE_AUTH;
export default {
created() {
this.$emit('order',5 );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment