title: How to add total orders into PayPal javascript button
body: <p>We have a paypal sandbox checkout button for the website and we have to insert our cart totals into the javascript for it to work.</p>
  
  <pre><code>payment: function (data, actions) {
      return actions.payment.create({
        transactions: [{
          amount: {
            total: '0.01',
            currency: 'USD'
          }
        }]
      });
    },
  </code></pre>
  
  <p>How can we retrieve the total amount from our DB and show it on the page?</p>
  
  <p>Query for total:</p>
  
  <pre><code>insert the total amount from query for the total SELECT SUM(iQty * iUnitPrice) AS Total FROM OrdersItem WHERE (iOrderID = @Param1)
  </code></pre>
  
  <p>Thank you</p>