meteor - Cannot call method 'create' of undefined -


here i'm getting console server side.

i20140516-21:27:12.142(0)? there error on page. cannot call method 'create' of undefined

i not finding reason why method isn't defined. have balanced-payments-production package atmosphere loaded , includes balanced.js file , api export server. here appreciated.

here events.js file

template.checkformsubmit.events({     'submit form': function (e, tmpl) {         e.preventdefault();         var recurringstatus = $(e.target).find('[name=is_recurring]').is(':checked');         var checkform = {             name: $(e.target).find('[name=name]').val(),             account_number: $(e.target).find('[name=account_number]').val(),             routing_number: $(e.target).find('[name=routing_number]').val(),             recurring: { is_recurring: recurringstatus },             created_at: new date         }         checkform._id = donations.insert(checkform);              meteor.call("addcustomer", checkform, function(error, result) {                 console.log(error);                 console.log(result);                 // successful tokenization             if(result.status_code === 201 && result.href) {                 // send backend                 jquery.post(responsetarget, {                     uri: result.href                 }, function(r) {                     // check backend result                     if(r.status === 201) {                         // successful logic here backend                     } else {                         // failure logic here backend                     }                 });             } else {                 // failed tokenize, error logic here             }              // debuging, displays tokenization result in pretty div             $('#response .panel-body pre').html(json.stringify(result, false, 4));             $('#response').slidedown(300);             });          var form = tmpl.find('form');         //form.reset();         //will need add route receipt page here.         //something maybe - router.go('receiptpage', checkform);     },     'click [name=is_recurring]': function (e, tmpl) {       var id = this._id;       console.log($id);       var isrecuring = tmpl.find('input').checked;        donations.update({_id: id}, {         $set: { 'recurring.is_recurring': true }         });     } }); 

here methods.js file

function getcustomer(req, callback) {     try {         balanced.marketplace.customers.create(req, callback);         console.log(req.links.customers.bank_accounts);     }     catch (error){         var error = "there error on page. " + error.message;         console.log(error);     } }  var wrappedgetcustomer = meteor._wrapasync(getcustomer);  meteor.methods({     addcustomer: function(formdata) {         try {             console.log(formdata);             return wrappedgetcustomer(formdata);         }         catch (error) {             var error = "there error on page." + error.message;             console.log(error);         }     } }); 

i needed run balanced.configure('apikeyhere'); first, run balanced code.


Comments

Popular posts from this blog

how to proxy from https to http with lighttpd -

android - Automated my builds -

python - Flask migration error -