-
Notifications
You must be signed in to change notification settings - Fork 23
Description
Is your feature request related to a problem? Please describe.
I'd like to have a reliable way to programmatically get custom payment form fields for an invoice.
Currently I believe you can only get the custom payment form fields from the payment_form_data meta field saved for a given invoice, but it saves an associative array where the keys are the actual human-readable label of the field. This label could change and that would break code that is reading those fields.
Describe the solution you'd like
I would like to be able to specify a "key" that the data for this field will be saved as instead of using the label that's shown to the user. For example when I create a custom text field with a label "Any special dietary requirements?" I want to be able to set its internal array key to say "dietary" so that I can reliably do this, regardless if I decide to update the label shown to the user later:
$data = get_post_meta($invoice_id, 'payment_form_data');
$requirements = $data['dietary']; // instead of $data['Any special dietary requirements?']