- A requirement is to have Node.js and git installed on your system. If you don't have them you can download them from:
Note: Cordova is a development environment that enables you to create apps for different platforms e.g. iOS, Android, Windows, Browser etc.
- Run your node.js command line
- Install the Cordova module using npm utility of Node.js. The cordova module will automatically be downloaded by the npm utility.
For OS X and Linux
sudo npm install -g cordova
(write the following command in the command line then hit enter on your keyboard)
npm install -g cordova
.(write the following command in the command line then hit enter on your keyboard).
Note; The download begins automatically, make take a few minutes
- Create your first project. You can do this by:
a) Go to the directory where you maintain your source code, and create a cordova project;
cordova create hello com.example.hello HelloWorld
This creates the required directory structure for your cordova app. By default, the cordova create script generates a skeletal web-based application whose home page is the project's www/index.html file.
- Now add your browser e.g. Chrome, Firefox etc. to add your browser use the following code:
cordova platform add browser and to add the latest version of your browser cordova platform add [email protected]
then hit enter on your keyboard
Wait till the installation of the browser finalizes.
- Run the browser by entering the following codes: cordova run browser, or *cordova run
- To install rave payment navigate to your app using git
- Write the following command: npm install cordova-rave and hit enter on your keyboard
Note: this installs the rave package in your app.
- To configure the rave payment write the following code: cd node_modules/cordova-rave && npm start and hit enter on your keyboard
Note: Once it has run it will prompt you for your rave payment public key and other required fields that are required to be filled follow.
1.PBFPubKey: FLWPUBK-20795b3bfe02a5af632c8901d90e7591-X 2. amount: 100 3. customer_email: [email protected] 4. currency: NGN 5. country: NG 6. custom_title: 7. custom_description: 8. redirect_url: https://www.google.com 9.custom_logo: 10. liveMode: No
hit enter on the last promt
- Input npm run build .This ultimately creates a rave.js file into your www directory. Link to this file in your root index template. If you modify your config.json at anytime, you need to run the build again.
- Open your app in your favourite text editor
- Navigate to the index.html file in the www directory
- Edit the HTML fILE with the following codes as follows:
Note: Your index.html file should look like this
- Save the file and run it in your Cordova browser
- Click on the button you created
- You have successfully implemented rave payment on your app
Updated 11 months ago