Introduction
The Feed Meta Object for the PayPal Checkout Add-On is an associative array with properties determining how the add-on should process the form submission.
$feed['meta'] = array(
'feedName' => 'PayPal Checkout Feed 1',
'transactionType' => 'product',
'paymentAmount' => 'form_total',
'currency' => 'USD',
'no_shipping' => '0',
'billingInformation' => array(
'email' => '',
'firstName' => '',
'lastName' => '',
'address' => array(
'line1' => '',
'line2' => '',
'city' => '',
'state' => '',
'zip' => '',
'country' => '',
),
),
'feed_condition_conditional_logic' => '0',
'feed_condition_conditional_logic_object' => array(),
'additionalOptions' => array(
'trialProduct' => NULL,
'trialAmount' => NULL,
),
);
Usage
We recommend accessing the $feed meta using the rgar() or rgars() functions, e.g.:
$conditional_logic_enabled = rgars( $feed, 'meta/feedCondition' );
if ( $conditional_logic_enabled ) {
// Conditional logic is enabled for this feed.
$logic_rules = rgars( $feed, 'meta/feed_condition_conditional_logic_object/conditionalLogic/rules' );
foreach ( $logic_rules as $rule ) {
// Process each conditional logic rule.
$field_id = rgar( $rule, 'fieldId' );
$operator = rgar( $rule, 'operator' );
$value = rgar( $rule, 'value' );
// Example: Use $field_id, $operator, and $value in your logic.
}
}
Properties
Property | Type | Description |
---|---|---|
feedName | string | A unique name for the feed. |
transactionType | string | Specifies the type of transaction. Accepts product or subscription. |
paymentAmount | string | Defines the payment amount. Accepts form_total or Field ID. |
currency | string | The currency for the payment (e.g., “USD”). |
no_shipping | boolean | Determines if shipping is required. |
billingInformation | array | An array of billing details. |
feed_condition_conditional_logic | boolean | Enables conditional logic to determine if the feed should run. |
feed_condition_conditional_logic_object | array | An array of conditional logic rules for the feed. |
additionalOptions | array | Additional options for the feed, such as trialProduct and trialAmount . |
trialProduct | string|null | Specifies the trial product, if applicable. |
trialAmount | string|null | Specifies the trial amount, if applicable. |