Changeset 4913
- Timestamp:
- 02/16/2017 09:32:03 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/camptix-tweaks/camptix-tweaks.php
r4912 r4913 8 8 // Tickets 9 9 add_action( 'camptix_admin_notices', __NAMESPACE__ . '\show_sandbox_mode_warning' ); 10 add_filter( 'camptix_dashboard_paypal_credentials', __NAMESPACE__ . '\paypal_credentials' ); 11 add_filter( 'camptix_paypal_predefined_accounts', __NAMESPACE__ . '\paypal_credentials' ); 10 12 add_action( 'init', __NAMESPACE__ . '\hide_empty_tickets' ); 11 13 add_action( 'wp_print_styles', __NAMESPACE__ . '\print_login_message_styles' ); … … 75 77 } 76 78 } 79 } 80 81 /** 82 * Setup our pre-defined payment credentials 83 * 84 * @param array $credentials 85 * 86 * @return array 87 */ 88 function paypal_credentials( $credentials ) { 89 // Sandbox account 90 $credentials = array( 91 "wordcamp-sandbox" => array( 92 'label' => "WordCamp Sandbox", 93 'sandbox' => true, 94 'api_username' => defined( 'WC_SANDBOX_PAYPAL_NVP_USERNAME' ) ? WC_SANDBOX_PAYPAL_NVP_USERNAME : '', 95 'api_password' => defined( 'WC_SANDBOX_PAYPAL_NVP_PASSWORD' ) ? WC_SANDBOX_PAYPAL_NVP_PASSWORD : '', 96 'api_signature' => defined( 'WC_SANDBOX_PAYPAL_NVP_SIGNATURE' ) ? WC_SANDBOX_PAYPAL_NVP_SIGNATURE : '', 97 ), 98 ); 99 100 /* 101 * Live API credentials for WordPress Community Support, PBC 102 * 103 * This still uses the old 'foundation' array index in order to maintain backwards-compatibility. When an 104 * organizer saves the form on the Tickets > Setup > Payment screen, an option is saved with the key of the 105 * selected pre-defined credentials, which correspond to the indexes in the $credentials array. If those keys 106 * are ever changed, that would break the mapping for sites that that were previously saved using the old key. 107 */ 108 if ( defined( 'WPCS_PAYPAL_NVP_USERNAME' ) ) { 109 $credentials['foundation'] = array( 110 'label' => 'WordPress Community Support, PBC', 111 'sandbox' => false, 112 'api_username' => WPCS_PAYPAL_NVP_USERNAME, 113 'api_password' => WPCS_PAYPAL_NVP_PASSWORD, 114 'api_signature' => WPCS_PAYPAL_NVP_SIGNATURE, 115 ); 116 } 117 118 return $credentials; 77 119 } 78 120
Note: See TracChangeset
for help on using the changeset viewer.