- This topic has 2 replies, 3 voices, and was last updated 4 years, 11 months ago by .
Viewing 3 posts - 1 through 3 (of 3 total)
Viewing 3 posts - 1 through 3 (of 3 total)
- You must be logged in to reply to this topic.
Stripe payment plugins for your WordPress site
· ·
Home › Forums › Stripe Payments Plugin › How to get JSON data from custom field?
Tagged: custom field
Uses the stripe custom plug-in additional custom field. Could you tell me how to get the value entered in the created field as JSON data?
This is not something we offer (this is not an advertized feature). The custom field data is available in the orders menu. You can also add it to the seller notification email.
If you know WP programming, you can get custom fields by hooking into following action:
asp_stripe_payment_completed
Here’s a quick example:
function get_custom_fields_data($data, $charge) {
if (isset($data['custom_fields']) {
// we got custom fields
$custom_fields=$data['custom_fields'];
} else {
// no custom fields
}
}
add_action('asp_stripe_payment_completed','get_custom_fields_data',10,2);
You’ll get custom fields in $custom_fields
PHP array. You can then convert it to JSON or do whatever you like with it.