How to label payments in Gravity Forms Paypal Pro -
the situation: company wants enable donations through website. there 2 ways user can donate. 1. technology. 2. invest in project.
the set-up: using gravity forms , paypal payments pro add-on payment processing on website. ('working great.')
my issue: i'de ensure payments labeled when passed paypal account. i.e want know when donates money should go. although payments go 1 account. in paypal pro can add comments transactions. need able automatically add comment when form submitted.
the solution: use below code add comment filter gravity forms pay pal pro. when payment processed given form, appears in paypal account comment.
add_filter( 'gform_paypalpaymentspro_args_before_payment','add_donation_comment', 10, 2 ); function add_donation_comment( $args, $form_id ) { // not edit $args or $form_id // apply form 1 if ( 1 == $form_id ) { // replace '1' form id $args["comment1"] = 'field project'; // comment1 arg paypal pro uses. } // apply form 2 if ( 2 == $form_id ) { // replace '2' form id $args["comment1"] = 'help grow'; } // return args, if not changing return $args; }
Comments
Post a Comment