Vue component to integrate PayPal payments through Braintree using Vault flow.
yarn add @mrjeffapp/vue-braintree-paypal-button
npm install --save @mrjeffapp/vue-braintree-paypal-button
<template>
<BraintreePaypalButton v-bind:styles="{ shape: 'rect' }" :token="token" :env="environment" :locale="locale" v-on:error="onError" v-on:authorized="onAuthorize" v-on:canceled="onCancel" />
</template>
<script>
import BraintreePaypalButton from '@/components/BraintreePaypalButton.vue';
export default {
name: 'TokenGenerator',
components: {
BraintreePaypalButton,
},
data() {
return {
environment: 'sandbox',
token: 'token',
locale: 'es_ES',
};
},
methods: {
onAuthorize: (nonce) => {
console.log(nonce);
},
onCancel: () => {
console.log('Cancelled');
},
onError: (error) => {
console.error(error);
},
},
};
</script>
<style>
</style>
String
true
production
| sandbox
String
false
String
false
en_US
Object
false
{}
When customer authorize vault flow.
When customer cancel vault flow.
When an error occurs.
yarn install
yarn serve
yarn build
yarn lint
yarn test:unit
yarn test:e2e
Author: jeff-labs
Live Demo: https://jeff-labs.github.io/vue-braintree-paypal-button
GitHub: https://github.com/jeff-labs/vue-braintree-paypal-button
#vuejs #javascript #vue-js