Integration Braintree to meteor-ionic


I need some helps, advices, for the integration of braintree to meteor, i follow this tutorial:

And I use this boilerplate:

Fisrt i put this code in app/client/imports/app/components/payment-braintree/payment-braintree.html

{{#if paymentProcessing}}
  {{ >loading}}
  <form id="checkout" method="post">
    <div id="payment-form"></div>
      <button type="submit" class="btn btn-primary btn-block">Subscribe</button>

But i dont really understand this code, and why there is bootstrap button?


import { Template } from 'meteor/templating';  
import { Session } from 'meteor/session';  
import { Meteor } from 'meteor/meteor';  
import braintree from 'braintree-web';  
import { Router } from 'meteor/iron:router';

  plan() {
    return Session.get('plan');
  paymentProcessing() {
    return Session.get('paymentProcessing');

Template.subscribe.onCreated(() => {'getClientToken', (err, clientToken) => {
    if (err) {
      throw new Meteor.Error(err.statusCode, 'Error getting client token from braintree');

    braintree.setup(clientToken, 'dropin', {
      container: 'payment-form',
      paymentMethodNonceReceived(event, nonce) {
        Session.set('paymentProcessing', true);
        const plan = Session.get('plan');'subscribeToPlan', nonce, plan, (error, result) => {
          Session.set('paymentProcessing', false);
          if (error) {
            sweetAlert(error.message, 'error');
          } else {
              title: 'Subscription Successful',
              text: `You are now subscribed to the ${plan} plan`,
              type: 'success',
            }, () => {

I dont understand the “Router”.
Also, in what file do i need to put this code?
Could somebody give me an exemple of code’s adaptation for the Template helpers?

Thanks in advance.