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.

Use Paypal with only a submit button? [no e-mail capture]

  1. Hi,

    I can't seem to configure this myself so I'm hitting the forums for support.

    I'd like to use Gravity Forms to enable a payment option, and sign up for Mailchimp, but pull the e-mail address after payment at PayPal, not before.

    I'm trying to avoid having the user enter their e-mail, and then hit submit [buy now] to go to PayPal, but instead hit the submit button [buy now] pays, and the e-mail is captured there and added for the notifications and Mailchimp integration...is this possible?

    Posted 11 years ago on Monday March 18, 2013 | Permalink
  2. I don't know of any way to do this. If they are not entering the email on your site, where are they entering it, and how will you be notified of that address?

    Posted 11 years ago on Tuesday March 19, 2013 | Permalink
  3. Within the payment gateway, at PayPal

    Posted 11 years ago on Tuesday March 19, 2013 | Permalink
  4. So the visitor will enter their email address at PayPal, and you hope to capture that email address when the visitor returns to your site?

    Posted 11 years ago on Tuesday March 19, 2013 | Permalink
  5. Yep, that was the hope, although I'm guessing it's not possible?

    I thought the API and communication between Gravity Forms and PayPal would allow Gravity Forms to pull back the e-mail after it was entered at PayPal to be used.

    Perhaps using the PayPal Pro plugin offered a different flow, but then my client would need to upgrade to PayPal Pro to test

    -r

    Posted 11 years ago on Tuesday March 19, 2013 | Permalink
  6. I believe you can capture the payer's email address using the gform_paypal_post_ipn filter: http://www.gravityhelp.com/documentation/page/Gform_paypal_post_ipn

    [php]
    add_filter("gform_paypal_post_ipn", "capture_email", 10, 4);
    function capture_email($ipn_post, $entry, $config, $cancel){
    
    	// if the IPN was canceled, don't process
    	if($cancel)
    		return;
    
    	$email_address = $ipn_post["payer_email"];
    
    	$wpdb->insert("{$wpdb->prefix}rg_lead_detail", array(
    		'value' => $email_address,
    		// update field number to the ID of
    		// your hidden email address field
    		'field_number' => $field_number,
    		'lead_id' => $entry['id'],
    		'form_id' => $entry['form_id']
    	));
    
        return;
    }

    You'll need a field in your form to hold the email after the fact. You can make it admin only or hidden, and then update the $field_number on line 14. You'll have to go direct to the database since the entry was already created when the IPN is received.

    Posted 11 years ago on Saturday March 23, 2013 | Permalink