document.addEventListener("tripzzyGatewayPaymentSuccess", function (event) {
  const { detail } = event;
  const { paymentDetails } = detail;
  let formElement = document.getElementById("tripzzy-checkout-form");

  if (formElement) {
    // Payment Details
    let paymentDetailElement = document.getElementById(
      "tripzzy-payment-details",
    );

    paymentDetailElement.value = JSON.stringify(paymentDetails);
    formElement.submit();
  }
});
