*/ class Advanced_Forms_Paypal_Payment_Buttons_Admin { /** * The ID of this plugin. * * @since 1.0.0 * @access private * @var string $plugin_name The ID of this plugin. */ private $plugin_name; /** * The version of this plugin. * * @since 1.0.0 * @access private * @var string $version The current version of this plugin. */ private $version; /** * Initialize the class and set its properties. * * @since 1.0.0 * @param string $plugin_name The name of this plugin. * @param string $version The version of this plugin. */ public function __construct( $plugin_name, $version ) { $this->plugin_name = $plugin_name; $this->version = $version; } /** * The options name to be used in this plugin * * @since 1.0.0 * @access private * @var string $option_name Option name of this plugin */ private $option_name = 'af_ppb'; /** * Display notice if ACF Pro and Advanced Forms are missing * * @since 1.0.0 */ public function af_ppb_check_dependencies() { if( !has_acf() ) { ?>
plugin_name ); ?>
plugin_name ); ?>
discount_amount2 to take effect, you must also specify a discount_amount that is greater than or equal to 0. Valid only for Buy Now and Add to Cart buttons.',
'required' => 0,
'conditional_logic' => array (
array (
array (
'field' => 'field_af_ppb_button_type',
'operator' => '!=',
'value' => 'none',
),
),
),
'wrapper' => array (
'width' => '',
'class' => '',
'id' => '',
),
'hide_admin' => 0,
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'maxlength' => '',
);
$field_group['fields'][] = array (
'key' => 'field_af_ppb_discount_amount2',
'label' => 'Discount Amount 2',
'name' => 'af_ppb_discount_amount2',
'type' => 'text',
'instructions' => 'Discount amount associated with each additional quantity of the item, which must be equal to or less than the selling price of the item. For discount_amount2 to take effect, you must also specify a discount_amount that is greater than or equal to 0. Valid only for Buy Now and Add to Cart buttons.',
'required' => 0,
'conditional_logic' => array (
array (
array (
'field' => 'field_af_ppb_button_type',
'operator' => '!=',
'value' => 'none',
),
),
),
'wrapper' => array (
'width' => '',
'class' => '',
'id' => '',
),
'hide_admin' => 0,
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'maxlength' => '',
);
$field_group['fields'][] = array (
'key' => 'field_af_ppb_discount_rate',
'label' => 'Discount Rate',
'name' => 'af_ppb_discount_rate',
'type' => 'text',
'instructions' => 'Discount rate, as a percentage, associated with an item. Set to a value less than 100. If you do not set discount_rate2, the value in discount_rate applies only to the first item regardless of the quantity of items purchased. Valid only for Buy Now and Add to Cart buttons.',
'required' => 0,
'conditional_logic' => array (
array (
array (
'field' => 'field_af_ppb_button_type',
'operator' => '!=',
'value' => 'none',
),
),
),
'wrapper' => array (
'width' => '',
'class' => '',
'id' => '',
),
'hide_admin' => 0,
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'maxlength' => '',
);
$field_group['fields'][] = array (
'key' => 'field_af_ppb_discount_rate2',
'label' => 'Discount Rate 2',
'name' => 'af_ppb_discount_rate2',
'type' => 'text',
'instructions' => 'Discount rate, as a percentage, associated with each additional quantity of the item. Must be equal to or less than 100. For discount_rate2 to take effect, you must also specify a discount_rate that is greater than or equal to 0. Valid only for Buy Now and Add to Cart buttons.',
'required' => 0,
'conditional_logic' => array (
array (
array (
'field' => 'field_af_ppb_button_type',
'operator' => '!=',
'value' => 'none',
),
),
),
'wrapper' => array (
'width' => '',
'class' => '',
'id' => '',
),
'hide_admin' => 0,
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'maxlength' => '',
);
$field_group['fields'][] = array (
'key' => 'field_af_ppb_discount_num',
'label' => 'Discount Num',
'name' => 'af_ppb_discount_num',
'type' => 'text',
'instructions' => 'Number of additional quantities of the item to which the discount applies. Applicable when you specify discount_amount2 or discount_rate2. Specifies an upper limit on the number of discounted items. Valid only for Buy Now and Add to Cart buttons.',
'required' => 0,
'conditional_logic' => array (
array (
array (
'field' => 'field_af_ppb_button_type',
'operator' => '!=',
'value' => 'none',
),
),
),
'wrapper' => array (
'width' => '',
'class' => '',
'id' => '',
),
'hide_admin' => 0,
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'maxlength' => '',
);
$field_group['fields'][] = array (
'key' => 'field_af_ppb_item_name',
'label' => 'Item Name',
'name' => 'af_ppb_item_name',
'type' => 'text',
'instructions' => 'Description of item. If you omit this variable, buyers enter their own name during checkout. Optional for Buy Now, Donate, Subscribe, Automatic Billing, Installment Plan, and Add to Cart buttons.',
'required' => 0,
'conditional_logic' => array (
array (
array (
'field' => 'field_af_ppb_button_type',
'operator' => '!=',
'value' => 'none',
),
),
),
'wrapper' => array (
'width' => '',
'class' => '',
'id' => '',
),
'hide_admin' => 0,
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'maxlength' => '',
);
$field_group['fields'][] = array (
'key' => 'field_af_ppb_item_number',
'label' => 'Item Number',
'name' => 'af_ppb_item_number',
'type' => 'text',
'instructions' => 'Pass-through variable for you to track product or service purchased or the contribution made. The value you specify is passed back to you upon payment completion. Required if you want PayPal to track either inventory or profit and loss for the item the button sells.',
'required' => 0,
'conditional_logic' => array (
array (
array (
'field' => 'field_af_ppb_button_type',
'operator' => '!=',
'value' => 'none',
),
),
),
'wrapper' => array (
'width' => '',
'class' => '',
'id' => '',
),
'hide_admin' => 0,
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'maxlength' => '',
);
$field_group['fields'][] = array (
'key' => 'field_af_ppb_quantity',
'label' => 'Quantity',
'name' => 'af_ppb_quantity',
'type' => 'text',
'instructions' => 'Number of items. If profile-based shipping rates are configured with a basis of quantity, the sum of quantity values is used to calculate the shipping charges for the payment. PayPal appends a sequence number to uniquely identify the item in the PayPal Shopping Cart. For example, quantity1, quantity2, and so on.',
'required' => 0,
'conditional_logic' => array (
array (
array (
'field' => 'field_af_ppb_button_type',
'operator' => '!=',
'value' => 'none',
),
),
),
'wrapper' => array (
'width' => '',
'class' => '',
'id' => '',
),
'hide_admin' => 0,
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'maxlength' => '',
);
$field_group['fields'][] = array (
'key' => 'field_af_ppb_shipping',
'label' => 'Shipping',
'name' => 'af_ppb_shipping',
'type' => 'text',
'instructions' => 'The cost of shipping this item. If you specify shipping and shipping2 is not defined, this flat amount is charged regardless of the quantity of items purchased. This shipping variable is valid only for Buy Now and Add to Cart buttons. By default, if profile-based shipping rates are configured, buyers are charged an amount according to the shipping methods they choose.',
'required' => 0,
'conditional_logic' => array (
array (
array (
'field' => 'field_af_ppb_button_type',
'operator' => '!=',
'value' => 'none',
),
),
),
'wrapper' => array (
'width' => '',
'class' => '',
'id' => '',
),
'hide_admin' => 0,
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'maxlength' => '',
);
$field_group['fields'][] = array (
'key' => 'field_af_ppb_shipping2',
'label' => 'Shipping 2',
'name' => 'af_ppb_shipping2',
'type' => 'text',
'instructions' => 'The cost of shipping each additional unit of this item. If you omit this variable and profile-based shipping rates are configured, buyers are charged an amount according to the shipping methods they choose. This shipping2 variable is valid only for Buy Now and Add to Cart buttons.',
'required' => 0,
'conditional_logic' => array (
array (
array (
'field' => 'field_af_ppb_button_type',
'operator' => '!=',
'value' => 'none',
),
),
),
'wrapper' => array (
'width' => '',
'class' => '',
'id' => '',
),
'hide_admin' => 0,
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'maxlength' => '',
);
$field_group['fields'][] = array (
'key' => 'field_ap_ppb_tax',
'label' => 'Tax',
'name' => 'ap_ppb_tax',
'type' => 'text',
'instructions' => 'Transaction-based tax override variable. Set this variable to a flat tax amount to apply to the payment regardless of the buyer\'s location. This value overrides any tax settings set in your account profile. Valid only for Buy Now and Add to Cart buttons. By default, profile tax settings, if any, apply.',
'required' => 0,
'conditional_logic' => array (
array (
array (
'field' => 'field_af_ppb_button_type',
'operator' => '!=',
'value' => 'none',
),
),
),
'wrapper' => array (
'width' => '',
'class' => '',
'id' => '',
),
'hide_admin' => 0,
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'maxlength' => '',
);
$field_group['fields'][] = array (
'key' => 'field_af_ppb_tax_rate',
'label' => 'Tax Rate',
'name' => 'af_ppb_tax_rate',
'type' => 'text',
'instructions' => 'Transaction-based tax override variable. Set this variable to a percentage that applies to the amount multiplied by the quantity selected during checkout. This value overrides any tax settings set in your account profile. A valid value is from 0.001 to 100. Valid only for Buy Now and Add to Cart buttons. By default, profile tax settings, if any, apply.',
'required' => 0,
'conditional_logic' => array (
array (
array (
'field' => 'field_af_ppb_button_type',
'operator' => '!=',
'value' => 'none',
),
),
),
'wrapper' => array (
'width' => '',
'class' => '',
'id' => '',
),
'hide_admin' => 0,
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'maxlength' => '',
);
$field_group['fields'][] = array (
'key' => 'field_af_ppb_undefined_quantity',
'label' => 'Undefined Quantity',
'name' => 'af_ppb_undefined_quantity',
'type' => 'text',
'instructions' => 'Set to 1 to enable buyers to specify the quantity. Optional for Buy Now buttons. Not used with other buttons.',
'required' => 0,
'conditional_logic' => array (
array (
array (
'field' => 'field_af_ppb_button_type',
'operator' => '!=',
'value' => 'none',
),
),
),
'wrapper' => array (
'width' => '',
'class' => '',
'id' => '',
),
'hide_admin' => 0,
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'maxlength' => '',
);
$field_group['fields'][] = array (
'key' => 'field_af_ppb_weight',
'label' => 'Weight',
'name' => 'af_ppb_weight',
'type' => 'text',
'instructions' => 'Weight of items. If profile-based shipping rates are configured with a basis of weight, the sum of weight values is used to calculate the shipping charges for the payment. A valid value is a decimal number with two significant digits to the right of the decimal point.',
'required' => 0,
'conditional_logic' => array (
array (
array (
'field' => 'field_af_ppb_button_type',
'operator' => '!=',
'value' => 'none',
),
),
),
'wrapper' => array (
'width' => '',
'class' => '',
'id' => '',
),
'hide_admin' => 0,
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'maxlength' => '',
);
$field_group['fields'][] = array (
'key' => 'field_af_ppb_weight_unit',
'label' => 'Weight Unit',
'name' => 'af_ppb_weight_unit',
'type' => 'select',
'instructions' => 'The unit of measure if weight is specified. Valid value is lbs or kgs. Default is lbs.',
'required' => 0,
'conditional_logic' => array (
array (
array (
'field' => 'field_af_ppb_button_type',
'operator' => '!=',
'value' => 'none',
),
),
),
'wrapper' => array (
'width' => '',
'class' => '',
'id' => '',
),
'hide_admin' => 0,
'choices' => array (
'lbs' => 'Pounds (lbs)',
'kgs' => 'Kilograms (kgs)',
),
'default_value' => '',
'allow_null' => 1,
'multiple' => 0,
'ui' => 0,
'ajax' => 0,
'return_format' => 'value',
'placeholder' => '',
);
$field_group['fields'][] = array (
'key' => 'field_af_ppb_payment_transaction_variables',
'label' => 'Payment Transaction Variables',
'name' => '',
'type' => 'message',
'instructions' => '',
'required' => 0,
'conditional_logic' => array (
array (
array (
'field' => 'field_af_ppb_button_type',
'operator' => '!=',
'value' => 'none',
),
),
),
'wrapper' => array (
'width' => '',
'class' => '',
'id' => '',
),
'hide_admin' => 0,
'message' => '',
'new_lines' => 'wpautop',
'esc_html' => 0,
);
$field_group['fields'][] = array (
'key' => 'field_af_ppb_currency_code',
'label' => 'Currency Code',
'name' => 'af_ppb_currency_code',
'type' => 'select',
'instructions' => 'The currency of the payment. Default is USD.',
'required' => 0,
'conditional_logic' => array (
array (
array (
'field' => 'field_af_ppb_button_type',
'operator' => '!=',
'value' => 'none',
),
),
),
'wrapper' => array (
'width' => '',
'class' => '',
'id' => '',
),
'hide_admin' => 0,
'choices' => array (
'AUD' => 'Australian Dollar',
'BRL' => 'Brazilian Real',
'CAD' => 'Canadian Dollar',
'CZK' => 'Czech Koruna',
'DKK' => 'Danish Krone',
'EUR' => 'Euro',
'HKD' => 'Hong Kong Dollar',
'HUF' => 'Hungarian Forint',
'ILS' => 'Israeli New Sheqel',
'JPY' => 'Japanese Yen',
'MYR' => 'Malaysian Ringgit',
'MXN' => 'Mexican Peso',
'NOK' => 'Norwegian Krone',
'NZD' => 'New Zealand Dollar',
'PHP' => 'Philippine Peso',
'PLN' => 'Polish Zloty',
'GBP' => 'Pound Sterling',
'RUB' => 'Russian Ruble',
'SGD' => 'Singapore Dollar',
'SEK' => 'Swedish Krona',
'CHF' => 'Swiss Franc',
'TWD' => 'Taiwan New Dollar',
'THB' => 'Thai Baht',
'USD' => 'US Dollar',
),
'default_value' => '',
'allow_null' => 1,
'multiple' => 0,
'ui' => 0,
'ajax' => 0,
'return_format' => 'value',
'placeholder' => '',
);
$field_group['fields'][] = array (
'key' => 'field_af_ppb_custom',
'label' => 'Custom',
'name' => 'af_ppb_custom',
'type' => 'text',
'instructions' => 'Pass-through variable for your own tracking purposes, which buyers do not see. By default, no variable is passed back to you.',
'required' => 0,
'conditional_logic' => array (
array (
array (
'field' => 'field_af_ppb_button_type',
'operator' => '!=',
'value' => 'none',
),
),
),
'wrapper' => array (
'width' => '',
'class' => '',
'id' => '',
),
'hide_admin' => 0,
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'maxlength' => '',
);
$field_group['fields'][] = array (
'key' => 'field_af_ppb_handling',
'label' => 'Handling',
'name' => 'af_ppb_handling',
'type' => 'text',
'instructions' => 'Handling charges. This variable is not quantity-specific. The same handling cost applies, regardless of the number of items on the order. By default, no handling charges are included.',
'required' => 0,
'conditional_logic' => array (
array (
array (
'field' => 'field_af_ppb_button_type',
'operator' => '!=',
'value' => 'none',
),
),
),
'wrapper' => array (
'width' => '',
'class' => '',
'id' => '',
),
'hide_admin' => 0,
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'maxlength' => '',
);
$field_group['fields'][] = array (
'key' => 'field_af_ppb_invoice',
'label' => 'Invoice',
'name' => 'af_ppb_invoice',
'type' => 'text',
'instructions' => 'Pass-through variable you can use to identify your invoice number for this purchase. By default, no variable is passed back to you.',
'required' => 0,
'conditional_logic' => array (
array (
array (
'field' => 'field_af_ppb_button_type',
'operator' => '!=',
'value' => 'none',
),
),
),
'wrapper' => array (
'width' => '',
'class' => '',
'id' => '',
),
'hide_admin' => 0,
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'maxlength' => '',
);
$field_group['fields'][] = array (
'key' => 'field_ap_ppb_checkout_page_variables',
'label' => 'Checkout Page Variables',
'name' => '',
'type' => 'message',
'instructions' => '',
'required' => 0,
'conditional_logic' => array (
array (
array (
'field' => 'field_af_ppb_button_type',
'operator' => '!=',
'value' => 'none',
),
),
),
'wrapper' => array (
'width' => '',
'class' => '',
'id' => '',
),
'hide_admin' => 0,
'message' => '',
'new_lines' => 'wpautop',
'esc_html' => 0,
);
$field_group['fields'][] = array (
'key' => 'field_ap_ppb_image_url',
'label' => 'Image URL',
'name' => 'ap_ppb_image_url',
'type' => 'text',
'instructions' => 'The URL of the 150x50-pixel image displayed as your logo in the upper left corner of the PayPal checkout pages. Default is your business name, if you have a PayPal Business account or your email address, if you have PayPal Premier or Personal account.',
'required' => 0,
'conditional_logic' => array (
array (
array (
'field' => 'field_af_ppb_button_type',
'operator' => '!=',
'value' => 'none',
),
),
),
'wrapper' => array (
'width' => '',
'class' => '',
'id' => '',
),
'hide_admin' => 0,
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'maxlength' => '',
);
$field_group['fields'][] = array (
'key' => 'field_af_ppb_lc',
'label' => 'Locale',
'name' => 'af_ppb_lc',
'type' => 'select',
'instructions' => 'The locale of the checkout login or sign-up page. PayPal provides localized checkout pages for some countries and languages.',
'required' => 0,
'conditional_logic' => array (
array (
array (
'field' => 'field_af_ppb_button_type',
'operator' => '!=',
'value' => 'none',
),
),
),
'wrapper' => array (
'width' => '',
'class' => '',
'id' => '',
),
'hide_admin' => 0,
'choices' => array (
'AL' => 'Albania',
'DZ' => 'Algeria',
'AD' => 'Andorra',
'AO' => 'Angola',
'AI' => 'Anguilla',
'AG' => 'Antigua & Barbuda',
'AR' => 'Argentina',
'AM' => 'Armenia',
'AW' => 'Aruba',
'AU' => 'Australia',
'AT' => 'Austria',
'AZ' => 'Azerbaijan',
'BS' => 'Bahamas',
'BH' => 'Bahrain',
'BB' => 'Barbados',
'BY' => 'Belarus',
'BE' => 'Belgium',
'BZ' => 'Belize',
'BJ' => 'Benin',
'BM' => 'Bermuda',
'BT' => 'Bhutan',
'BO' => 'Bolivia',
'BA' => 'Bosnia & Herzegovina',
'BW' => 'Botswana',
'BR' => 'Brazil',
'VG' => 'British Virgin Islands',
'BN' => 'Brunei',
'BG' => 'Bulgaria',
'BF' => 'Burkina Faso',
'BI' => 'Burundi',
'KH' => 'Cambodia',
'CM' => 'Cameroon',
'CA' => 'Canada',
'CV' => 'Cape Verde',
'KY' => 'Cayman Islands',
'TD' => 'Chad',
'CL' => 'Chile',
'CN' => 'China',
'C2' => 'China Worldwide',
'CO' => 'Colombia',
'KM' => 'Comoros',
'CG' => 'Congo - Brazzaville',
'CD' => 'Congo - Kinshasa',
'CK' => 'Cook Islands',
'CR' => 'Costa Rica',
'CI' => 'Côte D’Ivoire',
'HR' => 'Croatia',
'CY' => 'Cyprus',
'CZ' => 'Czech Republic',
'DK' => 'Denmark',
'DJ' => 'Djibouti',
'DM' => 'Dominica',
'DO' => 'Dominican Republic',
'EC' => 'Ecuador',
'EG' => 'Egypt',
'SV' => 'El Salvador',
'ER' => 'Eritrea',
'EE' => 'Estonia',
'ET' => 'Ethiopia',
'FK' => 'Falkland Islands',
'FO' => 'Faroe Islands',
'FJ' => 'Fiji',
'FI' => 'Finland',
'FR' => 'France',
'GF' => 'French Guiana',
'PF' => 'French Polynesia',
'GA' => 'Gabon',
'GM' => 'Gambia',
'GE' => 'Georgia',
'DE' => 'Germany',
'GI' => 'Gibraltar',
'GR' => 'Greece',
'GL' => 'Greenland',
'GD' => 'Grenada',
'GP' => 'Guadeloupe',
'GT' => 'Guatemala',
'GN' => 'Guinea',
'GW' => 'Guinea-Bissau',
'GY' => 'Guyana',
'HN' => 'Honduras',
'HK' => 'Hong Kong SAR China',
'HU' => 'Hungary',
'IS' => 'Iceland',
'IN' => 'India',
'ID' => 'Indonesia',
'IE' => 'Ireland',
'IL' => 'Israel',
'IT' => 'Italy',
'JM' => 'Jamaica',
'JP' => 'Japan',
'JO' => 'Jordan',
'KZ' => 'Kazakhstan',
'KE' => 'Kenya',
'KI' => 'Kiribati',
'KW' => 'Kuwait',
'KG' => 'Kyrgyzstan',
'LA' => 'Laos',
'LV' => 'Latvia',
'LS' => 'Lesotho',
'LI' => 'Liechtenstein',
'LT' => 'Lithuania',
'LU' => 'Luxembourg',
'MK' => 'Macedonia',
'MG' => 'Madagascar',
'MW' => 'Malawi',
'MY' => 'Malaysia',
'MV' => 'Maldives',
'ML' => 'Mali',
'MT' => 'Malta',
'MH' => 'Marshall Islands',
'MQ' => 'Martinique',
'MR' => 'Mauritania',
'MU' => 'Mauritius',
'YT' => 'Mayotte',
'MX' => 'Mexico',
'FM' => 'Micronesia',
'MD' => 'Moldova',
'MC' => 'Monaco',
'MN' => 'Mongolia',
'ME' => 'Montenegro',
'MS' => 'Montserrat',
'MA' => 'Morocco',
'MZ' => 'Mozambique',
'NA' => 'Namibia',
'NR' => 'Nauru',
'NP' => 'Nepal',
'NL' => 'Netherlands',
'NC' => 'New Caledonia',
'NZ' => 'New Zealand',
'NI' => 'Nicaragua',
'NE' => 'Niger',
'NG' => 'Nigeria',
'NU' => 'Niue',
'NF' => 'Norfolk Island',
'NO' => 'Norway',
'OM' => 'Oman',
'PW' => 'Palau',
'PA' => 'Panama',
'PG' => 'Papua New Guinea',
'PY' => 'Paraguay',
'PE' => 'Peru',
'PH' => 'Philippines',
'PN' => 'Pitcairn Islands',
'PL' => 'Poland',
'PT' => 'Portugal',
'QA' => 'Qatar',
'RE' => 'Réunion',
'RO' => 'Romania',
'RU' => 'Russia',
'RW' => 'Rwanda',
'WS' => 'Samoa',
'SM' => 'San Marino',
'ST' => 'São Tomé & Príncipe',
'SA' => 'Saudi Arabia',
'SN' => 'Senegal',
'RS' => 'Serbia',
'SC' => 'Seychelles',
'SL' => 'Sierra Leone',
'SG' => 'Singapore',
'SK' => 'Slovakia',
'SI' => 'Slovenia',
'SB' => 'Solomon Islands',
'SO' => 'Somalia',
'ZA' => 'South Africa',
'KR' => 'South Korea',
'ES' => 'Spain',
'LK' => 'Sri Lanka',
'SH' => 'St. Helena',
'KN' => 'St. Kitts & Nevis',
'LC' => 'St. Lucia',
'PM' => 'St. Pierre & Miquelon',
'VC' => 'St. Vincent & Grenadines',
'SR' => 'Suriname',
'SJ' => 'Svalbard & Jan Mayen',
'SZ' => 'Swaziland',
'SE' => 'Sweden',
'CH' => 'Switzerland',
'TW' => 'Taiwan',
'TJ' => 'Tajikistan',
'TZ' => 'Tanzania',
'TH' => 'Thailand',
'TG' => 'Togo',
'TO' => 'Tonga',
'TT' => 'Trinidad & Tobago',
'TN' => 'Tunisia',
'TM' => 'Turkmenistan',
'TC' => 'Turks & Caicos Islands',
'TV' => 'Tuvalu',
'UG' => 'Uganda',
'UA' => 'Ukraine',
'AE' => 'United Arab Emirates',
'GB' => 'United Kingdom',
'US' => 'United States',
'UY' => 'Uruguay',
'VU' => 'Vanuatu',
'VA' => 'Vatican City',
'VE' => 'Venezuela',
'VN' => 'Vietnam',
'WF' => 'Wallis & Futuna',
'YE' => 'Yemen',
'ZM' => 'Zambia',
'ZW' => 'Zimbabwe',
),
'default_value' => '',
'allow_null' => 1,
'multiple' => 0,
'ui' => 0,
'ajax' => 0,
'return_format' => 'value',
'placeholder' => '',
);
$field_group['fields'][] = array (
'key' => 'field_ap_ppb_return',
'label' => 'Return URL',
'name' => 'ap_ppb_return',
'type' => 'text',
'instructions' => 'The URL to which PayPal redirects buyers\' browser after they complete their payments. For example, specify a URL on your site that displays a thank you for your payment page. By default, PayPal redirects the browser to a PayPal webpage.',
'required' => 0,
'conditional_logic' => array (
array (
array (
'field' => 'field_af_ppb_button_type',
'operator' => '!=',
'value' => 'none',
),
),
),
'wrapper' => array (
'width' => '',
'class' => '',
'id' => '',
),
'hide_admin' => 0,
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'maxlength' => '',
);
$field_group['fields'][] = array (
'key' => 'field_ap_ppb_rm',
'label' => 'Return Method',
'name' => 'ap_ppb_rm',
'type' => 'text',
'instructions' => 'Return method. The FORM METHOD used to send data to the URL specified by the return variable.
Valid value is: 0 All shopping cart payments use the GET method. 1 The buyer\'s browser is redirected to the return URL by using the GET method, but no payment variables are included.2 The buyer\'s browser is redirected to the return URL by using the POST method, and all payment variables are included.0. Note: This variable only takes effect only if the Return URL variable is set.',
'required' => 0,
'conditional_logic' => array (
array (
array (
'field' => 'field_af_ppb_button_type',
'operator' => '!=',
'value' => 'none',
),
),
),
'wrapper' => array (
'width' => '',
'class' => '',
'id' => '',
),
'hide_admin' => 0,
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'maxlength' => '',
);
$field_group['fields'][] = array (
'key' => 'field_af_ppb_cancel_return',
'label' => 'Cancel URL',
'name' => 'af_ppb_cancel_return',
'type' => 'text',
'instructions' => 'A URL to which PayPal redirects the buyers\' browsers if they cancel checkout before completing their payments. For example, specify a URL on your website that displays the Payment Canceled page. By default, PayPal redirects the browser to a PayPal webpage.',
'required' => 0,
'conditional_logic' => array (
array (
array (
'field' => 'field_af_ppb_button_type',
'operator' => '!=',
'value' => 'none',
),
),
),
'wrapper' => array (
'width' => '',
'class' => '',
'id' => '',
),
'hide_admin' => 0,
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'maxlength' => '',
);
$field_group['fields'][] = array (
'key' => 'field_af_ppb_notify_url',
'label' => 'Notify URL',
'name' => 'af_ppb_notify_url',
'type' => 'text',
'instructions' => 'The URL to which PayPal posts information about the payment, in the form of Instant Payment Notification messages.',
'required' => 0,
'conditional_logic' => array (
array (
array (
'field' => 'field_af_ppb_button_type',
'operator' => '!=',
'value' => 'none',
),
),
),
'wrapper' => array (
'width' => '',
'class' => '',
'id' => '',
),
'hide_admin' => 0,
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'maxlength' => '',
);
return $field_group;
}
/**
* Add an "Insert field" button to text fields
*
* @since 1.0.0
*
*/
function af_ppb_add_form_field_inserter( $field ) {
global $post;
if( ! $post ) {
return;
}
$form = af_form_from_post( $post );
if( ! $form ) {
return;
}
$fields_to_add = array(
'field_af_ppb_amount',
'field_af_ppb_discount_amount',
'field_af_ppb_discount_amount2',
'field_af_ppb_discount_rate',
'field_af_ppb_discount_rate2',
'field_af_ppb_discount_num',
'field_af_ppb_item_name',
'field_af_ppb_item_number',
'field_af_ppb_quantity',
'field_af_ppb_shipping',
'field_af_ppb_shipping2',
'field_ap_ppb_tax',
'field_af_ppb_tax_rate',
'field_af_ppb_undefined_quantity',
'field_af_ppb_weight',
'field_af_ppb_custom',
'field_af_ppb_handling',
'field_af_ppb_invoice',
'field_ap_ppb_image_url',
'field_ap_ppb_return',
'field_ap_ppb_rm',
'field_af_ppb_cancel_return',
'field_af_ppb_notify_url',
);
if( in_array( $field['key'], $fields_to_add ) ) {
_af_field_inserter_button( $form, 'regular', true );
}
}
}