Javascript expert required

I need an expert in javascript to help me with a piece of code. Basically i need to generate a uuidv4 and pass it to the tx_ref parameter in makePayment function please see both functions below it needs to be done dynamically everytime the page loads.

function uuidv4() {

return ([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g, c =>

(c ^ [login to view URL](new Uint8Array(1))[0] & 15 >> c / 4).toString(16)



[login to view URL](uuidv4());

<script src="[login to view URL]"></script>



Your order is ₦54,600


<button type="button" id="start-payment-button" onclick="makePayment()">Pay Now</button>



function makePayment() {



tx_ref: "titanic-48981487343MDI0NzMx",

amount: 54600,

currency: "NGN",

payment_options: "card, banktransfer, ussd",

redirect_url: "[login to view URL]",

meta: {

consumer_id: 23,

consumer_mac: "92a3-912ba-1192a",


customer: {

email: "[login to view URL]",

phone_number: "08102909304",

name: "Rose DeWitt Bukater",


customizations: {

title: "The Titanic Store",

description: "Payment for an awesome cruise",

logo: "[login to view URL]",





Skills: JavaScript, jQuery / Prototype, HTML5, HTML

About the Client:
( 40 reviews ) Borehamwood, United Kingdom

Project ID: #33740337

Awarded to:


Hi greetings of the day I am a Experienced Full Stack Developer based out in Chennai,India. I am Ready to start now. Thanking you, All the very best, Cheers!!! Saurav

$25 USD in 1 day
(108 Reviews)

5 freelancers are bidding on average $40 for this job


Hello, I read your project description. I am ready to start working quickly on your project. I look forward to your response to discuss this work immediately ... I am an experienced web developer and I can wo More

$100 USD in 1 day
(22 Reviews)

Hi there, I develop websites since 2012, so it is total of 10 years of experienced in HTML5, CSS, PHP, CRM, MVC, MySQL, Javascript, Wordpress, Shopify, joomla, drupal, opencart, jQuery, Ajax. I love to code. One thing More

$30 USD in 1 day
(13 Reviews)

Dear Client! I am available for your project, and can start immediately. I’ve previously worked on the exact same type of projects for another client. I have read carefully about your job description and I am now confi More

$25 USD in 1 day
(5 Reviews)

Hello, Greetings! I am familiar with Vue, React and Angular and I have a lot of work experiences in jQuery / Prototype, HTML5, HTML and JavaScript. I can start right away. I want to discuss for this project in detail. More

$20 USD in 1 day
(0 Reviews)