├── .babelrc ├── .eslintrc ├── .gitignore ├── LICENSE ├── README.md ├── build ├── webpack.dev.js └── webpack.dist.js ├── dist ├── rave.js ├── rave.min.js └── rave.min.js.map ├── examples ├── commonjs │ ├── App.vue │ ├── app.js │ └── index.html └── index.html ├── package.json ├── rave-demo.png ├── src ├── index.js └── rave.vue └── webpack.config.js /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["@babel/preset-env"] 3 | } 4 | -------------------------------------------------------------------------------- /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "extends": ["plugin:vue/recommended"], 3 | "rules": { 4 | "space-before-function-paren": [2, "never"], 5 | "indent": ["error",4], 6 | "camelcase": [2, {"properties": "never"}] 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | npm-debug.log 3 | .idea 4 | package-lock.json 5 | yarn.lock 6 | .DS_Store -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Ayeni Olusegun 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Rave Payment Component for Vue 2.x 2 | A Vue Plugin for RavePay Payment Gateway. 3 | 4 | ### Demo 5 | 6 | ![Demo Image](rave-demo.png?raw=true "Demo Image") 7 | 8 | ### Install 9 | 10 | ##### NPM 11 | ``` 12 | npm install vue vue-ravepayment --save 13 | ``` 14 | 15 | ##### Javascript via CDN 16 | ```javascript 17 | 18 | 19 | 20 | 21 | ``` 22 | 23 | ### Usage 24 | 25 | ##### Via NPM 26 | 27 | ###### my-compnent.vue sample 28 | ```vue 29 | 51 | 101 | 109 | ``` 110 | [Usage Example via NPM or Yarn](examples/commonjs/App.vue) 111 | #### via CDN 112 | ```javascript 113 | new Vue({ 114 | el: '#app', 115 | components:{ 116 | 'Rave': VueRavePayment.default 117 | }, 118 | computed: { 119 | reference(){ 120 | let text = ""; 121 | let possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; 122 | 123 | for( let i=0; i < 10; i++ ) 124 | text += possible.charAt(Math.floor(Math.random() * possible.length)); 125 | 126 | return text; 127 | } 128 | }, 129 | methods: { 130 | callback: function(response){ 131 | console.log(response) 132 | }, 133 | close: function(){ 134 | console.log("Payment closed") 135 | } 136 | }, 137 | data: { 138 | raveBtnText: "Pay Me, My Money", 139 | raveKey: "FLWPUBK-xxxxxxxxxxxxxxxxx-X", 140 | email: "foobar@example.com", 141 | amount: 10000 142 | } 143 | }); 144 | ``` 145 | [Usage Example via CDN](examples/index.html) 146 | 147 | Please checkout [Rave Documentation](https://flutterwavedevelopers.readme.io/v1.0/reference#introduction) for other available options you can add to the tag 148 | 149 | ## Deployment 150 | WHEN DEPLOYING TO PRODUCTION/LIVE SYSTEM, take note of the following; 151 | 1) Change `is-production` attribute in the component tag to `true` i.e `:is-production="true"` 152 | 2) Change RavePay PUBLIC KEY 153 | 154 | ## Contributing 155 | 1. Fork it! 156 | 2. Create your feature branch: `git checkout -b feature-name` 157 | 3. Commit your changes: `git commit -am 'Some commit message'` 158 | 4. Push to the branch: `git push origin feature-name` 159 | 5. Submit a pull request 😉😉 160 | 161 | ## How can I thank you? 162 | 163 | Why not star the github repo? I'd love the attention! Why not share the link for this repository on Twitter or Any Social Media? Spread the word! 164 | 165 | Don't forget to [follow me on twitter](https://twitter.com/iamraphson)! 166 | 167 | Thanks! 168 | Ayeni Olusegun. 169 | 170 | ## License 171 | This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details 172 | -------------------------------------------------------------------------------- /build/webpack.dev.js: -------------------------------------------------------------------------------- 1 | const path = require('path') 2 | const webpack = require('webpack') 3 | const UglifyJsPlugin = require('uglifyjs-webpack-plugin') 4 | const VueLoaderPlugin = require('vue-loader/lib/plugin') 5 | 6 | module.exports = { 7 | entry: { 8 | 'rave': './examples/commonjs/app.js' 9 | }, 10 | output: { 11 | path: path.resolve(__dirname, '../dist'), 12 | publicPath: '/dist/', 13 | filename: '[name].js' 14 | }, 15 | module: { 16 | rules: [{ 17 | test: /\.vue$/, 18 | loader: 'vue-loader' 19 | }, { 20 | test: /\.js$/, 21 | loader: 'babel-loader', 22 | exclude: /node_modules/ 23 | }, { 24 | test: /\.css$/, 25 | use: [ 26 | 'vue-style-loader', 27 | 'css-loader' 28 | ] 29 | }] 30 | }, 31 | plugins: [ 32 | new VueLoaderPlugin(), 33 | new webpack.LoaderOptionsPlugin({ 34 | minimize: true, 35 | debug: false 36 | }) 37 | ], 38 | devtool: 'eval-source-map' 39 | } 40 | -------------------------------------------------------------------------------- /build/webpack.dist.js: -------------------------------------------------------------------------------- 1 | const path = require('path') 2 | const webpack = require('webpack') 3 | const UglifyJsPlugin = require('uglifyjs-webpack-plugin') 4 | const VueLoaderPlugin = require('vue-loader/lib/plugin') 5 | 6 | module.exports = { 7 | mode: 'production', 8 | entry: { 9 | 'rave': './src/index.js' 10 | }, 11 | output: { 12 | path: path.resolve(__dirname, '../dist'), 13 | publicPath: '/dist/', 14 | filename: '[name].min.js', 15 | library: 'VueRavePayment', 16 | libraryTarget: 'umd', 17 | umdNamedDefine: true 18 | }, 19 | module: { 20 | rules: [{ 21 | enforce: 'pre', 22 | test: /\.(js|vue)$/, 23 | exclude: /node_modules/, 24 | loader: 'eslint-loader' 25 | }, { 26 | test: /\.vue$/, 27 | loader: 'vue-loader' 28 | }, { 29 | test: /\.js$/, 30 | loader: 'babel-loader', 31 | exclude: /node_modules/ 32 | }, { 33 | test: /\.css$/, 34 | use: [ 35 | 'vue-style-loader', 36 | 'css-loader' 37 | ] 38 | }] 39 | }, 40 | optimization: { 41 | minimizer: [ 42 | new UglifyJsPlugin({ 43 | uglifyOptions: { 44 | output: { 45 | comments: false 46 | }, 47 | warnings: false, 48 | compress: { 49 | unsafe_comps: true, 50 | properties: true, 51 | keep_fargs: false, 52 | pure_getters: true, 53 | collapse_vars: true, 54 | unsafe: true, 55 | sequences: true, 56 | dead_code: true, 57 | drop_debugger: true, 58 | comparisons: true, 59 | conditionals: true, 60 | evaluate: true, 61 | booleans: true, 62 | loops: true, 63 | unused: true, 64 | hoist_funs: true, 65 | if_return: true, 66 | join_vars: true, 67 | drop_console: true 68 | } 69 | } 70 | }) 71 | ] 72 | }, 73 | plugins: [ 74 | new VueLoaderPlugin(), 75 | new webpack.LoaderOptionsPlugin({ 76 | minimize: true, 77 | debug: false 78 | }) 79 | ], 80 | devtool: 'source-map' 81 | } 82 | -------------------------------------------------------------------------------- /dist/rave.min.js: -------------------------------------------------------------------------------- 1 | !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("VueRavePayment",[],t):"object"==typeof exports?exports.VueRavePayment=t():e.VueRavePayment=t()}(window,function(){return r={},o.m=n=[function(e,t,n){var r=n(2);"string"==typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);(0,n(5).default)("7ce5ac5d",r,!0,{})},function(e,t,n){"use strict";n(0)},function(e,t,n){(e.exports=n(3)(!1)).push([e.i,"\n.payButton{\n color: #61DAFB;\n width: 250px;\n height: 50px;\n font-weight: 800;\n}\n",""])},function(e){"use strict";function r(e,t){var n=e[1]||"",r=e[3];if(!r)return n;if(t&&"function"==typeof btoa){var o=function(e){var t=btoa(unescape(encodeURIComponent(JSON.stringify(e))));return"/*# ".concat("sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(t)," */")}(r),a=r.sources.map(function(e){return"/*# sourceURL=".concat(r.sourceRoot).concat(e," */")});return[n].concat(a).concat([o]).join("\n")}return""+n}e.exports=function(n){var u=[];return u.toString=function(){return this.map(function(e){var t=r(e,n);return e[2]?"@media ".concat(e[2],"{").concat(t,"}"):t}).join("")},u.i=function(e,t){"string"==typeof e&&(e=[[null,e,""]]);for(var n={},r=0;r tag\n\n// load the styles\nvar content = __webpack_require__(4);\nif(typeof content === 'string') content = [[module.i, content, '']];\nif(content.locals) module.exports = content.locals;\n// add the styles to the DOM\nvar update = __webpack_require__(6)(\"7f88fa9c\", content, true);\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports, __webpack_require__) {\n\nexports = module.exports = __webpack_require__(5)(false);\n// imports\n\n\n// module\nexports.push([module.i, \".payButton{color:#61dafb;width:250px;height:50px;font-weight:800}\", \"\"]);\n\n// exports\n\n\n/***/ }),\n/* 5 */\n/***/ (function(module, exports) {\n\n/*\n\tMIT License http://www.opensource.org/licenses/mit-license.php\n\tAuthor Tobias Koppers @sokra\n*/\n// css base code, injected by the css-loader\nmodule.exports = function(useSourceMap) {\n\tvar list = [];\n\n\t// return the list of modules as css string\n\tlist.toString = function toString() {\n\t\treturn this.map(function (item) {\n\t\t\tvar content = cssWithMappingToString(item, useSourceMap);\n\t\t\tif(item[2]) {\n\t\t\t\treturn \"@media \" + item[2] + \"{\" + content + \"}\";\n\t\t\t} else {\n\t\t\t\treturn content;\n\t\t\t}\n\t\t}).join(\"\");\n\t};\n\n\t// import a list of modules into the list\n\tlist.i = function(modules, mediaQuery) {\n\t\tif(typeof modules === \"string\")\n\t\t\tmodules = [[null, modules, \"\"]];\n\t\tvar alreadyImportedModules = {};\n\t\tfor(var i = 0; i < this.length; i++) {\n\t\t\tvar id = this[i][0];\n\t\t\tif(typeof id === \"number\")\n\t\t\t\talreadyImportedModules[id] = true;\n\t\t}\n\t\tfor(i = 0; i < modules.length; i++) {\n\t\t\tvar item = modules[i];\n\t\t\t// skip already imported module\n\t\t\t// this implementation is not 100% perfect for weird media query combinations\n\t\t\t// when a module is imported multiple times with different media queries.\n\t\t\t// I hope this will never occur (Hey this way we have smaller bundles)\n\t\t\tif(typeof item[0] !== \"number\" || !alreadyImportedModules[item[0]]) {\n\t\t\t\tif(mediaQuery && !item[2]) {\n\t\t\t\t\titem[2] = mediaQuery;\n\t\t\t\t} else if(mediaQuery) {\n\t\t\t\t\titem[2] = \"(\" + item[2] + \") and (\" + mediaQuery + \")\";\n\t\t\t\t}\n\t\t\t\tlist.push(item);\n\t\t\t}\n\t\t}\n\t};\n\treturn list;\n};\n\nfunction cssWithMappingToString(item, useSourceMap) {\n\tvar content = item[1] || '';\n\tvar cssMapping = item[3];\n\tif (!cssMapping) {\n\t\treturn content;\n\t}\n\n\tif (useSourceMap && typeof btoa === 'function') {\n\t\tvar sourceMapping = toComment(cssMapping);\n\t\tvar sourceURLs = cssMapping.sources.map(function (source) {\n\t\t\treturn '/*# sourceURL=' + cssMapping.sourceRoot + source + ' */'\n\t\t});\n\n\t\treturn [content].concat(sourceURLs).concat([sourceMapping]).join('\\n');\n\t}\n\n\treturn [content].join('\\n');\n}\n\n// Adapted from convert-source-map (MIT)\nfunction toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}\n\n\n/***/ }),\n/* 6 */\n/***/ (function(module, exports, __webpack_require__) {\n\n/*\n MIT License http://www.opensource.org/licenses/mit-license.php\n Author Tobias Koppers @sokra\n Modified by Evan You @yyx990803\n*/\n\nvar hasDocument = typeof document !== 'undefined'\n\nif (typeof DEBUG !== 'undefined' && DEBUG) {\n if (!hasDocument) {\n throw new Error(\n 'vue-style-loader cannot be used in a non-browser environment. ' +\n \"Use { target: 'node' } in your Webpack config to indicate a server-rendering environment.\"\n ) }\n}\n\nvar listToStyles = __webpack_require__(7)\n\n/*\ntype StyleObject = {\n id: number;\n parts: Array\n}\n\ntype StyleObjectPart = {\n css: string;\n media: string;\n sourceMap: ?string\n}\n*/\n\nvar stylesInDom = {/*\n [id: number]: {\n id: number,\n refs: number,\n parts: Array<(obj?: StyleObjectPart) => void>\n }\n*/}\n\nvar head = hasDocument && (document.head || document.getElementsByTagName('head')[0])\nvar singletonElement = null\nvar singletonCounter = 0\nvar isProduction = false\nvar noop = function () {}\n\n// Force single-tag solution on IE6-9, which has a hard limit on the # of \n\n\n// WEBPACK FOOTER //\n// src/rave.vue","import rave from './rave.vue'\n\nexport default rave\n\n\n\n// WEBPACK FOOTER //\n// ./src/index.js","function injectStyle (ssrContext) {\n require(\"!!vue-style-loader!css-loader?minimize!../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-2a4295b6\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!../node_modules/vue-loader/lib/selector?type=styles&index=0!./rave.vue\")\n}\nvar normalizeComponent = require(\"!../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../node_modules/vue-loader/lib/selector?type=script&index=0!./rave.vue\"\nimport __vue_script__ from \"!!babel-loader!../node_modules/vue-loader/lib/selector?type=script&index=0!./rave.vue\"\n/* template */\nimport __vue_template__ from \"!!../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-2a4295b6\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../node_modules/vue-loader/lib/selector?type=template&index=0!./rave.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/rave.vue\n// module id = 2\n// module chunks = 0","// style-loader: Adds some css to the DOM by adding a 68 | -------------------------------------------------------------------------------- /examples/commonjs/app.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import App from './App.vue' 3 | new Vue({ 4 | render: h => h(App) 5 | }).$mount('#app') 6 | -------------------------------------------------------------------------------- /examples/commonjs/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Vue-Rave 5 | 6 | 7 |
8 | 9 | 10 | -------------------------------------------------------------------------------- /examples/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Vue RavePayment Example 5 | 6 | 7 | 8 | 9 | 21 | 22 | 23 |
24 | 34 | 35 | Payment Make Payment - 1 36 | 37 |
38 | 39 | 71 | 72 | 73 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vue-ravepayment", 3 | "version": "2.0.2", 4 | "description": "Vue Rave Payment Component for Vue 2.x.", 5 | "main": "dist/rave.min.js", 6 | "scripts": { 7 | "lint": "eslint src --ext=js,vue || exit 0", 8 | "lint:fix": "eslint src --ext=js,vue --fix || exit 0", 9 | "dev": "webpack --env=webpack.dev && webpack-dev-server --content-base=./examples/commonjs --env=webpack.dev --open --hot", 10 | "dist": "webpack --env=webpack.dist" 11 | }, 12 | "repository": { 13 | "type": "git", 14 | "url": "git+https://github.com/iamraphson/vue-ravepayment.git" 15 | }, 16 | "files": [ 17 | "dist", 18 | "src" 19 | ], 20 | "keywords": [ 21 | "Rave", 22 | "Vue", 23 | "Vuejs", 24 | "Vue 2", 25 | "Payment Gateway", 26 | "Rave Payment", 27 | "Flutterwave" 28 | ], 29 | "author": "Ayeni Olusegun", 30 | "license": "MIT", 31 | "bugs": { 32 | "url": "https://github.com/iamraphson/vue-ravepayment/issues" 33 | }, 34 | "homepage": "", 35 | "devDependencies": { 36 | "@babel/cli": "^7.5.5", 37 | "@babel/core": "^7.5.5", 38 | "@babel/preset-env": "^7.5.5", 39 | "babel-loader": "^8.0.6", 40 | "css-loader": "^3.2.0", 41 | "eslint": "^6.1.0", 42 | "eslint-config-vue": "^2.0.2", 43 | "eslint-loader": "^2.2.1", 44 | "eslint-plugin-vue": "^5.2.3", 45 | "standard": "^13.1.0", 46 | "uglifyjs-webpack-plugin": "^2.2.0", 47 | "vue": "^2.6.10", 48 | "vue-loader": "^15.7.1", 49 | "vue-template-compiler": "^2.6.10", 50 | "webpack": "^4.39.1", 51 | "webpack-cli": "^3.3.6", 52 | "webpack-dev-server": "^3.8.0" 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /rave-demo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iamraphson/vue-ravepayment/371faba31d38a72a9b06cd20c790c3096caf99e5/rave-demo.png -------------------------------------------------------------------------------- /src/index.js: -------------------------------------------------------------------------------- 1 | import rave from './rave.vue' 2 | 3 | export default rave 4 | -------------------------------------------------------------------------------- /src/rave.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 127 | 135 | -------------------------------------------------------------------------------- /webpack.config.js: -------------------------------------------------------------------------------- 1 | function buildConfig(env) { 2 | return require('./build/' + env + '.js') 3 | } 4 | 5 | module.exports = buildConfig 6 | --------------------------------------------------------------------------------