PayPal change $entry after successful payment

Hi,

I need to change $entry after the paypal payment was successful (PayPal Standard Addon) but before the notification is sent. gform_paypal_fulfillment is called after GFCommon::send_notifications. What would be the right hook to do the change? I also found gform_post_payment_completed but I’m not sure.

Thanks,
Patrick

Huh… Not sure on the firing order. Have you just tried slapping in an after_submission to see if it fires in the order you want?

add_action( 'gform_after_submission_{form_id}', 'after_submit_{form_id}', 10, 2 );
function after_submit_{form_id}( $entry, $form ) {
      if( $form['id'] == {form_id} ){

// Field Input Value
$entry_id = $entry['id'];
// Update this number to your field id number
$field_id = 1;
//New Field Value
$value = 'NEW';  
//Updates the selected field to the new value:
	GFAPI::update_entry_field( $entry_id, $field_id, $value );
		}
}

If that doesn’t work you can also try the pre_submission:

Hi,

gform_after_submission and gform_pre_submission are both fired before the payment begins.

Which is weird, because my Stripe field tells me that a card has been declined before anything is submitted. Sorry, PayPall it’s not my forte.

You might have to disable notifications on that form completely and then add a manual notification to this:

By using ‘wp_mail’ within the hook to send a custom notification to the user.

PayPal has it’s own notifications so they are on hold till the payment is successful. I need to change $entry after the payment is successful but before the notification is sent. gform_paypay_fulfillment is called after the notification is sent. Like I said, I think gform_post_payment_completed is the correct hook but I’m not 100% sure.

Thanks