gform_square_payment_data

Description

Use this filter to modify the payment data before it is sent to Square.

Usage

add_filter( 'gform_square_payment_data', 'your_function_name', 10, 5 );

Parameters

  • $payment_data array

    An array that contains payment properties and their values as documented in https://developer.squareup.com/reference/square/payments-api/create-payment

  • $feed array

    The feed object currently being processed.

  • $submission_data array

    The customer and transaction data.

  • $form Form Object

    The form object currently being processed.

  • $entry Entry Object

    The entry object currently being processed.

Examples

Pass a custom note to Square in the payment data.

add_filter( 'gform_square_payment_data', 'change_payment_data', 10, 5 );
function change_payment_data( $payment_data, $feed, $submission_data, $form, $entry ) {
	$payment_data['note'] = 'Custom note';
	return $payment_data;
}

Placement

This code should be placed in the functions.php file of your active theme.

Since

This filter was added in Square version 1.0.

Source Code

This filter is located in GF_Square::authorize_product() in gravityformssquare/class-gf-square.php.