Norvell's Public Machinations
    Have ideas to improve npm?Join in the discussion! »

    transbank-sdk-node-vue

    1.0.6 • Public • Published

    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

    Install

    npm i transbank-sdk-node-vue

    DownloadsWeekly Downloads

    1

    Version

    1.0.6

    License

    MIT

    Unpacked Size

    2.99 kB

    Total Files

    4

    Last publish

    Collaborators

    • avatar