PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Passing the Value to Paypal rather than the Label

  1. I have tried to follow the discussion and code at:
    http://www.gravityhelp.com/forums/topic/sending-product-value-instead-of-label-to-paypal
    and
    http://www.gravityhelp.com/documentation/page/Gform_paypal_query

    But, I can't seem to get the code straight in my functions.php to pass the value instead of the label.

    http://gracenetworkintl.org/donation/

    I tried the following code, but the form never goes to Paypal.

    add_filter('gform_paypal_query', 'update_paypal_query', 6, 29);<br />
    function update_paypal_query($query_string, $form, $entry){<br />
    	parse_str($query_string, $qs_param); //put PayPal querystring into an array<br />
    	if (is_array($qs_param)){<br />
    		$field = Donation::get_field($form, 6); //get form field, the 2nd parameter is the field id<br />
    		$value = Donation::get_lead_field_value($entry,$field); //get the value of the field<br />
    		//product fields are pipe-delimited, the value will be the first item in the string<br />
    		if (!empty($value)){<br />
    			$ary_values = explode("|",$value); //put the values into an array and grab out the first item [0]<br />
    			$qs_param["GNI Donation"] = $ary_values[0]; //replace the item name in the querystring with the value, the "1" is the field id<br />
    			$query_string = "&" . http_build_query($qs_param); //put array back into querystring form<br />
    		}<br />
    	}<br />
    	return $query_string;<br />
    }
    Posted 11 years ago on Saturday October 27, 2012 | Permalink
  2. What happens instead of the submission going to PayPal?

    Also, I notice a bunch of extra markup here. Is that just from pasting or is that actually part of your code? Can you post the code snippet above at pastebin.com or pastie.org please to preserve the formatting?

    Posted 11 years ago on Saturday October 27, 2012 | Permalink
  3. The progress wheel in the form just spins and spins and nothing happens.

    http://pastie.org/5125504

    Posted 11 years ago on Sunday October 28, 2012 | Permalink
  4. Hi Chris,

    I know you guys got slammed by the storm, but just want to check to see if you have had a chance to take a look at the code above?

    Posted 11 years ago on Wednesday October 31, 2012 | Permalink
  5. Hi Brian, this topic got lost for a little while. I did not see a problem with the code, and when I did a test submission of your form, the request was sent to PayPal (the sandbox, when I checked it just now.) Are you still having trouble with this one?

    There was a strange delay before the spinner showed up, about 4 seconds, then the spinner showed up and the request was sent to PayPal.

    Posted 11 years ago on Thursday November 8, 2012 | Permalink
  6. Yes, the code is not live right now. And, yes, I still have problems. We have other forms on the site that I didn't want to be impacted by the code.

    Posted 11 years ago on Thursday November 8, 2012 | Permalink
  7. How would you like to proceed with troubleshooting this? Since you are a developer license holder, you can open a priority support request, or we can try to troubleshoot here.

    Posted 11 years ago on Thursday November 8, 2012 | Permalink
  8. Closing this topic as user has opened up a Priority Support request.

    Posted 11 years ago on Friday November 9, 2012 | Permalink

This topic has been resolved and has been closed to new replies.