Skip to content

Instantly share code, notes, and snippets.

@Shelob9
Last active April 1, 2017 01:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Shelob9/33a08a02ee77ad1285d23143fc46a907 to your computer and use it in GitHub Desktop.
Save Shelob9/33a08a02ee77ad1285d23143fc46a907 to your computer and use it in GitHub Desktop.
<?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