const contractHelper = require('../contracts/contractHelpers.js');
const web3Connection = require('../web3.js');
const loggers = require('../loggers/events.js');

const web3 = web3Connection.web3;

const buySvc = {
  buyTicket: (req, res) => {
    const contractAddress = req.body.contractAddress; // address of deployed contract;
    const fromAddress = req.body.fromAddress;
    const name = req.body.name;
    const eventContractInstance = web3.eth.contract(contractHelper.contractObj).at(contractAddress);
    eventContractInstance.buyTicket(name, {
      from: fromAddress,
      value: req.body.price,
    }, (err) => {
      if (err) {
        console.log(err);
        loggers(eventContractInstance).ExceedQuota();
        loggers(eventContractInstance).InsufficientEther();
        res.sendStatus(500);
      } else {
        loggers(eventContractInstance).PurchaseTicket((error, result) => {
          res.status(200).send(`Number of attendees: ${result.args._numAttendees.toString()}`);
        });
      }
    });
  },
};

module.exports = buySvc;

@@ -511,45 +511,20 @@
     
-eventContractInstance.buyTicket(name,
+const opts =
  %7B%0A 
@@ -581,16 +581,126 @@
 e,%0A    %7D
+;%0A    if (req.body.gas) %7B%0A      opts.gas = req.body.gas;%0A    %7D%0A%0A    eventContractInstance.buyTicket(name, opts
 , (err) 

Add option to define amount of gas sent in post request