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
| Name | Type | Description |
|---|---|---|
| form_title | string | The form title. |
| string | The value of the field which was mapped to the billing information Email field (not available to all add-ons). | |
| address | string | The value of the field which was mapped to the billing information Address field (not available to all add-ons). |
| address2 | string | The value of the field which was mapped to the billing information Address 2 field (not available to all add-ons). |
| city | string | The value of the field which was mapped to the billing information City field (not available to all add-ons). |
| state | string | The value of the field which was mapped to the billing information State field (not available to all add-ons). |
| zip | string | The value of the field which was mapped to the billing information Zip field (not available to all add-ons). |
| country | string | The value of the field which was mapped to the billing information Country field (not available to all add-ons). |
| card_number | string | The Credit Card number last 4 digits, padded with X (not available to all add-ons). |
| card_expiration_date | array | The Credit Card expiration month and year (not available to all add-ons). |
| card_security_code | string | The Credit Card security code (not available to all add-ons). |
| card_name | string | The Credit Card cardholder name (not available to all add-ons). |
| payment_amount | float | Either the form total or the value of the field mapped to the feeds payment amount or recurring amount setting. |
| setup_fee | integer | Zero or the value of the field mapped to the setup fee setting. |
| trial | integer | Zero, the trial amount, or the number of days the trial should last. |
| line_items | array | An 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. |
| discounts | array | An 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.
| Name | Type | Description |
|---|---|---|
| id | integer | The field ID. |
| name | string | The product name or shipping name. |
| description | string | Comma separated string of selected option names. |
| quantity | integer | The quantity. |
| unit_price | float | The total unit price for the product and any selected options, or the shipping price. |
| options | array | An indexed array of the selected product options. See Option for available properties. |
| is_shipping | boolean | Only 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.
| Name | Type | Description |
|---|---|---|
| field_label | string | The option field admin label or choice label. |
| option_name | string | The choice label or value if values are enabled on the field. |
| option_label | string | The colon separated field_label and option_name. |
| price | string | The option price. |
Hooks
The Submission Data can be modified by using the gform_submission_data_pre_process_payment filter.