2016-12-01 71 views
0

我对玉石模板语言不太熟悉,但对手柄栏颇为熟悉。我需要使用hbs,因为我的项目基于hbs。如何将模板从玉石转换为HBS?

我有以下支付给nodejs express的braintree支付,他们的观点是基于玉的。 https://github.com/braintree/braintree_express_example/blob/master/views/checkouts/new.jade

form#payment-form(action="/checkouts", method="post") 
     section 
     .bt-drop-in-wrapper 
      #bt-dropin 

     label(for="amount") 
      span.input-label Amount 
      .input-wrapper.amount-wrapper 
      input#amount(name="amount" type="tel" min="1" placeholder="Amount" value="10") 

     button.button(type="submit") 
     span Test Transaction 

    script(src="https://js.braintreegateway.com/js/braintree-2.27.0.min.js") 
    script. 
    (function() { 
     var checkout = new Demo({ 
     formID: 'payment-form' 
     }); 

     var token = "#{clientToken}"; 
     braintree.setup(token, "dropin", { 
     container: "bt-dropin" 
     }); 

下面是我的路由器

router.post('/', parseUrlEnconded, function (request, response) { 

    var transaction = request.body; 

    gateway.transaction.sale({ 
    amount: 7, 
    paymentMethodNonce: transaction.payment_method_nonce 
    }, function (err, result) { 

    if (err) throw err; 

    if (result.success) { 
    [...] 

我基本上是想在视图中显示的付款形式,并提交给服务器

回答