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.

gform_paypal_query - PayPal Pro too?

  1. Does the gform_paypal_query filter apply to PayPal Pro (as well as PayPal)?

    Posted 6 years ago on Monday September 10, 2012 | Permalink
  2. HI Brad. I don't see that filter in the PayPal Pro add-on files, so I am going to guess no. Also, on this page of documentation it says:

    Use this filter to modify the query string that will be sent to PayPal. This filter is fired immediately before the user is redirected to PayPal.

    With PayPal Pro there is no redirection to PayPal.

    What is it you're trying to do? Maybe we can find a work around for you.

    Posted 6 years ago on Monday September 10, 2012 | Permalink
  3. Thanks Chris. I've got a function that updates the "srt" (subscription recurring time) query variable to dynamically change the number of subscription installments that recur. In this case it is a subscription service for new mother care packages and the number of installments is based on the age of the baby - they only receive monthly packages until the baby is 1 year old.

    For PayPal standard this function works well for me:
    http://pastebin.com/wcDqYipk

    Posted 6 years ago on Monday September 10, 2012 | Permalink
  4. So... I'm looking at paypalpro.php and see where the paypalpro_validation function sets TOTALBILLINGCYCLES on line 2050 in the $billing array.

    The $billing array info is posted to paypal in line 2075 of paypalpro_validation using:

    $response = self::post_to_paypal("CreateRecurringPaymentsProfile",$billing);

    It looks like the gform_validation filter is used to do initiate the paypalpro_validation as per:

    add_filter('gform_validation',array("GFPayPalPro", "paypalpro_validation"), 10, 4);

    The question is can I use a filter to change this value before sending to PayPal.

    Perhaps I'll just have to hack the code and add in code at line 2051 something like:

    if( function_exists('mf_get_total_billing_cycles') )
     $billing = mf_get_total_billing_cycles($_POST, $billing);

    where mf_get_total_billing_cycles changed the $billing array as needed.

    Posted 6 years ago on Thursday September 13, 2012 | Permalink