PayPal Checkout Feed Meta

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

PropertyTypeDescription
feedNamestringA unique name for the feed.
transactionTypestringSpecifies the type of transaction. Accepts product or subscription.
paymentAmountstringDefines the payment amount. Accepts form_total or Field ID.
currencystringThe currency for the payment (e.g., “USD”).
no_shippingbooleanDetermines if shipping is required.
billingInformationarrayAn array of billing details.
feed_condition_conditional_logicbooleanEnables conditional logic to determine if the feed should run.
feed_condition_conditional_logic_objectarrayAn array of conditional logic rules for the feed.
additionalOptionsarrayAdditional options for the feed, such as trialProduct and trialAmount.
trialProductstring|nullSpecifies the trial product, if applicable.
trialAmountstring|nullSpecifies the trial amount, if applicable.