Title: Custom Field
Last modified: January 16, 2018

---

# Custom Field

 *  Resolved [dadelayer](https://wordpress.org/support/users/dadelayer/)
 * (@dadelayer)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/custom-field-76/)
 * Hi,
    Love the plugin so far. I just need 1 option to make it perfect. On my checkout
   page, would it be possible to add a textbox that ask for information, for example
   like favorite color. Once they submit the payment, if the payment is successful,
   that information they typed into the textbox is sent to the database, or sent
   to another server like this : [http://server.com](http://server.com)**?color=
   WhatTheyTyped**

Viewing 15 replies - 1 through 15 (of 15 total)

 *  Plugin Support [mbrsolution](https://wordpress.org/support/users/mbrsolution/)
 * (@mbrsolution)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/custom-field-76/#post-9871099)
 * Thank you for your suggestion. I have submitted a message to the developers to
   investigate further your request.
 * Kind regards
 *  Plugin Author [mra13](https://wordpress.org/support/users/mra13/)
 * (@mra13)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/custom-field-76/#post-9871425)
 * We will look at adding something for it.
 *  [rogbiz](https://wordpress.org/support/users/rogbiz/)
 * (@rogbiz)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/custom-field-76/#post-9872022)
 * For me, it would be ideal to have a checkbox – in particular for confirming that
   the purchaser is happy to receive further emails from us. Otherwise any follow
   up emails are legally considered spam!
 * Otherwise thanks for a really good plugin.
 *  Plugin Contributor [Alexander C.](https://wordpress.org/support/users/alexanderfoxc/)
 * (@alexanderfoxc)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/custom-field-76/#post-9872442)
 * Thank you for your input, gentlemen. And also thanks for example usage cases.
   I didn’t quite get why would you need to send a value to some other server, but
   a checkbox to subscribe to newsletter is pretty clear usage case.
 * Stripe doesn’t allow to insert any custom fields into its payment pop-up. So 
   this additional field (or checkbox) should be added either before the payment
   or after it (on checkout results page, for example).
 * Can’t give you any ETA at the moment, but this would be surely added to the things
   to implement.
 *  Thread Starter [dadelayer](https://wordpress.org/support/users/dadelayer/)
 * (@dadelayer)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/custom-field-76/#post-9875044)
 * > I didn’t quite get why would you need to send a value to some other server
 * It’s actually on the same server. Let’s say for example that I have users who
   pay for service somewhere else. If they pay for it via stripe, their username
   should continue to be “VIP” or something like that. Right now, all I can do is
   redirect them to a page after they pay, I have no way of updating my database
   and giving them VIP status.
 * I thought that on successful payment, it would take their username that they 
   type in and sends it to another PHP script I create, and add their username in
   the database. That’s just one way I thought of doing it
 *  Plugin Contributor [Alexander C.](https://wordpress.org/support/users/alexanderfoxc/)
 * (@alexanderfoxc)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/custom-field-76/#post-9876947)
 * [@dadelayer](https://wordpress.org/support/users/dadelayer/), thanks for your
   explanations. Will try to think of a way how this could be achieved.
 *  Plugin Contributor [Alexander C.](https://wordpress.org/support/users/alexanderfoxc/)
 * (@alexanderfoxc)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/custom-field-76/#post-9877363)
 * Ok, I figured how this could be done. It would work the same as custom amount
   is currently working. E.g. there will be an input (or a checkbox; depending what
   you select in the settings), which you can use for your purposes. It can be made
   mandatory in the settings as well, so users won’t be able to proceed to the payment
   unless they fill it (or click the checkmark – this could be useful for accepting
   terms and conditions, for example). This input’s name and value would be placed
   into the order info, plus emailed to you if you set it in the settings.
 * To catch the value programmatically, the plugin will do_action() with the array
   containing user information he entered during the payment, including the custom
   field name and value. You can then attach to this hook and do what you want with
   the entered username or checkbox status.
 * Does it sounds like a plan?
 *  Thread Starter [dadelayer](https://wordpress.org/support/users/dadelayer/)
 * (@dadelayer)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/custom-field-76/#post-9878677)
 * [@alexanderfoxc](https://wordpress.org/support/users/alexanderfoxc/), that sounds
   fantastic. With the username information or checkbox confirmation data after 
   the payment, I could then go ahead and do some backend things with it.
 *  Plugin Contributor [Alexander C.](https://wordpress.org/support/users/alexanderfoxc/)
 * (@alexanderfoxc)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/custom-field-76/#post-9881547)
 * Ok, I have assembled a testing version of the plugin with Custom Field functionality
   implemented – [https://stripe-plugins.com/testing/stripe-payments-1.7.2_testing1.zip](https://stripe-plugins.com/testing/stripe-payments-1.7.2_testing1.zip)
 * Custom Field Settings are located in Stripe Payments -> Settings, Advanced Settings
   tab. I think those pretty much self-explanatory.
 * To be able to receive the information entered in this custom field by email, 
   you need to add {custom_field} tag to email body on Email Settings page.
 * To receive the value programmatically (that’s for you [@dadelayer](https://wordpress.org/support/users/dadelayer/)),
   you need to listen for ‘asp_stripe_payment_completed’ hook (e.g. add_action(‘
   asp_stripe_payment_completed’,’your_function_to_handle_it’,10,2); ). The action
   is passing 2 parameters – $post_data and $charge. What you need is in $post_data[‘
   custom_field_value’]. Keep in mind it could be not set (if custom field is a 
   checkbox), so before working with it, make sure it’s set ( if (isset($post_data[‘
   custom_field_value’])) { //do your thing} ). $post_data array also has some additional
   information available, like button or product name, paid amount etc.
 * Please let me know how it goes.
    -  This reply was modified 8 years, 3 months ago by [Alexander C.](https://wordpress.org/support/users/alexanderfoxc/).
 *  [rogbiz](https://wordpress.org/support/users/rogbiz/)
 * (@rogbiz)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/custom-field-76/#post-9888469)
 * Alexander,
 * I’ve implemented and tested (as checkbox only), all seems fine thanks. A few 
   minor observations:
    1. Settings – Custom Field Settings – heading says “Filed
   Type” instead of Field Type 2. Under ‘Enable for all Buttons and Products’ there’s
   a typo “… when shorcode…” 3. Ideally there should be a way to opt for the custom
   field to be included in the Product display (/asp-products/productname/), but
   if you have a page with a shortcode call instead you can get around this. 4. 
   It would be great to include in the documentation info about the formatting so
   we can modify in custom css.
 * But this works for me thanks!
 * Roger
 *  Plugin Author [mra13](https://wordpress.org/support/users/mra13/)
 * (@mra13)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/custom-field-76/#post-9888583)
 * The new version of this plugin has a feature for it.
 *  Plugin Author [mra13](https://wordpress.org/support/users/mra13/)
 * (@mra13)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/custom-field-76/#post-9888584)
 * Thank you. We have fixed the typo.
 *  [rogbiz](https://wordpress.org/support/users/rogbiz/)
 * (@rogbiz)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/custom-field-76/#post-9889162)
 * One more suggestion – it can help to have a sentence of explanation for the custom
   field, so a larger (or expansible) text box in the settings area would be helpful.
 *  Thread Starter [dadelayer](https://wordpress.org/support/users/dadelayer/)
 * (@dadelayer)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/custom-field-76/#post-9889952)
 * Thanks for the update guys. I was trying this out and it works but I’m going 
   to have to add some custom code into the stripe::success_payment otherwise people
   can just add their own username to my database haha
 *  Plugin Contributor [Alexander C.](https://wordpress.org/support/users/alexanderfoxc/)
 * (@alexanderfoxc)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/custom-field-76/#post-9893644)
 * Hey gentlemen, thank you for your input. I’ve been away for a couple of days,
   but as you can see our team is doing the job regardless of my presence 🙂
 * [@rogbiz](https://wordpress.org/support/users/rogbiz/), thank you for your detailed
   report. We have fixed typos, also added a link to documentation in plugin settings.
   If you need any help regarding CSS, please do let me know. We will add this to
   the documentation a bit later though, when everything is gathered in one piece.
 * [@dadelayer](https://wordpress.org/support/users/dadelayer/), you can just catch
   the hook I was referring to in my previous message and do all the checks etc.
   there. No need to add any additional code to the plugin itself (it will get overwritten
   during the update), so just make it in a proper way once and you won’t have to
   worry about it anymore 🙂

Viewing 15 replies - 1 through 15 (of 15 total)

The topic ‘Custom Field’ is closed to new replies.

 * ![](https://ps.w.org/stripe-payments/assets/icon-128x128.png?rev=2705524)
 * [Accept Stripe Payments](https://wordpress.org/plugins/stripe-payments/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/stripe-payments/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/stripe-payments/)
 * [Active Topics](https://wordpress.org/support/plugin/stripe-payments/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/stripe-payments/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/stripe-payments/reviews/)

 * 15 replies
 * 5 participants
 * Last reply from: [Alexander C.](https://wordpress.org/support/users/alexanderfoxc/)
 * Last activity: [8 years, 3 months ago](https://wordpress.org/support/topic/custom-field-76/#post-9893644)
 * Status: resolved