Changeset 1437984
- Timestamp:
- 06/16/2016 06:12:30 PM (10 years ago)
- Location:
- woocommerce-gateway-paypal-express-checkout/trunk
- Files:
-
- 8 edited
-
includes/abstracts/abstract-wc-gateway-ppec-client-credential.php (modified) (1 diff)
-
includes/abstracts/abstract-wc-gateway-ppec.php (modified) (1 diff)
-
includes/class-wc-gateway-ppec-admin-handler.php (modified) (1 diff)
-
includes/class-wc-gateway-ppec-cart-handler.php (modified) (4 diffs)
-
includes/class-wc-gateway-ppec-checkout-handler.php (modified) (2 diffs)
-
includes/class-wc-gateway-ppec-ips-handler.php (modified) (2 diffs)
-
readme.txt (modified) (2 diffs)
-
woocommerce-gateway-paypal-express-checkout.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
woocommerce-gateway-paypal-express-checkout/trunk/includes/abstracts/abstract-wc-gateway-ppec-client-credential.php
r1409404 r1437984 123 123 public function configure_curl( $handle, $r, $url ) { 124 124 curl_setopt( $handle, CURLOPT_CAINFO, wc_gateway_ppec()->includes_path . 'pem/bundle.pem' ); 125 curl_setopt( $handle, CURLOPT_SSL_CIPHER_LIST, 'TLSv1' );126 125 } 127 126 } -
woocommerce-gateway-paypal-express-checkout/trunk/includes/abstracts/abstract-wc-gateway-ppec.php
r1428748 r1437984 847 847 } 848 848 849 /** 850 * Check if this gateway is enabled. 851 * 852 * @return bool 853 */ 854 public function is_available() { 855 $settings = wc_gateway_ppec()->settings->loadSettings(); 856 if ( ! $settings->enabled ) { 857 return false; 858 } 859 860 $api_credentials = $settings->getActiveApiCredentials(); 861 if ( ! is_callable( array( $api_credentials, 'get_payer_id' ) ) ) { 862 return false; 863 } 864 865 return true; 866 } 867 849 868 } -
woocommerce-gateway-paypal-express-checkout/trunk/includes/class-wc-gateway-ppec-admin-handler.php
r1386055 r1437984 215 215 * Get admin URL for this gateway setting. 216 216 * 217 * @deprecated 218 * 217 219 * @return string URL 218 220 */ 219 221 public function gateway_admin_url( $gateway_class ) { 220 return add_query_arg( 221 array( 222 'page' => 'wc-settings', 223 'tab' => 'checkout', 224 'section' => strtolower( $gateway_class ), 225 ), 226 admin_url( 'admin.php' ) 227 ); 222 _deprecated_function( 'WC_Gateway_PPEC_Admin_Handler::gateway_admin_url', '1.0.4', 'wc_gateway_ppec()->get_admin_setting_link' ); 223 224 return wc_gateway_ppec()->get_admin_setting_link(); 228 225 } 229 226 -
woocommerce-gateway-paypal-express-checkout/trunk/includes/class-wc-gateway-ppec-cart-handler.php
r1428748 r1437984 62 62 } 63 63 64 $api_credentials = $settings->getActiveApiCredentials(); 65 if ( ! is_callable( array( $api_credentials, 'get_payer_id' ) ) ) { 66 return; 67 } 68 64 69 if ( version_compare( WC()->version, '2.3', '>' ) ) { 65 70 $class = 'woo_pp_cart_buttons_div'; … … 68 73 } 69 74 70 if ( $settings->enableInContextCheckout && $settings->getActiveApiCredentials()->get_payer_id()) {75 if ( $settings->enableInContextCheckout ) { 71 76 $class .= ' paypal-button-hidden'; 72 77 } … … 103 108 104 109 <?php 105 if ( $settings->enableInContextCheckout && $settings->getActiveApiCredentials()->get_payer_id()) {106 $payer_id = $ settings->getActiveApiCredentials()->get_payer_id();110 if ( $settings->enableInContextCheckout ) { 111 $payer_id = $api_credentials->get_payer_id(); 107 112 $setup_args = array( 108 113 // 'button' => array( 'woo_pp_ec_button', 'woo_pp_ppc_button' ), … … 131 136 } 132 137 138 $settings = wc_gateway_ppec()->settings->loadSettings(); 139 if ( ! $settings->enabled ) { 140 return; 141 } 142 143 $api_credentials = $settings->getActiveApiCredentials(); 144 if ( ! is_callable( array( $api_credentials, 'get_payer_id' ) ) ) { 145 return; 146 } 147 133 148 wp_enqueue_style( 'wc-gateway-ppec-frontend-cart', wc_gateway_ppec()->plugin_url . 'assets/css/wc-gateway-ppec-frontend-cart.css' ); 134 149 135 $settings = wc_gateway_ppec()->settings->loadSettings(); 136 if ( $settings->enabled && $settings->enableInContextCheckout && $settings->getActiveApiCredentials()->get_payer_id() ) { 150 if ( $settings->enableInContextCheckout ) { 137 151 wp_enqueue_script( 'paypal-checkout-js', 'https://www.paypalobjects.com/api/checkout.js', array(), null, true ); 138 152 } 139 140 153 } 141 154 -
woocommerce-gateway-paypal-express-checkout/trunk/includes/class-wc-gateway-ppec-checkout-handler.php
r1386055 r1437984 206 206 public function after_checkout_form() { 207 207 $settings = wc_gateway_ppec()->settings->loadSettings(); 208 209 if ( $settings->enabled && $settings->enableInContextCheckout && $settings->getActiveApiCredentials()->get_payer_id() ) { 208 if ( ! $settings->enabled ) { 209 return; 210 } 211 212 $api_credentials = $settings->getActiveApiCredentials(); 213 if ( ! is_callable( array( $api_credentials, 'get_payer_id' ) ) ) { 214 return; 215 } 216 217 if ( $settings->enableInContextCheckout ) { 210 218 $session = WC()->session->paypal; 211 219 … … 245 253 } 246 254 255 $api_credentials = $settings->getActiveApiCredentials(); 256 if ( ! is_callable( array( $api_credentials, 'get_payer_id' ) ) ) { 257 return; 258 } 259 247 260 wp_enqueue_style( 'wc-gateway-ppec-frontend-checkout', wc_gateway_ppec()->plugin_url . 'assets/css/wc-gateway-ppec-frontend-checkout.css', array(), wc_gateway_ppec()->version ); 248 261 249 262 // On the checkout page, only load the JS if we plan on sending them over to PayPal. 250 $payer_id = $ settings->getActiveApiCredentials()->get_payer_id();263 $payer_id = $api_credentials->get_payer_id(); 251 264 if ( $settings->enableInContextCheckout && ! empty( $payer_id ) ) { 252 265 $session = WC()->session->paypal; -
woocommerce-gateway-paypal-express-checkout/trunk/includes/class-wc-gateway-ppec-ips-handler.php
r1384111 r1437984 55 55 'wc_ppec_ips_admin_nonce' => wp_create_nonce( 'wc_ppec_ips' ), 56 56 ), 57 wc_gateway_ppec()-> admin->gateway_admin_url( 'WC_Gateway_PPEC_With_PayPal')57 wc_gateway_ppec()->get_admin_setting_link() 58 58 ); 59 59 } … … 116 116 117 117 add_option( 'woo_pp_admin_error', $error_msgs ); 118 wp_safe_redirect( wc_gateway_ppec()-> admin->gateway_admin_url( 'WC_Gateway_PPEC_With_PayPal') );118 wp_safe_redirect( wc_gateway_ppec()->get_admin_setting_link() ); 119 119 exit; 120 120 } -
woocommerce-gateway-paypal-express-checkout/trunk/readme.txt
r1428748 r1437984 4 4 Requires at least: 4.4 5 5 Tested up to: 4.4 6 Stable tag: 1.0. 36 Stable tag: 1.0.4 7 7 License: GPLv3 8 8 License URI: http://www.gnu.org/licenses/gpl-3.0.html … … 81 81 == Changelog == 82 82 83 = 1.0.4 = 84 85 * Fix - Wrong section slug / tab after redirected from connect.woocommerce.com 86 * Fix - Make sure to check if credentials were set in cart and checkout pages 87 * Fix - Removed configuration of chipers to use for TLS 88 83 89 = 1.0.3 = 84 90 -
woocommerce-gateway-paypal-express-checkout/trunk/woocommerce-gateway-paypal-express-checkout.php
r1428748 r1437984 2 2 /** 3 3 * Plugin Name: WooCommerce PayPal Express Checkout Gateway 4 * Plugin URI: https://w oothemes.com4 * Plugin URI: https://www.woothemes.com/products/woocommerce-gateway-paypal-express-checkout/ 5 5 * Description: A payment gateway for PayPal Express Checkout ( https://www.paypal.com/us/webapps/mpp/express-checkout ). Requires WC 2.5+ 6 * Version: 1.0. 36 * Version: 1.0.4 7 7 * Author: Automattic/WooCommerce 8 8 * Author URI: https://woocommerce.com … … 37 37 require_once( 'includes/class-wc-gateway-ppec-plugin.php' ); 38 38 39 $plugin = new WC_Gateway_PPEC_Plugin( __FILE__, '1.0. 3' );39 $plugin = new WC_Gateway_PPEC_Plugin( __FILE__, '1.0.4' ); 40 40 } 41 41
Note: See TracChangeset
for help on using the changeset viewer.