the onclick event i would need it to appear in this code`to place order information in database. Also how do i display order id as four numbers.
this is javascript
// Provide values from the current cart order
var amount = <?php global $woocommerce; print WC()->cart->total; ?>;
var merchantOrderId = '<?php print time(); ?>';
var apiKey = 'm85BXXLpf_icrSvqbElR11xquEgmKZ8wfeRb2ly3-G7pIwCKDuytgplB7AQGi-5t';
renderMMoneyPaymentButton(amount, merchantOrderId, apiKey)
You can only get the Order ID after checkout when the order has been placed and paid in "Order received" page… The following will set in your javascript the order ID and the order total amount:
Code goes in function.php file of your active child theme (or active theme). It should works.