transbank-sdk-node-vue
v1.0.6
Published
Awesome VUEJS plugin for transbank sdk node
Downloads
13
Maintainers
Readme
Transbank nodejs Vue plugin
Soon there will be a nuxt version
How to add to your project:
NPM
npm install transbank-sdk-node-vue
YARN
yarn add transbank-sdk-node-vue
In your main.js
file usually in the src folder add the next lines
import transbank from 'transbank-sdk-node-vue';
Vue.use(transbank);
How tho use:
now you can simply use the global scope this.$tbk
to call the plugin.
example:
const result = this.$tbk.webpayPlus.transaction.create(requestObject, optionsObject);
If you are having problems to methods works in dev environments you just need to add the proxy attribute to your optionsObject, also is mandatory to proxy the connection to transbank server
example
const optionsObject = {
commerceCode: '597055555532',
apiKey: '579B532A7440BB0C9079DED94D31EA1615BACEB56610332264630D42D0A36B1C',
test: true,
proxy: '/tbk',
};
vue.config.js
module.exports = {
devServer: {
proxy: {
'/tbk': {
target: 'https://webpay3gint.transbank.cl/',
ws: true,
changeOrigin: true,
pathRewrite: {
'^/tbk': '',
},
},
},
},
};
for the rest of docs please refer to the unofficial documentation