Last active
April 1, 2017 01:48
-
-
Save Shelob9/33a08a02ee77ad1285d23143fc46a907 to your computer and use it in GitHub Desktop.
Filter examples for Caldera Forms Stripe https://calderaforms.com/downloads/caldera-forms-stripe-add-on/ https://calderaforms.com/doc/controlling-stripe-charge-data/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//this applies change when creating plans | |
add_filter( 'cf_stripe_recurring_args', 'my_cf_stripe_customer_filter', 10, 2 ); | |
//this applies change when creating one time payments | |
add_filter( 'cf_stripe_charge_args', 'my_cf_stripe_customer_filter', 10, 2 ); | |
//this is the callback to change arguments sent to API | |
//Be careful not to set a field that isn't supported or the API will reject the charge. | |
function my_cf_stripe_customer_filter( $args, $form ){ | |
/* Change this to the right field ID */ | |
$field_id = 'fld_13345'; | |
$args[ 'description' ] = Caldera_Forms::get_field_data( $field_id, $form ); | |
return $args; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment