Moneris Payment Gateway and After Submission

We’re using Gravity Forms to set up a donation form for a client and we have everything connected and payments processing fine but we want to make sure the Billing Details are passed to Moneris as well.

Anyone have experience with this? I understand this falls into 3rd Party software territory but rather than banging my head against the wall further I thought I’d see if anyone has experience with it that would be willing to point me in the right direction.

We’re using the following webhook to pass the details but there’s a connection missing.

add_action( 'gform_after_submission_4', 'post_to_third_party', 10, 2 );
function post_to_third_party( $entry, $form ) {

$endpoint_url = '';
$body = array(
'bill_first_name' => rgar( $entry, 'input_2.3' ),
'bill_last_name' => rgar( $entry, 'input_2.6' ),
'bill_phone' => rgar( $entry, 'input_4.4' ),
'bill_address_one' => rgar( $entry, 'input_5.1' ),
'bill_city' => rgar( $entry, 'input_5.3' ),
'bill_state_or_province' => rgar( $entry, 'input_5.4' ),
'bill_postal_code' => rgar( $entry, 'input_5.5' ),
'bill_country' => rgar( $entry, 'input_5.6' ),
'bill_company_name' => rgar( $entry, 'input_27' ),
'email' => rgar( $entry, 'input_3' )
GFCommon::log_debug( 'gform_after_submission: body => ' . print_r( $body, true ) );

$response = wp_remote_post( $endpoint_url, array( 'body' => $body ) );
GFCommon::log_debug( 'gform_after_submission: response => ' . print_r( $response, true ) );

The input IDs in your code that look like this are probably not correct. They most likely need to be input_5_5 (for example.) I normally log the $entry in the after submission code so you can see exactly what the inputs look like. You can add this line to your existing code to log in the entry after submission:

GFCommon::log_debug( __METHOD__ . '(): My Entry => ' . print_r( $entry, true ) );

For that line to be useful, you will first need to enable logging on the site:

Then test the form, after adding the debug line to your code (it can be the first line inside your function) and refer back to the log to find “My Entry” and see what the input IDs look like.