Submission Data Object

Introduction

Submission Data ($submission_data) is an associative array containing all the payment related properties for the entry being processed by an add-on which extends the GFPaymentAddOn class. It is generated by GFPaymentAddOn::get_submission_data() during form validation.

Usage

We recommend accessing the properties in $submission_data using the rgar() function e.g.

$payment_amount = rgar( $submission_data, 'payment_amount' );

Properties

NameTypeDescription
form_titlestringThe form title.
emailstringThe value of the field which was mapped to the billing information Email field (not available to all add-ons).
addressstringThe value of the field which was mapped to the billing information Address field (not available to all add-ons).
address2stringThe value of the field which was mapped to the billing information Address 2 field (not available to all add-ons).
citystringThe value of the field which was mapped to the billing information City field (not available to all add-ons).
statestringThe value of the field which was mapped to the billing information State field (not available to all add-ons).
zipstringThe value of the field which was mapped to the billing information Zip field (not available to all add-ons).
countrystringThe value of the field which was mapped to the billing information Country field (not available to all add-ons).
card_numberstringThe Credit Card number last 4 digits, padded with X (not available to all add-ons).
card_expiration_datearrayThe Credit Card expiration month and year (not available to all add-ons).
card_security_codestringThe Credit Card security code (not available to all add-ons).
card_namestringThe Credit Card cardholder name (not available to all add-ons).
payment_amountfloatEither the form total or the value of the field mapped to the feeds payment amount or recurring amount setting.
setup_feeintegerZero or the value of the field mapped to the setup fee setting.
trialintegerZero, the trial amount, or the number of days the trial should last.
line_itemsarrayAn indexed array of line items with unit prices greater than or equal to zero. Created from the submitted pricing fields. See Line Item for available properties.
discountsarrayAn indexed array of line items with negative unit prices, e.g. Coupon fields. See Line Item for available properties.

Line Item

array(
'id'          => 1,
'name'        => 'Product A',
'description' => '',
'quantity'    => '1',
'unit_price'  => 10,
'options'     => array(),
)

Each line item is an associative array containing the following properties.

NameTypeDescription
idintegerThe field ID.
namestringThe product name or shipping name.
descriptionstringComma separated string of selected option names.
quantityintegerThe quantity.
unit_pricefloatThe total unit price for the product and any selected options, or the shipping price.
optionsarrayAn indexed array of the selected product options. See Option for available properties.
is_shippingbooleanOnly present if the line item is from the shipping field. Value will be true.

Option

array(
'field_label'  => 'Option',
'option_name'  => 'First Option',
'option_label' => 'Option: First Option',
'price'        => '10',
)

Each option is an associative array containing the following properties.

NameTypeDescription
field_labelstringThe option field admin label or choice label.
option_namestringThe choice label or value if values are enabled on the field.
option_labelstringThe colon separated field_label and option_name.
pricestringThe option price.

Hooks

The Submission Data can be modified by using the gform_submission_data_pre_process_payment filter.