WooCommerce PayPal Express Checkout Payment Gateway - Version 1.5.1

Version Description

  • Add - Hooks for Settings.
  • Fix - Missing Settings link on Plugins page.
  • Fix - Use correct image URL for PayPal image logo.
  • Tweak - Default to signature method if certificate missing, rather than other way around.
Download this release

Release Info

Developer bor0
Plugin Icon 128x128 WooCommerce PayPal Express Checkout Payment Gateway
Version 1.5.1
Comparing to
See all releases

Code changes from version 1.5.0 to 1.5.1

assets/css/wc-gateway-ppec-frontend-cart.css CHANGED
@@ -9,7 +9,7 @@
9
  margin: 0 0 1em;
10
  }
11
  .wcppec-checkout-buttons__button {
12
- display: block;
13
  text-decoration: none !important;
14
  border: 0 !important;
15
  padding-top: 1em;
9
  margin: 0 0 1em;
10
  }
11
  .wcppec-checkout-buttons__button {
12
+ display: inline-block;
13
  text-decoration: none !important;
14
  border: 0 !important;
15
  padding-top: 1em;
includes/class-wc-gateway-ppec-cart-handler.php CHANGED
@@ -202,10 +202,6 @@ class WC_Gateway_PPEC_Cart_Handler {
202
  $settings = wc_gateway_ppec()->settings;
203
  $client = wc_gateway_ppec()->client;
204
 
205
- if ( ! $client->get_payer_id() ) {
206
- return;
207
- }
208
-
209
  wp_enqueue_style( 'wc-gateway-ppec-frontend-cart', wc_gateway_ppec()->plugin_url . 'assets/css/wc-gateway-ppec-frontend-cart.css' );
210
 
211
  if ( is_cart() ) {
202
  $settings = wc_gateway_ppec()->settings;
203
  $client = wc_gateway_ppec()->client;
204
 
 
 
 
 
205
  wp_enqueue_style( 'wc-gateway-ppec-frontend-cart', wc_gateway_ppec()->plugin_url . 'assets/css/wc-gateway-ppec-frontend-cart.css' );
206
 
207
  if ( is_cart() ) {
includes/class-wc-gateway-ppec-client.php CHANGED
@@ -250,8 +250,8 @@ class WC_Gateway_PPEC_Client {
250
  $params = array();
251
  $logo_url_or_id = $settings->logo_image_url;
252
  $header_url_or_id = $settings->header_image_url;
253
- $params['LOGOIMG'] = filter_var( $logo_url_or_id, FILTER_VALIDATE_URL ) ? $logo_url_or_id : wp_get_attachment_image( $logo_url_or_id, 'thumbnail' );
254
- $params['HDRIMG'] = filter_var( $header_url_or_id, FILTER_VALIDATE_URL ) ? $header_url_or_id : wp_get_attachment_image( $header_url_or_id, 'thumbnail' );
255
  $params['PAGESTYLE'] = $settings->page_style;
256
  $params['BRANDNAME'] = $settings->get_brand_name();
257
  $params['RETURNURL'] = $this->_get_return_url( $args );
250
  $params = array();
251
  $logo_url_or_id = $settings->logo_image_url;
252
  $header_url_or_id = $settings->header_image_url;
253
+ $params['LOGOIMG'] = filter_var( $logo_url_or_id, FILTER_VALIDATE_URL ) ? $logo_url_or_id : wp_get_attachment_image_url( $logo_url_or_id, 'thumbnail' );
254
+ $params['HDRIMG'] = filter_var( $header_url_or_id, FILTER_VALIDATE_URL ) ? $header_url_or_id : wp_get_attachment_image_url( $header_url_or_id, 'thumbnail' );
255
  $params['PAGESTYLE'] = $settings->page_style;
256
  $params['BRANDNAME'] = $settings->get_brand_name();
257
  $params['RETURNURL'] = $this->_get_return_url( $args );
includes/class-wc-gateway-ppec-plugin.php CHANGED
@@ -408,7 +408,7 @@ class WC_Gateway_PPEC_Plugin {
408
  public function plugin_action_links( $links ) {
409
  $plugin_links = array();
410
 
411
- if ( $this->_bootstrapped ) {
412
  $setting_url = $this->get_admin_setting_link();
413
  $plugin_links[] = '<a href="' . esc_url( $setting_url ) . '">' . esc_html__( 'Settings', 'woocommerce-gateway-paypal-express-checkout' ) . '</a>';
414
  }
408
  public function plugin_action_links( $links ) {
409
  $plugin_links = array();
410
 
411
+ if ( function_exists( 'WC' ) ) {
412
  $setting_url = $this->get_admin_setting_link();
413
  $plugin_links[] = '<a href="' . esc_url( $setting_url ) . '">' . esc_html__( 'Settings', 'woocommerce-gateway-paypal-express-checkout' ) . '</a>';
414
  }
includes/class-wc-gateway-ppec-settings.php CHANGED
@@ -68,7 +68,7 @@ class WC_Gateway_PPEC_Settings {
68
  return null;
69
  }
70
 
71
- public function __isset( $name ) {
72
  return array_key_exists( $key, $this->_settings );
73
  }
74
 
@@ -119,12 +119,11 @@ class WC_Gateway_PPEC_Settings {
119
  * @return WC_Gateway_PPEC_Client_Credential_Signature|WC_Gateway_PPEC_Client_Credential_Certificate
120
  */
121
  public function get_live_api_credentials() {
122
- if ( $this->api_signature ) {
123
- return new WC_Gateway_PPEC_Client_Credential_Signature( $this->api_username, $this->api_password, $this->api_signature, $this->api_subject );
124
  }
125
 
126
- return new WC_Gateway_PPEC_Client_Credential_Certificate( $this->api_username, $this->api_password, $this->api_certificate, $this->api_subject );
127
-
128
  }
129
 
130
  /**
@@ -133,11 +132,11 @@ class WC_Gateway_PPEC_Settings {
133
  * @return WC_Gateway_PPEC_Client_Credential_Signature|WC_Gateway_PPEC_Client_Credential_Certificate
134
  */
135
  public function get_sandbox_api_credentials() {
136
- if ( $this->sandbox_api_signature ) {
137
- return new WC_Gateway_PPEC_Client_Credential_Signature( $this->sandbox_api_username, $this->sandbox_api_password, $this->sandbox_api_signature, $this->sandbox_api_subject );
138
  }
139
 
140
- return new WC_Gateway_PPEC_Client_Credential_Certificate( $this->sandbox_api_username, $this->sandbox_api_password, $this->sandbox_api_certificate, $this->sandbox_api_subject );
141
  }
142
 
143
  /**
68
  return null;
69
  }
70
 
71
+ public function __isset( $key ) {
72
  return array_key_exists( $key, $this->_settings );
73
  }
74
 
119
  * @return WC_Gateway_PPEC_Client_Credential_Signature|WC_Gateway_PPEC_Client_Credential_Certificate
120
  */
121
  public function get_live_api_credentials() {
122
+ if ( $this->api_certificate ) {
123
+ return new WC_Gateway_PPEC_Client_Credential_Certificate( $this->api_username, $this->api_password, $this->api_certificate, $this->api_subject );
124
  }
125
 
126
+ return new WC_Gateway_PPEC_Client_Credential_Signature( $this->api_username, $this->api_password, $this->api_signature, $this->api_subject );
 
127
  }
128
 
129
  /**
132
  * @return WC_Gateway_PPEC_Client_Credential_Signature|WC_Gateway_PPEC_Client_Credential_Certificate
133
  */
134
  public function get_sandbox_api_credentials() {
135
+ if ( $this->sandbox_api_certificate ) {
136
+ return new WC_Gateway_PPEC_Client_Credential_Certificate( $this->sandbox_api_username, $this->sandbox_api_password, $this->sandbox_api_certificate, $this->sandbox_api_subject );
137
  }
138
 
139
+ return new WC_Gateway_PPEC_Client_Credential_Signature( $this->sandbox_api_username, $this->sandbox_api_password, $this->sandbox_api_signature, $this->sandbox_api_subject );
140
  }
141
 
142
  /**
includes/settings/settings-ppec.php CHANGED
@@ -111,7 +111,7 @@ wc_enqueue_js( "
111
  /**
112
  * Settings for PayPal Gateway.
113
  */
114
- return array(
115
  'enabled' => array(
116
  'title' => __( 'Enable/Disable', 'woocommerce-gateway-paypal-express-checkout' ),
117
  'type' => 'checkbox',
@@ -398,4 +398,4 @@ return array(
398
  'drop' => __( 'Do not send line items to PayPal', 'woocommerce-gateway-paypal-express-checkout' ),
399
  ),
400
  ),
401
- );
111
  /**
112
  * Settings for PayPal Gateway.
113
  */
114
+ return apply_filters( 'woocommerce_paypal_express_checkout_settings', array(
115
  'enabled' => array(
116
  'title' => __( 'Enable/Disable', 'woocommerce-gateway-paypal-express-checkout' ),
117
  'type' => 'checkbox',
398
  'drop' => __( 'Do not send line items to PayPal', 'woocommerce-gateway-paypal-express-checkout' ),
399
  ),
400
  ),
401
+ ) );
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: automattic, woothemes, akeda, dwainm, royho, allendav, slash1andy,
3
  Tags: ecommerce, e-commerce, commerce, woothemes, wordpress ecommerce, store, sales, sell, shop, shopping, cart, checkout, configurable, paypal
4
  Requires at least: 4.4
5
  Tested up to: 4.9.0
6
- Stable tag: 1.5.0
7
  License: GPLv3
8
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
9
 
@@ -85,6 +85,12 @@ https://gist.github.com/mikejolley/ad2ecc286c9ad6cefbb7065ba6dfef48
85
 
86
  == Changelog ==
87
 
 
 
 
 
 
 
88
  = 1.5.0 =
89
  * Add - PayPal credit is now available on checkout.
90
  * Fix - WC 3.3 compatibility.
3
  Tags: ecommerce, e-commerce, commerce, woothemes, wordpress ecommerce, store, sales, sell, shop, shopping, cart, checkout, configurable, paypal
4
  Requires at least: 4.4
5
  Tested up to: 4.9.0
6
+ Stable tag: 1.5.1
7
  License: GPLv3
8
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
9
 
85
 
86
  == Changelog ==
87
 
88
+ = 1.5.1 =
89
+ * Add - Hooks for Settings.
90
+ * Fix - Missing Settings link on Plugins page.
91
+ * Fix - Use correct image URL for PayPal image logo.
92
+ * Tweak - Default to signature method if certificate missing, rather than other way around.
93
+
94
  = 1.5.0 =
95
  * Add - PayPal credit is now available on checkout.
96
  * Fix - WC 3.3 compatibility.
woocommerce-gateway-paypal-express-checkout.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: WooCommerce PayPal Express Checkout Gateway
4
  * Plugin URI: https://woocommerce.com/products/woocommerce-gateway-paypal-express-checkout/
5
  * Description: A payment gateway for PayPal Express Checkout (https://www.paypal.com/us/webapps/mpp/express-checkout).
6
- * Version: 1.5.0
7
  * Author: WooCommerce
8
  * Author URI: https://woocommerce.com
9
  * Copyright: © 2017 WooCommerce / PayPal.
@@ -27,7 +27,7 @@ if ( ! defined( 'ABSPATH' ) ) {
27
  exit; // Exit if accessed directly
28
  }
29
 
30
- define( 'WC_GATEWAY_PPEC_VERSION', '1.5.0' );
31
 
32
  /**
33
  * Return instance of WC_Gateway_PPEC_Plugin.
3
  * Plugin Name: WooCommerce PayPal Express Checkout Gateway
4
  * Plugin URI: https://woocommerce.com/products/woocommerce-gateway-paypal-express-checkout/
5
  * Description: A payment gateway for PayPal Express Checkout (https://www.paypal.com/us/webapps/mpp/express-checkout).
6
+ * Version: 1.5.1
7
  * Author: WooCommerce
8
  * Author URI: https://woocommerce.com
9
  * Copyright: © 2017 WooCommerce / PayPal.
27
  exit; // Exit if accessed directly
28
  }
29
 
30
+ define( 'WC_GATEWAY_PPEC_VERSION', '1.5.1' );
31
 
32
  /**
33
  * Return instance of WC_Gateway_PPEC_Plugin.