JSFiddle - React, Tailwind, and code Playground

by Norlihazmey Ghazali

HTML

<form id="form" action="https://staging-gateway.revpay.com.my/payment" method="POST">


</form>

JavaScript

var obj = {
  Amount: "108.00",
  Backend_URL: "https://us-central1-gomovertech.cloudfunctions.net/GN001/gomoverRevPay",
  Bank_Code: "",
  Billing_Address: "",
  Card_Category: "",
  Card_Holder_Name: "",
  Card_Issuer_Bank_Country_Code: "",
  Card_Type: "",
  Currency: "MYR",
  Customer_Contact: "",
  Customer_Email: "",
  Customer_ID: "",
  Customer_IP: "121.123.118.2",
  Customer_Name: "",
  Device_ID: "",
  Ecomm_Marketplace: "",
  Funding_CVV: "",
  Funding_Exp_Date: "",
  Funding_Pan: "",
  Geo_Location: "(3.1925996, 101.6590715)",
  Installment_Plan: "",
  Installment_Term: "",
  Key_Index: 1,
  Payment_ID: 3,
  Promo_Code: "",
  Reference_Number: "16430830367990000000350",
  Return_URL: "https://gomover.com.my/home",
  Revpay_Merchant_ID: "MER00000004089",
  Shipping_Address: "",
  Signature: "9ed6a3823c99887341c3e4311d4188a53875ed1d3fbe564e472d6d09ce6fee02a5183e116a3cfb164b781c219188deea50c6a7713463fc4f07847c382e0ed2d8",
  Token_Exp_Date: "",
  Token_Pan: "",
  Transaction_Description: "goMover",
  Transaction_Type: "",
}

var form = document.getElementById('form');

for (var item in obj) {
//console.log(item, obj)
	var node = document.createElement('input');
  
  node.value = obj[item];
  node.name = item;
  node.type = 'text';
  
  form.appendChild(node)
}

form.submit()