Last active
March 28, 2017 01:46
-
-
Save bmax/24ed819efb42294faf495e0b5ec9d5c8 to your computer and use it in GitHub Desktop.
This file contains 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 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> |
This file contains 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
<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