On a fresh install of the payments app, my Stripe checkout isn't working :(
#… Description:
In short the `payment_plan` field isn't found?
# Investigation
I can't fully discern how it's supposed to work from an [inspection of the codebase](https://github.com/search?q=repo%3Afrappe%2Fpayments%20payment_plan&type=code)
It's breaking at the checkout:
https://github.com/frappe/payments/blob/f84edf918e52d07c1f612e6f8bbf6aafba1abd47/payments/templates/pages/stripe_checkout.py#L44
*Image of the `payment request` fields (no `payment_plan` field in it (even after bench-migration)):*
![image](https://github.com/frappe/payments/assets/108212671/592ba197-32d2-4ef9-8a55-4972c3971496)
![image](https://github.com/frappe/payments/assets/108212671/e4acd9cc-74ea-4c8c-b89d-24c70f128b09)
But it seems the stripe settings should have the field too based on this: https://github.com/frappe/payments/blob/f84edf918e52d07c1f612e6f8bbf6aafba1abd47/payments/payment_gateways/stripe_integration.py#L39-L41
Once again, I don't have the field in the doctype?
*Image of the `stripe settings` fields (no `payment_plan` field here either):*
![342050125-729acb25-ee89-4d40-bcb1-2f9695b8f9c1](https://github.com/frappe/payments/assets/108212671/6e294272-672b-4b43-91a1-d1bcffe6ae9f)
# Logs
Nothing shows up in the backend logs
Haven't been able to find anything in the db either.
Thanks for any help!
# Environment:
Custom Docker Build version 15 (Apps have been super fiddly to get going, so I've made lots of changes to get things sorta working - could have easily corrupted/broken something)
# Error Message:
Traceback shown in client below:
```
Traceback (most recent call last):
File "apps/frappe/frappe/website/serve.py", line 18, in get_response
response = renderer_instance.render()
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "apps/frappe/frappe/website/page_renderers/template_page.py", line 84, in render
html = self.get_html()
^^^^^^^^^^^^^^^
File "apps/frappe/frappe/website/utils.py", line 517, in cache_html_decorator
html = func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "apps/frappe/frappe/website/page_renderers/template_page.py", line 95, in get_html
self.update_context()
File "apps/frappe/frappe/website/page_renderers/template_page.py", line 162, in update_context
data = self.run_pymodule_method("get_context")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "apps/frappe/frappe/website/page_renderers/template_page.py", line 224, in run_pymodule_method
return method(self.context)
^^^^^^^^^^^^^^^^^^^^
File "apps/payments/payments/templates/pages/stripe_checkout.py", line 43, in get_context
payment_plan = frappe.db.get_value(
^^^^^^^^^^^^^^^^^^^^
File "apps/frappe/frappe/database/database.py", line 509, in get_value
result = self.get_values(
^^^^^^^^^^^^^^^^
File "apps/frappe/frappe/database/database.py", line 606, in get_values
out = self._get_values_from_table(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "apps/frappe/frappe/database/database.py", line 835, in _get_values_from_table
return query.run(as_dict=as_dict, debug=debug, update=update, run=run, pluck=pluck)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "apps/frappe/frappe/query_builder/utils.py", line 87, in execute_query
result = frappe.db.sql(query, params, *args, **kwargs) # nosemgrep
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "apps/frappe/frappe/database/database.py", line 220, in sql
self._cursor.execute(query, values)
File "env/lib/python3.11/site-packages/pymysql/cursors.py", line 158, in execute
result = self._query(query)
^^^^^^^^^^^^^^^^^^
File "env/lib/python3.11/site-packages/pymysql/cursors.py", line 325, in _query
conn.query(q)
File "env/lib/python3.11/site-packages/pymysql/connections.py", line 549, in query
self._affected_rows = self._read_query_result(unbuffered=unbuffered)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "env/lib/python3.11/site-packages/pymysql/connections.py", line 779, in _read_query_result
result.read()
File "env/lib/python3.11/site-packages/pymysql/connections.py", line 1157, in read
first_packet = self.connection._read_packet()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "env/lib/python3.11/site-packages/pymysql/connections.py", line 729, in _read_packet
packet.raise_for_error()
File "env/lib/python3.11/site-packages/pymysql/protocol.py", line 221, in raise_for_error
err.raise_mysql_exception(self._data)
File "env/lib/python3.11/site-packages/pymysql/err.py", line 143, in raise_mysql_exception
raise errorclass(errno, errval)
pymysql.err.OperationalError: (1054, "Unknown column 'payment_plan' in 'field list'")
```