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.
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:
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.