The add_action call
The add_action call is part of Wordpress, not of the gravityforms component, as you can find here.
The first parameter contains the function to be called (in your case "gform_post_payment_completed").
The second contains the so-called "callback function", a function that is triggered as soon as the first function has been executed completely.
The third parameter is an internal priority flag for Wordpress
- the last parameter tells Wordpress how many parameters are going to be transmitted to the initial function, in case of the given function two parameters (
$entry and $action) are sent to the initial function.
As soon as the call has finished, the callback function is invoked that could i.e. tells a visitor that the payment has been accepted or to redirect him to a download page or whatever your business case is.
The $entry and $action parameters
The $entry parameter contains all information about the subscription that is currently handled, the entry_info() function may help you understand more about it and here's the documentation for it.
The $action contains information about the currently executed command (i.e. change subscription, execute payment), just search for "$action" on the documentation page for GFPaymentAddon.
I haven't used Gravity Forms but I hope you'll find the necessary details on the documentation pages.
Sending part of the data to an external page via curl
As mentioned before, I haven't used the Gravity Forms component and can't test it, but it should work similar to this:
function gfroms_after_payment_complete( $entry, $action ) {
// for more info, check https://www.gravityhelp.com/documentation/article/entry-object/
$orderNo= $entry['id']; // not sure if this would be the order number but it should be a unique payment ID
$ipAddress= $entry['ip'];
$amount= $entry['payment_amount'];
curl_setopt($ch, CURLOPT_URL, "fund.abarila-foundation.org/…Summe:{$amount}&idev_ordernum={$orderNo}&ip_address={$ipAddress}");
}
// Tells the notification to be sent only when this hook is found and to include the arguments ($entry and $action)
add_action( 'gform_post_payment_completed', 'gfroms_after_payment_complete', 10, 2 );