WooCommerce PayPal Express Checkout Payment Gateway - Version 1.6.19

Version Description

  • 2020-02-06 =
  • Fix - Check if order exists before adding order actions. PR #653
  • Fix - Global attributes stripped before sent to PayPal if unicode characters. PR#470
  • Fix - Handle subscription payment change. PR#640
  • Fix - Fixes error "Trying to get property of non-object" found during onboarding wizard. PR#654
  • Fix - Hide smart payment buttons on mini cart when cart is empty. PR#450
  • Fix - Only display smart buttons on product page if product is in stock. PR#662
  • Fix - Do not display smart buttons for external products and grouped products. PR#663
  • Update - Display a WooCommerce pre 3.0 admin notice warning. In an upcoming release PayPal Checkout will drop support for WC 2.6 and below. PR#671
Download this release

Release Info

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

Code changes from version 1.6.18 to 1.6.19

changelog.txt CHANGED
@@ -1,5 +1,15 @@
1
  *** Changelog ***
2
 
 
 
 
 
 
 
 
 
 
 
3
  = 1.6.18 - 2019-12-05 =
4
  * Fix - Send fees to PayPal as line items
5
  * Fix - Fix error 10426 when coupons are used
1
  *** Changelog ***
2
 
3
+ = 1.6.19 - 2020-02-06 =
4
+ * Fix - Check if order exists before adding order actions. PR #653
5
+ * Fix - Global attributes stripped before sent to PayPal if unicode characters. PR#470
6
+ * Fix - Handle subscription payment change. PR#640
7
+ * Fix - Fixes error "Trying to get property of non-object" found during onboarding wizard. PR#654
8
+ * Fix - Hide smart payment buttons on mini cart when cart is empty. PR#450
9
+ * Fix - Only display smart buttons on product page if product is in stock. PR#662
10
+ * Fix - Do not display smart buttons for external products and grouped products. PR#663
11
+ * Update - Display a WooCommerce pre 3.0 admin notice warning. In an upcoming release PayPal Checkout will drop support for WC 2.6 and below. PR#671
12
+
13
  = 1.6.18 - 2019-12-05 =
14
  * Fix - Send fees to PayPal as line items
15
  * Fix - Fix error 10426 when coupons are used
includes/class-wc-gateway-ppec-admin-handler.php CHANGED
@@ -31,6 +31,7 @@ class WC_Gateway_PPEC_Admin_Handler {
31
  add_action( 'load-woocommerce_page_wc-settings', array( $this, 'maybe_reset_api_credentials' ) );
32
 
33
  add_action( 'woocommerce_admin_order_totals_after_total', array( $this, 'display_order_fee_and_payout' ) );
 
34
  }
35
 
36
  public function add_capture_charge_order_action( $actions ) {
@@ -40,6 +41,10 @@ class WC_Gateway_PPEC_Admin_Handler {
40
 
41
  $order = wc_get_order( $_REQUEST['post'] );
42
 
 
 
 
 
43
  $old_wc = version_compare( WC_VERSION, '3.0', '<' );
44
  $order_id = $old_wc ? $order->id : $order->get_id();
45
  $payment_method = $old_wc ? $order->payment_method : $order->get_payment_method();
@@ -348,4 +353,39 @@ class WC_Gateway_PPEC_Admin_Handler {
348
 
349
  <?php
350
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
351
  }
31
  add_action( 'load-woocommerce_page_wc-settings', array( $this, 'maybe_reset_api_credentials' ) );
32
 
33
  add_action( 'woocommerce_admin_order_totals_after_total', array( $this, 'display_order_fee_and_payout' ) );
34
+ add_action( 'admin_notices', array( $this, 'show_wc_version_warning' ) );
35
  }
36
 
37
  public function add_capture_charge_order_action( $actions ) {
41
 
42
  $order = wc_get_order( $_REQUEST['post'] );
43
 
44
+ if ( empty( $order ) ) {
45
+ return $actions;
46
+ }
47
+
48
  $old_wc = version_compare( WC_VERSION, '3.0', '<' );
49
  $order_id = $old_wc ? $order->id : $order->get_id();
50
  $payment_method = $old_wc ? $order->payment_method : $order->get_payment_method();
353
 
354
  <?php
355
  }
356
+
357
+ /**
358
+ * Displays an admin notice for sites running a WC version pre 3.0.
359
+ * The WC minimum supported version will be increased to WC 3.0 in Q1 2020.
360
+ *
361
+ * @since 1.6.19
362
+ */
363
+ public static function show_wc_version_warning() {
364
+
365
+ if ( 'true' !== get_option( 'wc_ppec_display_wc_3_0_warning' ) ) {
366
+ return;
367
+ }
368
+
369
+ // Check if the notice needs to be dismissed.
370
+ $wc_updated = version_compare( WC_VERSION, '3.0', '>=' );
371
+ $dismissed = isset( $_GET['wc_ppec_hide_3_0_notice'], $_GET['_wc_ppec_notice_nonce'] ) && wp_verify_nonce( $_GET['_wc_ppec_notice_nonce'], 'wc_ppec_hide_wc_notice_nonce' );
372
+
373
+ if ( $wc_updated || $dismissed ) {
374
+ delete_option( 'wc_ppec_display_wc_3_0_warning' );
375
+ return;
376
+ }
377
+ ?>
378
+ <div class="error">
379
+ <a href="<?php echo esc_url( wp_nonce_url( add_query_arg( 'wc_ppec_hide_3_0_notice', 'true' ), 'wc_ppec_hide_wc_notice_nonce', '_wc_ppec_notice_nonce' ) ); ?>" class="woocommerce-message-close notice-dismiss" style="position:relative;float:right;padding:9px 0px 9px 9px 9px;text-decoration:none;"></a>
380
+ <p>
381
+ <?php printf( __(
382
+ '%1$sWarning!%2$s PayPal Checkout will drop support for WooCommerce %3$s in a soon to be released update. To continue using PayPal Checkout please %4$supdate to %1$sWooCommerce 3.0%2$s or greater%5$s.', 'woocommerce-gateway-paypal-express-checkout' ),
383
+ '<strong>', '</strong>',
384
+ WC_VERSION,
385
+ '<a href="' . admin_url( 'plugins.php' ) . '">', '</a>'
386
+ ); ?>
387
+ </p>
388
+ </div>
389
+ <?php
390
+ }
391
  }
includes/class-wc-gateway-ppec-cart-handler.php CHANGED
@@ -86,8 +86,26 @@ class WC_Gateway_PPEC_Cart_Handler {
86
  wc_empty_cart();
87
 
88
  if ( $product->is_type( 'variable' ) ) {
89
- $attributes = array_map( 'wc_clean', $_POST['attributes'] );
90
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
91
 
92
  if ( version_compare( WC_VERSION, '3.0', '<' ) ) {
93
  $variation_id = $product->get_matching_variation( $attributes );
@@ -269,9 +287,11 @@ class WC_Gateway_PPEC_Cart_Handler {
269
  * @since 1.4.0
270
  */
271
  public function display_paypal_button_product() {
 
 
272
  $gateways = WC()->payment_gateways->get_available_payment_gateways();
273
 
274
- if ( ! is_product() || ! isset( $gateways['ppec_paypal'] ) ) {
275
  return;
276
  }
277
 
@@ -351,7 +371,7 @@ class WC_Gateway_PPEC_Cart_Handler {
351
  $settings = wc_gateway_ppec()->settings;
352
 
353
  // billing details on checkout page to calculate shipping costs
354
- if ( ! isset( $gateways['ppec_paypal'] ) || 'no' === $settings->cart_checkout_enabled ) {
355
  return;
356
  }
357
  ?>
86
  wc_empty_cart();
87
 
88
  if ( $product->is_type( 'variable' ) ) {
89
+ $attributes = array();
90
 
91
+ foreach ( $product->get_attributes() as $attribute ) {
92
+ if ( ! $attribute['is_variation'] ) {
93
+ continue;
94
+ }
95
+
96
+ $attribute_key = 'attribute_' . sanitize_title( $attribute['name'] );
97
+
98
+ if ( isset( $_POST['attributes'][ $attribute_key ] ) ) {
99
+ if ( $attribute['is_taxonomy'] ) {
100
+ // Don't use wc_clean as it destroys sanitized characters.
101
+ $value = sanitize_title( wp_unslash( $_POST['attributes'][ $attribute_key ] ) );
102
+ } else {
103
+ $value = html_entity_decode( wc_clean( wp_unslash( $_POST['attributes'][ $attribute_key ] ) ), ENT_QUOTES, get_bloginfo( 'charset' ) );
104
+ }
105
+
106
+ $attributes[ $attribute_key ] = $value;
107
+ }
108
+ }
109
 
110
  if ( version_compare( WC_VERSION, '3.0', '<' ) ) {
111
  $variation_id = $product->get_matching_variation( $attributes );
287
  * @since 1.4.0
288
  */
289
  public function display_paypal_button_product() {
290
+ global $product;
291
+
292
  $gateways = WC()->payment_gateways->get_available_payment_gateways();
293
 
294
+ if ( ! is_product() || ! isset( $gateways['ppec_paypal'] ) || ! $product->is_in_stock() || $product->is_type( 'external' ) || $product->is_type( 'grouped' ) ) {
295
  return;
296
  }
297
 
371
  $settings = wc_gateway_ppec()->settings;
372
 
373
  // billing details on checkout page to calculate shipping costs
374
+ if ( ! isset( $gateways['ppec_paypal'] ) || 'no' === $settings->cart_checkout_enabled || 0 === WC()->cart->get_cart_contents_count() || ! WC()->cart->needs_payment() ) {
375
  return;
376
  }
377
  ?>
includes/class-wc-gateway-ppec-checkout-handler.php CHANGED
@@ -421,6 +421,15 @@ class WC_Gateway_PPEC_Checkout_Handler {
421
  * Checks data is correctly set when returning from PayPal Checkout
422
  */
423
  public function maybe_return_from_paypal() {
 
 
 
 
 
 
 
 
 
424
  if ( empty( $_GET['woo-paypal-return'] ) || empty( $_GET['token'] ) || empty( $_GET['PayerID'] ) ) {
425
  return;
426
  }
@@ -588,6 +597,15 @@ class WC_Gateway_PPEC_Checkout_Handler {
588
  * Clears the session data and display notice.
589
  */
590
  public function maybe_cancel_checkout_with_paypal() {
 
 
 
 
 
 
 
 
 
591
  if ( is_cart() && ! empty( $_GET['wc-gateway-ppec-clear-session'] ) ) {
592
  $this->maybe_clear_session_data();
593
 
@@ -1031,6 +1049,10 @@ class WC_Gateway_PPEC_Checkout_Handler {
1031
  if ( function_exists( 'wcs_order_contains_renewal' ) ) {
1032
  $needs_billing_agreement = ( $needs_billing_agreement || wcs_order_contains_renewal( $args['order_id'] ) );
1033
  }
 
 
 
 
1034
  }
1035
 
1036
  return apply_filters( 'woocommerce_paypal_express_checkout_needs_billing_agreement', $needs_billing_agreement );
@@ -1094,4 +1116,83 @@ class WC_Gateway_PPEC_Checkout_Handler {
1094
 
1095
  return $params;
1096
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1097
  }
421
  * Checks data is correctly set when returning from PayPal Checkout
422
  */
423
  public function maybe_return_from_paypal() {
424
+ if (
425
+ isset( $_GET['woo-paypal-return'] )
426
+ && isset( $_GET['update_subscription_payment_method'] )
427
+ && 'true' === $_GET['update_subscription_payment_method']
428
+ ) {
429
+ $this->handle_subscription_payment_change_success();
430
+ return;
431
+ }
432
+
433
  if ( empty( $_GET['woo-paypal-return'] ) || empty( $_GET['token'] ) || empty( $_GET['PayerID'] ) ) {
434
  return;
435
  }
597
  * Clears the session data and display notice.
598
  */
599
  public function maybe_cancel_checkout_with_paypal() {
600
+ if (
601
+ isset( $_GET['update_subscription_payment_method'] )
602
+ && 'true' === $_GET['update_subscription_payment_method']
603
+ && isset( $_GET['woo-paypal-cancel'] )
604
+ ) {
605
+ $this->handle_subscription_payment_change_failure();
606
+ return;
607
+ }
608
+
609
  if ( is_cart() && ! empty( $_GET['wc-gateway-ppec-clear-session'] ) ) {
610
  $this->maybe_clear_session_data();
611
 
1049
  if ( function_exists( 'wcs_order_contains_renewal' ) ) {
1050
  $needs_billing_agreement = ( $needs_billing_agreement || wcs_order_contains_renewal( $args['order_id'] ) );
1051
  }
1052
+ // If the order is a subscription, we're updating the payment method.
1053
+ if ( function_exists( 'wcs_is_subscription' ) ) {
1054
+ $needs_billing_agreement = ( $needs_billing_agreement || wcs_is_subscription( $args['order_id'] ) );
1055
+ }
1056
  }
1057
 
1058
  return apply_filters( 'woocommerce_paypal_express_checkout_needs_billing_agreement', $needs_billing_agreement );
1116
 
1117
  return $params;
1118
  }
1119
+
1120
+ /**
1121
+ * Handles a success payment method change for a WooCommerce Subscription.
1122
+ *
1123
+ * The user has returned back from PayPal after confirming the payment method change.
1124
+ * This updates the payment method for the subscription and redirects the user back to the
1125
+ * subscription update page.
1126
+ *
1127
+ * @since 1.7.0
1128
+ */
1129
+ public function handle_subscription_payment_change_success() {
1130
+ try {
1131
+ $session = WC()->session->get( 'paypal' );
1132
+
1133
+ if ( isset( $_GET['token'] ) ) {
1134
+ $token = sanitize_text_field( wp_unslash( $_GET['token'] ) );
1135
+ } elseif ( isset( $session->token ) ) {
1136
+ $token = $session->token;
1137
+ }
1138
+
1139
+ if ( ! isset( $token ) ) {
1140
+ return;
1141
+ }
1142
+
1143
+ if ( empty( $session ) || $this->session_has_expired( $token ) ) {
1144
+ wc_add_notice( __( 'Your PayPal checkout session has expired. Please check out again.', 'woocommerce-gateway-paypal-express-checkout' ), 'error' );
1145
+ return;
1146
+ }
1147
+
1148
+ // Get the info we need and create the billing agreement.
1149
+ $order = wc_get_order( $session->order_id );
1150
+ $checkout_details = $this->get_checkout_details( $token );
1151
+ $this->create_billing_agreement( $order, $checkout_details );
1152
+
1153
+ // Update the payment method for the current subscription.
1154
+ WC_Subscriptions_Change_Payment_Gateway::update_payment_method( $order, 'ppec_paypal' );
1155
+ $success_notice = __( 'The payment method was updated for this subscription.', 'woocommerce-gateway-paypal-express-checkout' );
1156
+
1157
+ // Update the payment method for all subscriptions if that checkbox was checked.
1158
+ if ( wcs_is_subscription( $order ) && WC_Subscriptions_Change_Payment_Gateway::will_subscription_update_all_payment_methods( $order ) ) {
1159
+ WC_Subscriptions_Change_Payment_Gateway::update_all_payment_methods_from_subscription( $order, $payment_method->id );
1160
+ $success_notice = __( 'The payment method was updated for all your current subscriptions.', 'woocommerce-gateway-paypal-express-checkout' );
1161
+ }
1162
+
1163
+ wc_clear_notices();
1164
+ wc_add_notice( $success_notice );
1165
+ wp_safe_redirect( $order->get_view_order_url() );
1166
+ exit;
1167
+ } catch ( PayPal_API_Exception $e ) {
1168
+ wc_clear_notices();
1169
+ wc_add_notice( __( 'There was a problem updating your payment method. Please try again later or use a different payment method.', 'woocommerce-gateway-paypal-express-checkout' ), 'error' );
1170
+ wp_safe_redirect( $order->get_view_order_url() );
1171
+ exit;
1172
+ }
1173
+ }
1174
+
1175
+ /**
1176
+ * Handles the cancellation of a WooCommerce Subscription payment method change.
1177
+ *
1178
+ * The user has returned back from PayPal after cancelling the payment method change.
1179
+ * This redirects the user back to the subscription page with an error message.
1180
+ *
1181
+ * @since 1.7.0
1182
+ */
1183
+ public function handle_subscription_payment_change_failure() {
1184
+ $session = WC()->session->get( 'paypal' );
1185
+ $order = isset( $session->order_id )
1186
+ ? wc_get_order( $session->order_id )
1187
+ : false;
1188
+ $redirect_url = is_callable( array( $order, 'get_view_order_url' ) )
1189
+ ? $order->get_view_order_url()
1190
+ : false;
1191
+ wc_clear_notices();
1192
+ wc_add_notice( __( 'You have cancelled Checkout with PayPal. The payment method was not updated.', 'woocommerce-gateway-paypal-express-checkout' ), 'error' );
1193
+ if ( $redirect_url ) {
1194
+ wp_safe_redirect( $redirect_url );
1195
+ exit;
1196
+ }
1197
+ }
1198
  }
includes/class-wc-gateway-ppec-client.php CHANGED
@@ -255,7 +255,7 @@ class WC_Gateway_PPEC_Client {
255
  $params['PAGESTYLE'] = $settings->page_style;
256
  $params['BRANDNAME'] = $settings->get_brand_name();
257
  $params['RETURNURL'] = $this->_get_return_url( $args );
258
- $params['CANCELURL'] = $this->_get_cancel_url();
259
 
260
  if ( wc_gateway_ppec_is_using_credit() ) {
261
  $params['USERSELECTEDFUNDINGSOURCE'] = 'Finance';
@@ -366,7 +366,9 @@ class WC_Gateway_PPEC_Client {
366
  $query_args['create-billing-agreement'] = 'true';
367
  }
368
 
369
- return add_query_arg( $query_args, wc_get_checkout_url() );
 
 
370
  }
371
 
372
  /**
@@ -378,8 +380,10 @@ class WC_Gateway_PPEC_Client {
378
  *
379
  * @return string Cancel URL
380
  */
381
- protected function _get_cancel_url() {
382
- return add_query_arg( 'woo-paypal-cancel', 'true', wc_get_cart_url() );
 
 
383
  }
384
 
385
  /**
255
  $params['PAGESTYLE'] = $settings->page_style;
256
  $params['BRANDNAME'] = $settings->get_brand_name();
257
  $params['RETURNURL'] = $this->_get_return_url( $args );
258
+ $params['CANCELURL'] = $this->_get_cancel_url( $args );
259
 
260
  if ( wc_gateway_ppec_is_using_credit() ) {
261
  $params['USERSELECTEDFUNDINGSOURCE'] = 'Finance';
366
  $query_args['create-billing-agreement'] = 'true';
367
  }
368
 
369
+ $url = add_query_arg( $query_args, wc_get_checkout_url() );
370
+ $order_id = $context_args['order_id'];
371
+ return apply_filters( 'woocommerce_paypal_express_checkout_set_express_checkout_params_get_return_url', $url, $order_id);
372
  }
373
 
374
  /**
380
  *
381
  * @return string Cancel URL
382
  */
383
+ protected function _get_cancel_url( $context_args ) {
384
+ $url = add_query_arg( 'woo-paypal-cancel', 'true', wc_get_cart_url() );
385
+ $order_id = $context_args['order_id'];
386
+ return apply_filters( 'woocommerce_paypal_express_checkout_set_express_checkout_params_get_cancel_url', $url, $order_id );
387
  }
388
 
389
  /**
includes/class-wc-gateway-ppec-plugin.php CHANGED
@@ -133,6 +133,12 @@ class WC_Gateway_PPEC_Plugin {
133
  delete_option( 'pp_woo_enabled' );
134
  }
135
 
 
 
 
 
 
 
136
  update_option( 'wc_ppec_version', $new_version );
137
  }
138
 
@@ -450,11 +456,10 @@ class WC_Gateway_PPEC_Plugin {
450
  * @return bool
451
  */
452
  public static function needs_shipping() {
453
- $cart_contents = WC()->cart->cart_contents;
454
  $needs_shipping = false;
455
 
456
- if ( ! empty( $cart_contents ) ) {
457
- foreach ( $cart_contents as $cart_item_key => $values ) {
458
  if ( $values['data']->needs_shipping() ) {
459
  $needs_shipping = true;
460
  break;
133
  delete_option( 'pp_woo_enabled' );
134
  }
135
 
136
+ // Check the the WC version on plugin update to determine if we need to display a warning.
137
+ // The option was added in 1.6.19 so we only need to check stores updating from before that version. Updating from 1.6.19 or greater would already have it set.
138
+ if ( version_compare( get_option( 'wc_ppec_version' ), '1.6.19', '<' ) && version_compare( WC_VERSION, '3.0', '<' ) ) {
139
+ update_option( 'wc_ppec_display_wc_3_0_warning', 'true' );
140
+ }
141
+
142
  update_option( 'wc_ppec_version', $new_version );
143
  }
144
 
456
  * @return bool
457
  */
458
  public static function needs_shipping() {
 
459
  $needs_shipping = false;
460
 
461
+ if ( ! empty( WC()->cart->cart_contents ) ) {
462
+ foreach ( WC()->cart->cart_contents as $cart_item_key => $values ) {
463
  if ( $values['data']->needs_shipping() ) {
464
  $needs_shipping = true;
465
  break;
includes/class-wc-gateway-ppec-with-paypal-addons.php CHANGED
@@ -39,6 +39,15 @@ class WC_Gateway_PPEC_With_PayPal_Addons extends WC_Gateway_PPEC_With_PayPal {
39
 
40
  add_action( 'woocommerce_scheduled_subscription_payment_' . $this->id, array( $this, 'scheduled_subscription_payment' ), 10, 2 );
41
  add_action( 'woocommerce_subscription_failing_payment_method_' . $this->id, array( $this, 'update_failing_payment_method' ) );
 
 
 
 
 
 
 
 
 
42
  }
43
 
44
  /**
@@ -54,6 +63,31 @@ class WC_Gateway_PPEC_With_PayPal_Addons extends WC_Gateway_PPEC_With_PayPal {
54
  return ( function_exists( 'wcs_order_contains_subscription' ) && ( wcs_order_contains_subscription( $order_id ) || wcs_is_subscription( $order_id ) || wcs_order_contains_renewal( $order_id ) ) );
55
  }
56
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
57
  /**
58
  * Process payment.
59
  *
@@ -65,6 +99,11 @@ class WC_Gateway_PPEC_With_PayPal_Addons extends WC_Gateway_PPEC_With_PayPal {
65
  */
66
  public function process_payment( $order_id ) {
67
  if ( $this->is_subscription( $order_id ) ) {
 
 
 
 
 
68
  return $this->process_subscription( $order_id );
69
  }
70
 
@@ -201,4 +240,75 @@ class WC_Gateway_PPEC_With_PayPal_Addons extends WC_Gateway_PPEC_With_PayPal {
201
  public function update_failing_payment_method( $subscription, $renewal_order ) {
202
  update_post_meta( is_callable( array( $subscription, 'get_id' ) ) ? $subscription->get_id() : $subscription->id, '_ppec_billing_agreement_id', $renewal_order->ppec_billing_agreement_id );
203
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
204
  }
39
 
40
  add_action( 'woocommerce_scheduled_subscription_payment_' . $this->id, array( $this, 'scheduled_subscription_payment' ), 10, 2 );
41
  add_action( 'woocommerce_subscription_failing_payment_method_' . $this->id, array( $this, 'update_failing_payment_method' ) );
42
+
43
+ // When changing the payment method for a WooCommerce Subscription to PayPal Checkout, let WooCommerce Subscription
44
+ // know that the payment method for that subscription should not be changed immediately. Instead, it should
45
+ // wait for the IPN notification, after the user confirmed the payment method change with PayPal.
46
+ add_filter( 'woocommerce_subscriptions_update_payment_via_pay_shortcode', array( $this, 'indicate_async_payment_method_update' ), 10, 2 );
47
+
48
+ // Add extra parameter when updating the subscription payment method to PayPal.
49
+ add_filter( 'woocommerce_paypal_express_checkout_set_express_checkout_params_get_return_url', array( $this, 'add_query_param_to_url_subscription_payment_method_change' ), 10, 2 );
50
+ add_filter( 'woocommerce_paypal_express_checkout_set_express_checkout_params_get_cancel_url', array( $this, 'add_query_param_to_url_subscription_payment_method_change' ), 10, 2 );
51
  }
52
 
53
  /**
63
  return ( function_exists( 'wcs_order_contains_subscription' ) && ( wcs_order_contains_subscription( $order_id ) || wcs_is_subscription( $order_id ) || wcs_order_contains_renewal( $order_id ) ) );
64
  }
65
 
66
+ /**
67
+ * Checks whether the order associated with the given order_id is
68
+ * for changing a payment method for a WooCommerce Subscription.
69
+ *
70
+ * @since 1.7.0
71
+ *
72
+ * @param int $order_id Order ID.
73
+ *
74
+ * @return bool Returns true if the order is changing the payment method for a subscription.
75
+ */
76
+ private function is_order_changing_payment_method_for_subscription( $order_id ) {
77
+ $order = wc_get_order( $order_id );
78
+ return (
79
+ is_callable( array( $order, 'get_type' ) )
80
+ && 'shop_subscription' === $order->get_type()
81
+ && isset( $_POST['_wcsnonce'] )
82
+ && wp_verify_nonce( sanitize_key( $_POST['_wcsnonce'] ), 'wcs_change_payment_method' )
83
+ && isset( $_POST['woocommerce_change_payment'] )
84
+ && $order->get_id() === absint( $_POST['woocommerce_change_payment'] )
85
+ && isset( $_GET['key'] )
86
+ && $order->get_order_key() === $_GET['key']
87
+ && 0 === $order->get_total() // WooCommerce Subscriptions uses $0 orders to update payment method for the subscription.
88
+ );
89
+ }
90
+
91
  /**
92
  * Process payment.
93
  *
99
  */
100
  public function process_payment( $order_id ) {
101
  if ( $this->is_subscription( $order_id ) ) {
102
+ // Is this a subscription payment method change?
103
+ if ( $this->is_order_changing_payment_method_for_subscription( $order_id ) ) {
104
+ return $this->change_subscription_payment_method( $order_id );
105
+ }
106
+ // Otherwise, it's a subscription payment.
107
  return $this->process_subscription( $order_id );
108
  }
109
 
240
  public function update_failing_payment_method( $subscription, $renewal_order ) {
241
  update_post_meta( is_callable( array( $subscription, 'get_id' ) ) ? $subscription->get_id() : $subscription->id, '_ppec_billing_agreement_id', $renewal_order->ppec_billing_agreement_id );
242
  }
243
+
244
+ /**
245
+ * Indicate to WooCommerce Subscriptions that the payment method change for PayPal Checkout
246
+ * should be asynchronous.
247
+ *
248
+ * WC_Subscriptions_Change_Payment_Gateway::change_payment_method_via_pay_shortcode uses the
249
+ * result to decide whether or not to change the payment method information on the subscription
250
+ * right away or not.
251
+ *
252
+ * In our case, the payment method will not be updated until after the user confirms the
253
+ * payment method change with PayPal. Once that's done, we'll take care of finishing
254
+ * the payment method update with the subscription.
255
+ *
256
+ * @since 1.7.0
257
+ *
258
+ * @param bool $should_update Current value of whether the payment method should be updated immediately.
259
+ * @param string $new_payment_method The new payment method name.
260
+ *
261
+ * @return bool Whether the subscription's payment method should be updated on checkout or async when a response is returned.
262
+ */
263
+ public function indicate_async_payment_method_update( $should_update, $new_payment_method ) {
264
+ if ( 'ppec_paypal' === $new_payment_method ) {
265
+ $should_update = false;
266
+ }
267
+ return $should_update;
268
+ }
269
+
270
+ /**
271
+ * Start the process to update the payment method for a WooCommerce Subscriptions.
272
+ *
273
+ * This function is called by `process_payment` when changing a payment method for WooCommerce Subscriptions.
274
+ * When it's successful, `WC_Subscriptions_Change_Payment_Gateway::change_payment_method_via_pay_shortcode` will
275
+ * redirect to the redirect URL provided and the user will be prompted to confirm the payment update.
276
+ *
277
+ * @since 1.7.0
278
+ *
279
+ * @param int $order_id Order ID.
280
+ *
281
+ * @return array Array used by WC_Subscriptions_Change_Payment_Gateway::change_payment_method_via_pay_shortcode.
282
+ */
283
+ public function change_subscription_payment_method( $order_id ) {
284
+ try {
285
+ return array(
286
+ 'result' => 'success',
287
+ 'redirect' => wc_gateway_ppec()->checkout->start_checkout_from_order( $order_id, false ),
288
+ );
289
+ } catch ( PayPal_API_Exception $e ) {
290
+ wc_add_notice( $e->getMessage(), 'error' );
291
+ return array(
292
+ 'result' => 'failure',
293
+ );
294
+ }
295
+ }
296
+
297
+ /**
298
+ * Add query param to return and cancel URLs when making a payment change for
299
+ * a WooCommerce Subscription.
300
+ *
301
+ * @since 1.7.0
302
+ *
303
+ * @param string $url The original URL.
304
+ * @param int $order_id Order ID.
305
+ *
306
+ * @return string The new URL.
307
+ */
308
+ public function add_query_param_to_url_subscription_payment_method_change( $url, $order_id ) {
309
+ if ( $this->is_order_changing_payment_method_for_subscription( $order_id ) ) {
310
+ return add_query_arg( 'update_subscription_payment_method', 'true', $url );
311
+ }
312
+ return $url;
313
+ }
314
  }
languages/woocommerce-gateway-paypal-express-checkout.pot CHANGED
@@ -2,37 +2,15 @@
2
  # This file is distributed under the same license as the WooCommerce PayPal Checkout Gateway plugin.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: WooCommerce PayPal Checkout Gateway 1.6.18\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/woocommerce-gateway-paypal-express-checkout\n"
7
- "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
8
- "Language-Team: LANGUAGE <LL@li.org>\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
- "POT-Creation-Date: 2019-11-20T17:08:08+00:00\n"
13
- "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
14
- "X-Generator: WP-CLI 2.4.0\n"
15
- "X-Domain: woocommerce-gateway-paypal-express-checkout\n"
16
-
17
- #. Plugin Name of the plugin
18
- msgid "WooCommerce PayPal Checkout Gateway"
19
- msgstr ""
20
-
21
- #. Plugin URI of the plugin
22
- msgid "https://woocommerce.com/products/woocommerce-gateway-paypal-express-checkout/"
23
- msgstr ""
24
-
25
- #. Description of the plugin
26
- msgid "Accept all major credit and debit cards, plus Venmo and PayPal Credit in the US, presenting options in a customizable stack of payment buttons. Fast, seamless, and flexible."
27
- msgstr ""
28
-
29
- #. Author of the plugin
30
- msgid "WooCommerce"
31
- msgstr ""
32
-
33
- #. Author URI of the plugin
34
- msgid "https://woocommerce.com"
35
- msgstr ""
36
 
37
  #: includes/abstracts/abstract-wc-gateway-ppec.php:18
38
  #: includes/class-wc-gateway-ppec-privacy.php:12
@@ -145,46 +123,50 @@ msgstr ""
145
  msgid "Remove image"
146
  msgstr ""
147
 
148
- #: includes/class-wc-gateway-ppec-admin-handler.php:57
149
  msgid "Capture Charge"
150
  msgstr ""
151
 
152
- #: includes/class-wc-gateway-ppec-admin-handler.php:81
153
  msgid "NOTE: PayPal does not accept decimal places for the currency in which you are transacting. The \"Number of Decimals\" option in WooCommerce has automatically been set to 0 for you."
154
  msgstr ""
155
 
156
- #: includes/class-wc-gateway-ppec-admin-handler.php:171
157
  msgid "Unable to capture charge!"
158
  msgstr ""
159
 
160
- #: includes/class-wc-gateway-ppec-admin-handler.php:179
161
  msgid "PayPal Checkout charge complete (Charge ID: %s)"
162
  msgstr ""
163
 
164
- #: includes/class-wc-gateway-ppec-admin-handler.php:221
165
  msgid "Unable to void charge!"
166
  msgstr ""
167
 
168
- #: includes/class-wc-gateway-ppec-admin-handler.php:223
169
  msgid "PayPal Checkout charge voided (Charge ID: %s)"
170
  msgstr ""
171
 
172
- #: includes/class-wc-gateway-ppec-admin-handler.php:330
173
  msgid "This represents the fee PayPal collects for the transaction."
174
  msgstr ""
175
 
176
- #: includes/class-wc-gateway-ppec-admin-handler.php:331
177
  msgid "PayPal Fee:"
178
  msgstr ""
179
 
180
- #: includes/class-wc-gateway-ppec-admin-handler.php:340
181
  msgid "This represents the net total that will be credited to your PayPal account. This may be in a different currency than is set in your PayPal account."
182
  msgstr ""
183
 
184
- #: includes/class-wc-gateway-ppec-admin-handler.php:341
185
  msgid "PayPal Payout:"
186
  msgstr ""
187
 
 
 
 
 
188
  #: includes/class-wc-gateway-ppec-api-error.php:22
189
  msgid "Unable to communicate with PayPal. Please try your payment again."
190
  msgstr ""
@@ -279,22 +261,22 @@ msgid "An error (%s) occurred while processing your PayPal payment. Please cont
279
  msgstr ""
280
 
281
  #: includes/class-wc-gateway-ppec-cart-handler.php:65
282
- #: includes/class-wc-gateway-ppec-cart-handler.php:117
283
- #: includes/class-wc-gateway-ppec-cart-handler.php:138
284
  msgid "Cheatin&#8217; huh?"
285
  msgstr ""
286
 
287
- #: includes/class-wc-gateway-ppec-cart-handler.php:294
288
- #: includes/class-wc-gateway-ppec-cart-handler.php:331
289
- #: includes/class-wc-gateway-ppec-cart-handler.php:366
290
  msgid "Check out with PayPal"
291
  msgstr ""
292
 
293
- #: includes/class-wc-gateway-ppec-cart-handler.php:321
294
  msgid "&mdash; or &mdash;"
295
  msgstr ""
296
 
297
- #: includes/class-wc-gateway-ppec-cart-handler.php:336
298
  msgid "Pay with PayPal Credit"
299
  msgstr ""
300
 
@@ -334,33 +316,50 @@ msgstr ""
334
  msgid "Shipping details"
335
  msgstr ""
336
 
337
- #: includes/class-wc-gateway-ppec-checkout-handler.php:434
338
- #: includes/class-wc-gateway-ppec-checkout-handler.php:477
 
339
  msgid "Your PayPal checkout session has expired. Please check out again."
340
  msgstr ""
341
 
342
- #: includes/class-wc-gateway-ppec-checkout-handler.php:472
343
  msgid "Sorry, an error occurred while trying to retrieve your information from PayPal. Please try again."
344
  msgstr ""
345
 
346
- #: includes/class-wc-gateway-ppec-checkout-handler.php:580
347
  msgid "Cancel"
348
  msgstr ""
349
 
350
- #: includes/class-wc-gateway-ppec-checkout-handler.php:594
351
  msgid "You have cancelled Checkout with PayPal. Please try to process your order again."
352
  msgstr ""
353
 
354
- #: includes/class-wc-gateway-ppec-checkout-handler.php:953
355
  #: includes/class-wc-gateway-ppec-ipn-handler.php:190
356
  msgid "Payment authorized. Change payment status to processing or complete to capture funds."
357
  msgstr ""
358
 
359
- #: includes/class-wc-gateway-ppec-checkout-handler.php:955
360
  #: includes/class-wc-gateway-ppec-ipn-handler.php:192
361
  msgid "Payment pending (%s)."
362
  msgstr ""
363
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
364
  #: includes/class-wc-gateway-ppec-client-credential-certificate.php:66
365
  msgid "Unable to accept certificate during cURL configuration"
366
  msgstr ""
@@ -402,6 +401,13 @@ msgstr ""
402
  msgid "Malformed response received from PayPal"
403
  msgstr ""
404
 
 
 
 
 
 
 
 
405
  #: includes/class-wc-gateway-ppec-ipn-handler.php:29
406
  msgid "Empty POST data."
407
  msgstr ""
@@ -477,39 +483,39 @@ msgstr ""
477
  msgid "Success! Your PayPal account has been set up successfully."
478
  msgstr ""
479
 
480
- #: includes/class-wc-gateway-ppec-plugin.php:156
481
  msgid "%s in WooCommerce Gateway PayPal Checkout plugin can only be called once"
482
  msgstr ""
483
 
484
- #: includes/class-wc-gateway-ppec-plugin.php:237
485
  msgid "<p>PayPal Checkout with new <strong>Smart Payment Buttons™</strong> gives your customers the power to pay the way they want without leaving your site.</p><p>The <strong>existing buttons will be removed</strong> in the <strong>next release</strong>. Please upgrade to Smart Payment Buttons on the <a href=\"%s\">PayPal Checkout settings page</a>.</p>"
486
  msgstr ""
487
 
488
- #: includes/class-wc-gateway-ppec-plugin.php:275
489
  msgid "WooCommerce Gateway PayPal Checkout requires WooCommerce to be activated"
490
  msgstr ""
491
 
492
- #: includes/class-wc-gateway-ppec-plugin.php:279
493
  msgid "WooCommerce Gateway PayPal Checkout requires WooCommerce version 2.5 or greater"
494
  msgstr ""
495
 
496
- #: includes/class-wc-gateway-ppec-plugin.php:283
497
  msgid "WooCommerce Gateway PayPal Checkout requires cURL to be installed on your server"
498
  msgstr ""
499
 
500
- #: includes/class-wc-gateway-ppec-plugin.php:286
501
  msgid "WooCommerce Gateway PayPal Checkout requires OpenSSL >= 1.0.1 to be installed on your server"
502
  msgstr ""
503
 
504
- #: includes/class-wc-gateway-ppec-plugin.php:313
505
  msgid "PayPal Checkout is almost ready. To get started, <a href=\"%s\">connect your PayPal account</a>."
506
  msgstr ""
507
 
508
- #: includes/class-wc-gateway-ppec-plugin.php:435
509
  msgid "Settings"
510
  msgstr ""
511
 
512
- #: includes/class-wc-gateway-ppec-plugin.php:438
513
  msgid "Docs"
514
  msgstr ""
515
 
@@ -547,6 +553,10 @@ msgstr ""
547
  msgid "Subscriptions"
548
  msgstr ""
549
 
 
 
 
 
550
  #: includes/class-wc-gateway-ppec-privacy.php:245
551
  msgid "PayPal Checkout Subscriptions Data Erased."
552
  msgstr ""
@@ -555,20 +565,21 @@ msgstr ""
555
  msgid "PayPal Checkout Order Data Erased."
556
  msgstr ""
557
 
558
- #: includes/class-wc-gateway-ppec-with-paypal-addons.php:157
559
  msgid "PayPal API error"
560
  msgstr ""
561
 
562
  #. translators: placeholder is pending reason from PayPal API.
563
- #: includes/class-wc-gateway-ppec-with-paypal-addons.php:165
 
564
  msgid "PayPal transaction held: %s"
565
  msgstr ""
566
 
567
- #: includes/class-wc-gateway-ppec-with-paypal-addons.php:176
568
  msgid "PayPal payment approved (ID: %s)"
569
  msgstr ""
570
 
571
- #: includes/class-wc-gateway-ppec-with-paypal-addons.php:180
572
  msgid "PayPal payment declined"
573
  msgstr ""
574
 
@@ -583,6 +594,7 @@ msgid "An error occurred while calling the PayPal API."
583
  msgstr ""
584
 
585
  #. translators: placeholders are error code and message from PayPal
 
586
  #: includes/exceptions/class-wc-gateway-ppec-api-exception.php:64
587
  msgid "PayPal error (%1$s): %2$s"
588
  msgstr ""
@@ -1094,3 +1106,22 @@ msgstr ""
1094
  #: includes/settings/settings-ppec.php:681
1095
  msgid "Configure settings specific to regular checkout"
1096
  msgstr ""
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  # This file is distributed under the same license as the WooCommerce PayPal Checkout Gateway plugin.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: WooCommerce PayPal Checkout Gateway 1.6.19\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/woocommerce-gateway-paypal-express-checkout\n"
7
+ "POT-Creation-Date: 2020-02-06 01:32:37+00:00\n"
 
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
+ "PO-Revision-Date: 2020-MO-DA HO:MI+ZONE\n"
12
+ "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
+ "Language-Team: LANGUAGE <LL@li.org>\n"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
 
15
  #: includes/abstracts/abstract-wc-gateway-ppec.php:18
16
  #: includes/class-wc-gateway-ppec-privacy.php:12
123
  msgid "Remove image"
124
  msgstr ""
125
 
126
+ #: includes/class-wc-gateway-ppec-admin-handler.php:62
127
  msgid "Capture Charge"
128
  msgstr ""
129
 
130
+ #: includes/class-wc-gateway-ppec-admin-handler.php:86
131
  msgid "NOTE: PayPal does not accept decimal places for the currency in which you are transacting. The \"Number of Decimals\" option in WooCommerce has automatically been set to 0 for you."
132
  msgstr ""
133
 
134
+ #: includes/class-wc-gateway-ppec-admin-handler.php:176
135
  msgid "Unable to capture charge!"
136
  msgstr ""
137
 
138
+ #: includes/class-wc-gateway-ppec-admin-handler.php:184
139
  msgid "PayPal Checkout charge complete (Charge ID: %s)"
140
  msgstr ""
141
 
142
+ #: includes/class-wc-gateway-ppec-admin-handler.php:226
143
  msgid "Unable to void charge!"
144
  msgstr ""
145
 
146
+ #: includes/class-wc-gateway-ppec-admin-handler.php:228
147
  msgid "PayPal Checkout charge voided (Charge ID: %s)"
148
  msgstr ""
149
 
150
+ #: includes/class-wc-gateway-ppec-admin-handler.php:335
151
  msgid "This represents the fee PayPal collects for the transaction."
152
  msgstr ""
153
 
154
+ #: includes/class-wc-gateway-ppec-admin-handler.php:336
155
  msgid "PayPal Fee:"
156
  msgstr ""
157
 
158
+ #: includes/class-wc-gateway-ppec-admin-handler.php:345
159
  msgid "This represents the net total that will be credited to your PayPal account. This may be in a different currency than is set in your PayPal account."
160
  msgstr ""
161
 
162
+ #: includes/class-wc-gateway-ppec-admin-handler.php:346
163
  msgid "PayPal Payout:"
164
  msgstr ""
165
 
166
+ #: includes/class-wc-gateway-ppec-admin-handler.php:381
167
+ msgid "%1$sWarning!%2$s PayPal Checkout will drop support for WooCommerce %3$s in a soon to be released update. To continue using PayPal Checkout please %4$supdate to %1$sWooCommerce 3.0%2$s or greater%5$s."
168
+ msgstr ""
169
+
170
  #: includes/class-wc-gateway-ppec-api-error.php:22
171
  msgid "Unable to communicate with PayPal. Please try your payment again."
172
  msgstr ""
261
  msgstr ""
262
 
263
  #: includes/class-wc-gateway-ppec-cart-handler.php:65
264
+ #: includes/class-wc-gateway-ppec-cart-handler.php:135
265
+ #: includes/class-wc-gateway-ppec-cart-handler.php:156
266
  msgid "Cheatin&#8217; huh?"
267
  msgstr ""
268
 
269
+ #: includes/class-wc-gateway-ppec-cart-handler.php:314
270
+ #: includes/class-wc-gateway-ppec-cart-handler.php:351
271
+ #: includes/class-wc-gateway-ppec-cart-handler.php:386
272
  msgid "Check out with PayPal"
273
  msgstr ""
274
 
275
+ #: includes/class-wc-gateway-ppec-cart-handler.php:341
276
  msgid "&mdash; or &mdash;"
277
  msgstr ""
278
 
279
+ #: includes/class-wc-gateway-ppec-cart-handler.php:356
280
  msgid "Pay with PayPal Credit"
281
  msgstr ""
282
 
316
  msgid "Shipping details"
317
  msgstr ""
318
 
319
+ #: includes/class-wc-gateway-ppec-checkout-handler.php:443
320
+ #: includes/class-wc-gateway-ppec-checkout-handler.php:486
321
+ #: includes/class-wc-gateway-ppec-checkout-handler.php:1144
322
  msgid "Your PayPal checkout session has expired. Please check out again."
323
  msgstr ""
324
 
325
+ #: includes/class-wc-gateway-ppec-checkout-handler.php:481
326
  msgid "Sorry, an error occurred while trying to retrieve your information from PayPal. Please try again."
327
  msgstr ""
328
 
329
+ #: includes/class-wc-gateway-ppec-checkout-handler.php:589
330
  msgid "Cancel"
331
  msgstr ""
332
 
333
+ #: includes/class-wc-gateway-ppec-checkout-handler.php:612
334
  msgid "You have cancelled Checkout with PayPal. Please try to process your order again."
335
  msgstr ""
336
 
337
+ #: includes/class-wc-gateway-ppec-checkout-handler.php:971
338
  #: includes/class-wc-gateway-ppec-ipn-handler.php:190
339
  msgid "Payment authorized. Change payment status to processing or complete to capture funds."
340
  msgstr ""
341
 
342
+ #: includes/class-wc-gateway-ppec-checkout-handler.php:973
343
  #: includes/class-wc-gateway-ppec-ipn-handler.php:192
344
  msgid "Payment pending (%s)."
345
  msgstr ""
346
 
347
+ #: includes/class-wc-gateway-ppec-checkout-handler.php:1155
348
+ msgid "The payment method was updated for this subscription."
349
+ msgstr ""
350
+
351
+ #: includes/class-wc-gateway-ppec-checkout-handler.php:1160
352
+ msgid "The payment method was updated for all your current subscriptions."
353
+ msgstr ""
354
+
355
+ #: includes/class-wc-gateway-ppec-checkout-handler.php:1169
356
+ msgid "There was a problem updating your payment method. Please try again later or use a different payment method."
357
+ msgstr ""
358
+
359
+ #: includes/class-wc-gateway-ppec-checkout-handler.php:1192
360
+ msgid "You have cancelled Checkout with PayPal. The payment method was not updated."
361
+ msgstr ""
362
+
363
  #: includes/class-wc-gateway-ppec-client-credential-certificate.php:66
364
  msgid "Unable to accept certificate during cURL configuration"
365
  msgstr ""
401
  msgid "Malformed response received from PayPal"
402
  msgstr ""
403
 
404
+ #. translators: placeholder is blogname
405
+
406
+ #: includes/class-wc-gateway-ppec-client.php:398
407
+ msgctxt "data sent to PayPal"
408
+ msgid "Orders with %s"
409
+ msgstr ""
410
+
411
  #: includes/class-wc-gateway-ppec-ipn-handler.php:29
412
  msgid "Empty POST data."
413
  msgstr ""
483
  msgid "Success! Your PayPal account has been set up successfully."
484
  msgstr ""
485
 
486
+ #: includes/class-wc-gateway-ppec-plugin.php:162
487
  msgid "%s in WooCommerce Gateway PayPal Checkout plugin can only be called once"
488
  msgstr ""
489
 
490
+ #: includes/class-wc-gateway-ppec-plugin.php:243
491
  msgid "<p>PayPal Checkout with new <strong>Smart Payment Buttons™</strong> gives your customers the power to pay the way they want without leaving your site.</p><p>The <strong>existing buttons will be removed</strong> in the <strong>next release</strong>. Please upgrade to Smart Payment Buttons on the <a href=\"%s\">PayPal Checkout settings page</a>.</p>"
492
  msgstr ""
493
 
494
+ #: includes/class-wc-gateway-ppec-plugin.php:281
495
  msgid "WooCommerce Gateway PayPal Checkout requires WooCommerce to be activated"
496
  msgstr ""
497
 
498
+ #: includes/class-wc-gateway-ppec-plugin.php:285
499
  msgid "WooCommerce Gateway PayPal Checkout requires WooCommerce version 2.5 or greater"
500
  msgstr ""
501
 
502
+ #: includes/class-wc-gateway-ppec-plugin.php:289
503
  msgid "WooCommerce Gateway PayPal Checkout requires cURL to be installed on your server"
504
  msgstr ""
505
 
506
+ #: includes/class-wc-gateway-ppec-plugin.php:292
507
  msgid "WooCommerce Gateway PayPal Checkout requires OpenSSL >= 1.0.1 to be installed on your server"
508
  msgstr ""
509
 
510
+ #: includes/class-wc-gateway-ppec-plugin.php:319
511
  msgid "PayPal Checkout is almost ready. To get started, <a href=\"%s\">connect your PayPal account</a>."
512
  msgstr ""
513
 
514
+ #: includes/class-wc-gateway-ppec-plugin.php:441
515
  msgid "Settings"
516
  msgstr ""
517
 
518
+ #: includes/class-wc-gateway-ppec-plugin.php:444
519
  msgid "Docs"
520
  msgstr ""
521
 
553
  msgid "Subscriptions"
554
  msgstr ""
555
 
556
+ #: includes/class-wc-gateway-ppec-privacy.php:230
557
+ msgid "Order ID %d contains an active Subscription"
558
+ msgstr ""
559
+
560
  #: includes/class-wc-gateway-ppec-privacy.php:245
561
  msgid "PayPal Checkout Subscriptions Data Erased."
562
  msgstr ""
565
  msgid "PayPal Checkout Order Data Erased."
566
  msgstr ""
567
 
568
+ #: includes/class-wc-gateway-ppec-with-paypal-addons.php:196
569
  msgid "PayPal API error"
570
  msgstr ""
571
 
572
  #. translators: placeholder is pending reason from PayPal API.
573
+
574
+ #: includes/class-wc-gateway-ppec-with-paypal-addons.php:204
575
  msgid "PayPal transaction held: %s"
576
  msgstr ""
577
 
578
+ #: includes/class-wc-gateway-ppec-with-paypal-addons.php:215
579
  msgid "PayPal payment approved (ID: %s)"
580
  msgstr ""
581
 
582
+ #: includes/class-wc-gateway-ppec-with-paypal-addons.php:219
583
  msgid "PayPal payment declined"
584
  msgstr ""
585
 
594
  msgstr ""
595
 
596
  #. translators: placeholders are error code and message from PayPal
597
+
598
  #: includes/exceptions/class-wc-gateway-ppec-api-exception.php:64
599
  msgid "PayPal error (%1$s): %2$s"
600
  msgstr ""
1106
  #: includes/settings/settings-ppec.php:681
1107
  msgid "Configure settings specific to regular checkout"
1108
  msgstr ""
1109
+ #. Plugin Name of the plugin/theme
1110
+ msgid "WooCommerce PayPal Checkout Gateway"
1111
+ msgstr ""
1112
+
1113
+ #. Plugin URI of the plugin/theme
1114
+ msgid "https://woocommerce.com/products/woocommerce-gateway-paypal-express-checkout/"
1115
+ msgstr ""
1116
+
1117
+ #. Description of the plugin/theme
1118
+ msgid "Accept all major credit and debit cards, plus Venmo and PayPal Credit in the US, presenting options in a customizable stack of payment buttons. Fast, seamless, and flexible."
1119
+ msgstr ""
1120
+
1121
+ #. Author of the plugin/theme
1122
+ msgid "WooCommerce"
1123
+ msgstr ""
1124
+
1125
+ #. Author URI of the plugin/theme
1126
+ msgid "https://woocommerce.com"
1127
+ msgstr ""
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: 5.3
6
- Stable tag: 1.6.18
7
  License: GPLv3
8
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
9
 
@@ -101,6 +101,16 @@ Please use this to inform us about bugs, or make contributions via PRs.
101
 
102
  == Changelog ==
103
 
 
 
 
 
 
 
 
 
 
 
104
  = 1.6.18 - 2019-12-05 =
105
  * Fix - Send fees to PayPal as line items
106
  * Fix - Fix error 10426 when coupons are used
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: 5.3
6
+ Stable tag: 1.6.19
7
  License: GPLv3
8
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
9
 
101
 
102
  == Changelog ==
103
 
104
+ = 1.6.19 - 2020-02-06 =
105
+ * Fix - Check if order exists before adding order actions. PR #653
106
+ * Fix - Global attributes stripped before sent to PayPal if unicode characters. PR#470
107
+ * Fix - Handle subscription payment change. PR#640
108
+ * Fix - Fixes error "Trying to get property of non-object" found during onboarding wizard. PR#654
109
+ * Fix - Hide smart payment buttons on mini cart when cart is empty. PR#450
110
+ * Fix - Only display smart buttons on product page if product is in stock. PR#662
111
+ * Fix - Do not display smart buttons for external products and grouped products. PR#663
112
+ * Update - Display a WooCommerce pre 3.0 admin notice warning. In an upcoming release PayPal Checkout will drop support for WC 2.6 and below. PR#671
113
+
114
  = 1.6.18 - 2019-12-05 =
115
  * Fix - Send fees to PayPal as line items
116
  * Fix - Fix error 10426 when coupons are used
woocommerce-gateway-paypal-express-checkout.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: WooCommerce PayPal Checkout Gateway
4
  * Plugin URI: https://woocommerce.com/products/woocommerce-gateway-paypal-express-checkout/
5
  * Description: Accept all major credit and debit cards, plus Venmo and PayPal Credit in the US, presenting options in a customizable stack of payment buttons. Fast, seamless, and flexible.
6
- * Version: 1.6.18
7
  * Author: WooCommerce
8
  * Author URI: https://woocommerce.com
9
  * Copyright: © 2019 WooCommerce / PayPal.
@@ -11,7 +11,7 @@
11
  * License URI: http://www.gnu.org/licenses/gpl-3.0.html
12
  * Text Domain: woocommerce-gateway-paypal-express-checkout
13
  * Domain Path: /languages
14
- * WC tested up to: 3.8.1
15
  * WC requires at least: 2.6
16
  */
17
  /**
@@ -27,7 +27,7 @@ if ( ! defined( 'ABSPATH' ) ) {
27
  exit; // Exit if accessed directly
28
  }
29
 
30
- define( 'WC_GATEWAY_PPEC_VERSION', '1.6.18' );
31
 
32
  /**
33
  * Return instance of WC_Gateway_PPEC_Plugin.
3
  * Plugin Name: WooCommerce PayPal Checkout Gateway
4
  * Plugin URI: https://woocommerce.com/products/woocommerce-gateway-paypal-express-checkout/
5
  * Description: Accept all major credit and debit cards, plus Venmo and PayPal Credit in the US, presenting options in a customizable stack of payment buttons. Fast, seamless, and flexible.
6
+ * Version: 1.6.19
7
  * Author: WooCommerce
8
  * Author URI: https://woocommerce.com
9
  * Copyright: © 2019 WooCommerce / PayPal.
11
  * License URI: http://www.gnu.org/licenses/gpl-3.0.html
12
  * Text Domain: woocommerce-gateway-paypal-express-checkout
13
  * Domain Path: /languages
14
+ * WC tested up to: 3.9
15
  * WC requires at least: 2.6
16
  */
17
  /**
27
  exit; // Exit if accessed directly
28
  }
29
 
30
+ define( 'WC_GATEWAY_PPEC_VERSION', '1.6.19' );
31
 
32
  /**
33
  * Return instance of WC_Gateway_PPEC_Plugin.