import { errorRecord } from "../../common/libEventLog/libCrashlytics/libCrashlyticsEvent";
import { PAYMENT_GETWAY_URL } from "../../Api/ApiUrls";
var UserExperior = require("react-native-userexperior");

// instructions
export const generatePaymentLink = async ({ body }) => {
    console.log("URL ",PAYMENT_GETWAY_URL);
  UserExperior.startTimer(PAYMENT_GETWAY_URL);
  try {
    const res = await fetch(PAYMENT_GETWAY_URL, {
      method: "POST",
      headers:{
          'Authorization':"DC71C06EA5B2A5C92C566DAE76F74FB7",
          'Content-Type':"application/json"
      },
      body:JSON.stringify(body)
    });
    let data = await res.json();
    UserExperior.endTimer(PAYMENT_GETWAY_URL);
    return data;
  } catch (err) {
    errorRecord(err);
    console.log(err);
  }
};
