Giter VIP home page Giter VIP logo

paytm_web_sample_kit_ruby's Introduction

How to install the sample kit on a web server:

  1. Copy the 'samplekit' folder in document root of your server (like /var/www/html)
  2. The 'samplekit' folder is having the following files:
  • TxnTest.html - Testing transaction through Paytm gateway.
  • generate_checksum.rb - This file has the logic of checksum generation and passing all required parameters to Paytm PG.
  • verify_checksum.rb - This file has the logic for processing PG response after the transaction processing.
  • paytm/encryption_new_pg.rb - This is the library file.
  1. Open generate_checksum.rb file from the folder and update the below values (these can be downloaded from the Paytm portal. One time downloadable).
  • PAYTM_MERCHANT_KEY = ""
  • WEBSITE = ""
  • MID = ""
  • INDUSTRY_TYPE_ID = ""
  • CHANNEL_ID = ""
  1. Provide the required values by running the TxnTest.html file and click on the 'submit' button to process a test transaction.

To generate checksum in Ruby :

  1. Create an associative array with key value pair of following paytm parameters (MID, ORDER_ID, CUST_ID, INDUSTRY_TYPE_ID, CHANNEL_ID, TXN_AMOUNT, EMAIL, WEBSITE)
  2. To generate checksum, call the following method. This function returns the checksum as a string. new_pg_checksum(paytmparams, merchant key).gsub("\n",'') where,
  • 'paytmparams' is an associative array containing Paytm parameters.
  • 'merchant key' is the Paytm Merchant Key provided by Paytm.

To verify checksum in Ruby:

  1. Get all the parameters received from Paytm and put them in an associative array (“key => value” pair).
  2. Get the CHECKSUMHASH parameter value received from Paytm store in a variable and remove the parameter from the array
  3. To verify checksum call the following function. This function returns a Boolean (true/false) new_pg_verify_checksum(paytmparams, check_sum, merchant_key) where,
  • 'paytmparams': is a parameter array which was created in step 1 of this section (NOTE: Do not include the CHECKSUMHASH parameter)
  • 'check_sum' : Is the CHECKSUMHASH parameter as received in step 2.
  • 'merchant_key': Is the merchant key received from Paytm

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.