Stripe Payment And Its Error

I am trying Payments Integration Via React.
In front end i am using this code. This is giving stripe Id.

Front end code:


    if (!stripe || !card) {
      setError("Stripe is not initialized");

    try {
      const result = await stripe.createToken(card, {
        name: formData.cardholder_name,
        email: formData.cardholder_email,
      console.log("stripe-result", result);

      if (result.error) {
      } else if (result.token) {
        const response = await fetch(
            method: "POST",
            headers: {
              "Content-Type": "application/json",
            body: JSON.stringify({
              data: JSON.stringify(formData),
              // reference_doctype: "Payment Gateway", // Replace with your reference doctype
              // reference_docname: "Stripe-Stripe Test", // Replace with your reference docname

        if (response.ok) {
          const data = await response.json();

          if (data.status === "Completed") {
            console.log("Payment successful");
          } else {
            console.error("Payment failed");
        } else {
          console.error("Error making payment");
    } catch (error) {
      console.error("Stripe token creation error:", error);
        "An error occurred during payment processing. Please try again."
    } finally {

Which doctype i need to mention Stripe Settings is already available in doctype i mentioned that once.
i created a Stripe Test in Stripe Setting which is having my api key and secret.

In Payment Gateway Doctype List
I have Stripe-Stripe Test 
it has connected with
Gateway Settings - Stripe Settings
Gateway Controller - Stripe Test

I copied the api from payments app and moved to my app, 

My python code:
def get_gateway_controller(doctype, docname):
	reference_doc = frappe.get_doc(doctype, docname)
	gateway_controller = frappe.db.get_value(
		"Payment Gateway", reference_doc.payment_gateway, "gateway_controller"
	return gateway_controller

def make_payment(stripe_token_id, data, reference_doctype="Payment Gateway", reference_docname="Stripe-Stripe Test"):
    data = json.loads(data)
    frappe.log_error("data_error", data)

    data.update({"stripe_token_id": stripe_token_id})
    frappe.log_error("data", data)

    gateway_controller = get_gateway_controller(reference_doctype, reference_docname)
    frappe.log_error("gateway_controller", gateway_controller)

    if is_a_subscription(reference_doctype, reference_docname):
        reference = frappe.get_doc(reference_doctype, reference_docname)
        frappe.log_error("reference", reference)
        data = reference.create_subscription("stripe", gateway_controller, data)
        frappe.log_error("data2", data)
        data = frappe.get_doc("Stripe Settings", gateway_controller).create_request(data)
        frappe.log_error("data3", data)

    return data

I am getting this error how to solve and make it work help please
or can we call the payments app from react ???
{exception: "AttributeError: 'PaymentGateway' object has no attribute 'payment_gateway'",…}
"[\"Traceback (most recent call last):\\n  File \\\"apps/frappe/frappe/\\\", line 53, in application\\n    response = frappe.api.handle()\\n  File \\\"apps/frappe/frappe/\\\", line 53, in handle\\n    return _RESTAPIHandler(call, doctype, name).get_response()\\n  File \\\"apps/frappe/frappe/\\\", line 69, in get_response\\n    return self.handle_method()\\n  File \\\"apps/frappe/frappe/\\\", line 79, in handle_method\\n    return frappe.handler.handle()\\n  File \\\"apps/frappe/frappe/\\\", line 48, in handle\\n    data = execute_cmd(cmd)\\n  File \\\"apps/frappe/frappe/\\\", line 86, in execute_cmd\\n    return, **frappe.form_dict)\\n  File \\\"apps/frappe/frappe/\\\", line 1591, in call\\n    return fn(*args, **newargs)\\n  File \\\"apps/frappe/frappe/utils/\\\", line 33, in wrapper\\n    return func(*args, **kwargs)\\n  File \\\"apps/turiya_app/turiya_app/\\\", line 811, in make_payment\\n    gateway_controller = get_gateway_controller(reference_doctype, reference_docname)\\n  File \\\"apps/frappe/frappe/utils/\\\", line 33, in wrapper\\n    return func(*args, **kwargs)\\n  File \\\"apps/turiya_app/turiya_app/\\\", line 799, in get_gateway_controller\\n    \\\"Payment Gateway\\\", reference_doc.payment_gateway, \\\"gateway_controller\\\"\\nAttributeError: 'PaymentGateway' object has no attribute 'payment_gateway'\\n\"]"
"AttributeError: 'PaymentGateway' object has no attribute 'payment_gateway'"

Please take a look at this sir @buildwithhussain

Did you find a solution? I am facing a similar problem