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.

Tracking Purchases

  1. I am trying to use the Pay Pal Pro plug in to let users purchase 3 different pieces of content on my site. If the PayPal purchase goes through, I want to store the fact that they have made the purchase for future sessions.

    I thought I could just store the purchased content in the user meta fields when gform_paypal_fulfillment is triggered. So far I am not having much luck. I am not sure if the method is getting called or not.

    Am I on the right track or is there a simplier/better way to track purchases associated with users?

    Here is the function I was using from functions.php:

    add_action("gform_paypal_fulfillment", "process_order", 10, 4);
    function process_order($entry, $config, $transaction_id, $amount) {
        $user_id = get_current_user_id();
        if($user_id)
    	{
    	    $key = 'boughtEthics';
    		$value = $entry['3.3'];
    		update_user_meta( $user_id, $key, $value);
    	    $key = 'boughtGeneralTax';
    		$value = $entry['4.3'];
    		update_user_meta( $user_id, $key, $value);
    	    $key = 'boughtCurrentTax';
    		$value = $entry['5.3'];
    		update_user_meta( $user_id, $key, $value);
    	}
    }
    Posted 11 years ago on Wednesday November 21, 2012 | Permalink
  2. I believe that hook is only available in the PayPal Standard Add-on. I'll ask the development team if there is a way you can do this with the Pro add-on.

    Posted 11 years ago on Wednesday November 21, 2012 | Permalink
  3. Thanks for checking. If this hook does not work with the PayPal Pro, is there a preferred way to track what users have bought for future sessions?

    Thanks,
    Mike

    Posted 11 years ago on Wednesday November 21, 2012 | Permalink
  4. Hi Mike, the hook in the PayPal Pro add-on is called "gform_paypalpro_fulfillment" and following are all the parameters passed to it:

    [php]
    do_action("gform_paypalpro_fulfillment", $entry, $config, $transaction_id, $initial_payment_amount, $subscription_amount);

    This hook is not implemented in the version of the add-on which is available for download on the website. I have the Beta 5 version which I can send to you if you like. Please send me an email at chris@rocketgenius.com and refer to this topic so I know what you're referring to when you email. Thank you.

    Posted 11 years ago on Wednesday November 21, 2012 | Permalink
  5. Thanks Chris! The beta version worked and the hook is being triggered. I have tested it with the PayPal in sandbox mode so far. We will turn it on live over the next day or so but I do not expect it to have any issues.

    Thanks,
    Mike

    Posted 11 years ago on Thursday November 29, 2012 | Permalink
  6. If you need assistance after you go live, let us know.

    Posted 11 years ago on Thursday November 29, 2012 | Permalink