{"size": 956, "ext": "js", "max_stars_repo_path": "js/cartPayment.js", "max_stars_repo_name": "FlorenceMawusi/hairNow", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "js/cartPayment.js", "max_issues_repo_name": "FlorenceMawusi/hairNow", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "js/cartPayment.js", "max_forks_repo_name": "FlorenceMawusi/hairNow", "max_forks_repo_forks_event_min_datetime": "2020-11-19T09:39:25.000Z", "max_forks_repo_forks_event_max_datetime": "2020-11-19T09:39:25.000Z"}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": 1, "avg_line_length": 31.8666666667, "max_line_length": 92, "alphanum_fraction": 0.6830543933}
const paymentForm = document.getElementById("paymentForm");
const amt = document.getElementById("amount").value;
console.log("valud of payment form -> ", paymentForm);

paymentForm.addEventListener("submit", payWithPaystack, false);
function payWithPaystack(e) {
  e.preventDefault();
  let handler = PaystackPop.setup({
    key: "pk_test_5567390775aab8f3b49dea2064e8530e804b4133", // Replace with your public key
    email: document.getElementById("email-address").value,
    amount: document.getElementById("amount").value * 100,
    currency: "GHS",
    // label: "Optional string that replaces customer email"
    onClose: function () {
      alert("Transaction was not complete. Window closed.");
    },
    callback: function (response) {
      console.log(response);
      window.location =
        "../Actions/process_payment.php?reference=" +
        response.reference +
        "&amount=" +
        amt;
    },

  });
  handler.openIframe();
}

