Search code examples
javascriptpaymill

Paymill undefined is not a function


I'm trying to use the Paymill bridge and create a token from JS inside the webpage on the client side. I have the bridge added as a script inside the HTML page.

Code:

   paymill.createToken({
              number:         Ember.$('#card-number').val(),       // required
              exp_month:      Ember.$('#card-expiry-month').val(), // required
              exp_year:       Ember.$('#card-expiry-year').val(),  // required
              cvc:            Ember.$('#card-cvc').val(),          // required
              amount_int:     "2000",                              // required, e.g. "4900" for 49.00 EUR
              currency:       "EUR",                               // required
              cardholder:     Ember.$('#card-holdername').val()    // optional
            }, this.submitPayment);
            return false;

Error:

Uncaught TypeError: undefined is not a function (index):114 
H.onload.H.onerror.H.onreadystatechange  (index):144

Solution

  • So apparently this just fixed by itself. Ember CLI + JS bullsh*t.