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>
- Type:
String
- Required:
true
- Values:
production
|sandbox
- Type:
String
- Required:
false
- Value: Client token from your integration to Braintree
- Type:
String
- Required:
false
- Default:
en_US
- Values: Supported locales
- Type:
Object
- Required:
false
- Default:
{}
- Values: Customize button
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
yarn gh-pages