Home › Forums › Stripe Payments Plugin › How to get JSON data from custom field? › Reply To: How to get JSON data from custom field?
January 6, 2020 at 11:00 am
#2593
alexanderfoxc
Participant
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.